Commit 9fa4f8b8 9fa4f8b83b426ec797a6973a17da768129e63a91 by root

save

1 parent c4f08700
...@@ -150,6 +150,13 @@ ...@@ -150,6 +150,13 @@
150 <version>1.8</version> 150 <version>1.8</version>
151 </dependency> 151 </dependency>
152 152
153
154 <dependency>
155 <groupId>org.emercit</groupId>
156 <artifactId>proxymanager</artifactId>
157 <version>1.5</version>
158 </dependency>
159
153 </dependencies> 160 </dependencies>
154 161
155 162
......
1 package org.emercit.app; 1 package org.emercit.devtools.app;
2 2
3 import java.util.Locale; 3 import java.util.Locale;
4 4
...@@ -28,10 +28,8 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -28,10 +28,8 @@ import org.springframework.web.bind.annotation.RequestBody;
28 28
29 import java.util.Vector; 29 import java.util.Vector;
30 30
31 import org.emercit.service.DevInfoService;
32
33
34 import org.emercit.devinfo.model.DevInfoBean; 31 import org.emercit.devinfo.model.DevInfoBean;
32 import org.emercit.devtools.service.DevInfoService;
35 33
36 34
37 35
......
1 package org.emercit.app; 1 package org.emercit.devtools.app;
2 2
3 import java.util.Locale; 3 import java.util.Locale;
4 4
...@@ -23,12 +23,10 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -23,12 +23,10 @@ import org.springframework.web.bind.annotation.RequestBody;
23 import java.util.Vector; 23 import java.util.Vector;
24 24
25 import org.emercit.ethmanager.model.EthBean; 25 import org.emercit.ethmanager.model.EthBean;
26 import org.emercit.devtools.service.DnsService;
27 import org.emercit.devtools.service.EthService;
26 import org.emercit.dnsmanager.model.DnsBean; 28 import org.emercit.dnsmanager.model.DnsBean;
27 29
28 import org.emercit.service.EthService;
29 import org.emercit.service.DnsService;
30
31
32 import java.util.ArrayList; 30 import java.util.ArrayList;
33 import java.util.List; 31 import java.util.List;
34 32
......
1 package org.emercit.app; 1 package org.emercit.devtools.app;
2 2
3 3
4 import java.util.Locale; 4 import java.util.Locale;
...@@ -30,11 +30,10 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -30,11 +30,10 @@ import org.springframework.web.bind.annotation.RequestBody;
30 import java.util.Vector; 30 import java.util.Vector;
31 31
32 import org.emercit.ethmanager.model.EthBean; 32 import org.emercit.ethmanager.model.EthBean;
33 import org.emercit.devtools.service.DnsService;
34 import org.emercit.devtools.service.EthService;
33 import org.emercit.dnsmanager.model.DnsBean; 35 import org.emercit.dnsmanager.model.DnsBean;
34 36
35 import org.emercit.service.EthService;
36 import org.emercit.service.DnsService;
37
38 37
39 38
40 @Controller 39 @Controller
......
1 package org.emercit.app; 1 package org.emercit.devtools.app;
2 2
3 import java.util.Locale; 3 import java.util.Locale;
4 4
......
1 package org.emercit.service; 1 package org.emercit.devtools.service;
2 2
3 3
4 import org.emercit.model.IPAddressValidator; 4 import org.emercit.model.IPAddressValidator;
......
1 package org.emercit.service; 1 package org.emercit.devtools.service;
2 2
3 3
4 import org.emercit.model.IPAddressValidator; 4 import org.emercit.model.IPAddressValidator;
......
1 package org.emercit.service; 1 package org.emercit.devtools.service;
2 2
3 3
4 import org.emercit.model.IPAddressValidator; 4 import org.emercit.model.IPAddressValidator;
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
23 <beans:property name="suffix" value=".jsp" /> 23 <beans:property name="suffix" value=".jsp" />
24 </beans:bean> 24 </beans:bean>
25 25
26 <context:component-scan base-package="org.emercit.app" /> 26 <context:component-scan base-package="org.emercit.devtools.app" />
27 27
28 <!-- Transporting JSON - Data --> 28 <!-- Transporting JSON - Data -->
29 <beans:bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver"> 29 <beans:bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
......
...@@ -20,15 +20,15 @@ Ext.application({ ...@@ -20,15 +20,15 @@ Ext.application({
20 'MainConfig', 20 'MainConfig',
21 'PingUtil', 21 'PingUtil',
22 'DetailDns', 22 'DetailDns',
23 'Dns' 23 'Dns',
24 'Proxy'
24 25
25 26
26 ], 27 ],
27 28
28 stores : [ 29 stores : [
29 'Eth', 30 'Eth',
30 'Dns', 31 'Dns'
31 'Proxy'
32 32
33 ], 33 ],
34 34
......
...@@ -4,9 +4,23 @@ Ext.define('App.model.Proxy', { ...@@ -4,9 +4,23 @@ Ext.define('App.model.Proxy', {
4 fields : [{ 4 fields : [{
5 name:'id', 5 name:'id',
6 type:'int' 6 type:'int'
7 }, 7 },{
8 { 8 name:'protocol',
9 name:'proxy',
10 type:'string' 9 type:'string'
10 },{
11 name:'host',
12 type:'string'
13 },{
14 name:'port',
15 type:'int'
16 },{
17 name:'login',
18 type:'string'
19 },{
20 name:'pass'
21 },{
22 name:'enabled'
23 },{
24 name:'auth'
11 }] 25 }]
12 }); 26 });
...\ No newline at end of file ...\ No newline at end of file
......
1
2 Ext.define('App.store.Proxy', {
3 extend : 'Ext.data.Store',
4
5 requires : [
6 'App.model.Proxy'
7 ],
8
9 storeId : 'Proxy',
10 model : 'App.model.Proxy',
11 autoLoad: true,
12 autoSync: true,
13 alias: 'store.devices',
14 proxy : {
15 type : 'ajax',
16 api: {
17 read: 'api/net/proxy'
18 },
19 reader : {
20 type : 'json',
21 idProperty : 'id'
22 }
23 }
24 });
...\ No newline at end of file ...\ No newline at end of file
1 1
2 Ext.define('App.view.Proxy', { 2 Ext.define('App.view.Proxy', {
3 extend : 'Ext.grid.Panel', 3 extend : 'Ext.form.Panel',
4 xtype : 'mvvm-ProxyView', 4 xtype : 'mvvm-ProxyView',
5 title : 'Proxy сервера',
6 store : 'Proxy',
7 5
8 tbar: [ 6 width: 550,
9 { 7 bodyPadding: 10,
10 text:'Добавить',
11 margin:'5 5 5 5',
12 handler: function(){
13 8
14 if (winaddproxy==null) {
15 var winaddproxy = Ext.create('widget.window', { // создание окна
16 title:'Добавить',
17 9
18 maximize: function(){ 10 bbar: {
19 this.callParent([true]); //animate
20 },
21 11
22 restore: function(){ 12 items: [ {
23 this.callParent([true]); //animate 13 xtype: 'button',
14 iconCls:'save',
15 itemId: 'SaveProxyButton',
16 text: 'Сохранить',
17 action: 'saveProxy',
18 disabled:false
24 }, 19 },
25
26 closeAction: 'hide',
27 items: [
28 { 20 {
29 xtype : 'mvvm-DetailProxyView', 21 xtype: 'button',
30 22 iconCls:'load',
31 viewModel : { 23 itemId: 'LoadProxyButton',
32 data : { 24 text: 'Обновить',
33 rec : { 25 action: 'loadProxy',
34 proxy:"http_proxy='http://user:password@proxyserver:7777'" 26 disabled:false
35 }
36 }
37 }
38 } 27 }
39 ] 28 ]
40 });
41 29
42 winaddproxy.show();
43 }
44 30
31 },
45 32
46 33
47 }
48 }] ,
49 34
50 35
36 items: [
51 37
52 columns: [{ 38 {
53 text : '№', 39 xtype:'fieldset',
54 dataIndex : 'id', 40 checkboxToggle:true,
55 flex: 1 41 itemId:'fshttp',
42 title: 'HTTP',
43 defaultType: 'textfield',
44 collapsed: false,
45 layout: 'anchor',
46 defaults: {
47 anchor: '100%'
56 }, 48 },
49 items :[ // HTTP
57 { 50 {
58 text : 'Proxy сервер', 51 fieldLabel: 'IP адрес',
59 dataIndex : 'proxy', 52 itemId: 'httpAdress',
60 flex : 5 53 allowBlank:false
54 },{
55 fieldLabel: 'Порт',
56 itemId: 'httpPort',
57 allowBlank:false
61 }, 58 },
62 { 59 {
63 xtype: 'actioncolumn', 60 xtype:'fieldset',
64 text : '#', 61 checkboxToggle:true,
65 flex:1, 62 itemId:'fshttpAuth',
66 dataIndex: 'guid', 63 title: 'Авторизация',
67 items: [{ 64 defaultType: 'textfield',
68 icon: 'resources/img/tools.png', 65 collapsed: true,
69 handler: function (grid, rowIndex, colIndex) { 66 layout: 'anchor',
70 var rec = grid.getStore().getAt(rowIndex); 67 defaults: {
71 68 anchor: '100%'
72 if (wintoolsproxy==null) {
73 var wintoolsproxy = Ext.create('widget.window', { // создание окна
74 title:'Изменить',
75
76 maximize: function(){
77 this.callParent([true]); //animate
78 }, 69 },
79 70 items :[{
80 restore: function(){ 71 fieldLabel: 'Логин',
81 this.callParent([true]); //animate 72 itemId: 'httpLogin',
73 allowBlank:false
82 }, 74 },
83
84 closeAction: 'hide',
85 items: [
86 { 75 {
87 xtype : 'mvvm-DetailProxyView', 76 fieldLabel: 'Пароль',
88 viewModel : { 77 itemId: 'httpPassword',
89 data : { 78 allowBlank:false
90 rec : rec 79 }]
91 }
92 } 80 }
93 }
94 ]
95
96 });
97 81
98 wintoolsproxy.show();
99 }
100 }
101 }
102 ],
103 82
104 action: 'tools' 83 ]
105 }, 84 },
106 {
107 xtype: 'actioncolumn',
108 text : '#',
109 flex:1,
110 dataIndex: 'id',
111 items: [{
112 icon: 'resources/img/delete.png',
113 handler: function (grid, rowIndex, colIndex) {
114
115
116 85
86 //HTTPS
117 87
118 var selectedRecord = grid.getStore().getAt(rowIndex); 88 {
119 grid.getStore().each(function(rec) { 89 xtype:'fieldset',
120 if (rec == selectedRecord) { 90 checkboxToggle:true,
121 grid.store.remove(rec); 91 itemId:'fshttps',
92 title: 'HTTPS',
93 defaultType: 'textfield',
94 collapsed: true,
95 layout: 'anchor',
96 defaults: {
97 anchor: '100%'
98 },
99 items :[ {
100 fieldLabel: 'IP адрес',
101 itemId: 'httpsAdress',
102 allowBlank:false
103 },{
104 fieldLabel: 'Порт',
105 itemId: 'httpsPort',
106 allowBlank:false
107 },
108 {
109 xtype:'fieldset',
110 checkboxToggle:true,
111 itemId:'fshttpsAuth',
112 title: 'Авторизация',
113 defaultType: 'textfield',
114 collapsed: true,
115 layout: 'anchor',
116 defaults: {
117 anchor: '100%'
118 },
119 items :[{
120 fieldLabel: 'Логин',
121 itemId: 'httpsLogin',
122 allowBlank:false
123 },
124 {
125 fieldLabel: 'Пароль',
126 itemId: 'httpsPassword',
127 allowBlank:false
128 }]
122 } 129 }
123 });
124 grid.getView().refresh();
125
126 130
127 131
132 ]
133 },
128 134
135 //FTP
129 136
137 {
138 xtype:'fieldset',
139 checkboxToggle:true,
140 itemId:'fsftp',
141 title: 'FTP',
142 defaultType: 'textfield',
143 collapsed: true,
144 layout: 'anchor',
145 defaults: {
146 anchor: '100%'
147 },
148 items :[ {
149 fieldLabel: 'IP адрес',
150 itemId: 'ftpAdress',
151 allowBlank:false
152 },{
153 fieldLabel: 'Порт',
154 itemId: 'ftpPort',
155 allowBlank:false
156 },
157 {
158 xtype:'fieldset',
159 checkboxToggle:true,
160 title: 'Авторизация',
161 defaultType: 'textfield',
162 itemId:'fsftpAuth',
163 collapsed: true,
164 layout: 'anchor',
165 defaults: {
166 anchor: '100%'
167 },
168 items :[{
169 fieldLabel: 'Логин',
170 itemId: 'ftpLogin',
171 allowBlank:false
172 },
173 {
174 fieldLabel: 'Пароль',
175 itemId: 'ftpPassword',
176 allowBlank:false
177 }]
130 } 178 }
131 }],
132 179
133 action: 'delete' 180
181 ]
134 } 182 }
183 ]
135 184
136 185
137 186
138 ]
139 }); 187 });
...\ No newline at end of file ...\ No newline at end of file
......