Commit 9fa4f8b8 9fa4f8b83b426ec797a6973a17da768129e63a91 by root

save

1 parent c4f08700
...@@ -126,29 +126,36 @@ ...@@ -126,29 +126,36 @@
126 126
127 <!-- Test --> 127 <!-- Test -->
128 <dependency> 128 <dependency>
129 <groupId>junit</groupId> 129 <groupId>junit</groupId>
130 <artifactId>junit</artifactId> 130 <artifactId>junit</artifactId>
131 <version>4.7</version> 131 <version>4.7</version>
132 <scope>test</scope> 132 <scope>test</scope>
133 </dependency> 133 </dependency>
134 134
135 <dependency> 135 <dependency>
136 <groupId>org.emercit</groupId> 136 <groupId>org.emercit</groupId>
137 <artifactId>devinfo</artifactId> 137 <artifactId>devinfo</artifactId>
138 <version>1.0</version> 138 <version>1.0</version>
139 </dependency> 139 </dependency>
140
141 <dependency>
142 <groupId>org.emercit</groupId>
143 <artifactId>ethmanager</artifactId>
144 <version>1.3</version>
145 </dependency>
146
147 <dependency>
148 <groupId>org.emercit</groupId>
149 <artifactId>dnsmanager</artifactId>
150 <version>1.8</version>
151 </dependency>
140 152
141 <dependency>
142 <groupId>org.emercit</groupId>
143 <artifactId>ethmanager</artifactId>
144 <version>1.3</version>
145 </dependency>
146 153
147 <dependency> 154 <dependency>
148 <groupId>org.emercit</groupId> 155 <groupId>org.emercit</groupId>
149 <artifactId>dnsmanager</artifactId> 156 <artifactId>proxymanager</artifactId>
150 <version>1.8</version> 157 <version>1.5</version>
151 </dependency> 158 </dependency>
152 159
153 </dependencies> 160 </dependencies>
154 161
......
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
......
...@@ -2,11 +2,25 @@ Ext.define('App.model.Proxy', { ...@@ -2,11 +2,25 @@ Ext.define('App.model.Proxy', {
2 extend : 'Ext.data.Model', 2 extend : 'Ext.data.Model',
3 3
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', 9 type:'string'
10 type:'string' 10 },{
11 }] 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'
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:'Добавить', 8
11 margin:'5 5 5 5', 9
12 handler: function(){ 10 bbar: {
13 11
14 if (winaddproxy==null) { 12 items: [ {
15 var winaddproxy = Ext.create('widget.window', { // создание окна 13 xtype: 'button',
16 title:'Добавить', 14 iconCls:'save',
17 15 itemId: 'SaveProxyButton',
18 maximize: function(){ 16 text: 'Сохранить',
19 this.callParent([true]); //animate 17 action: 'saveProxy',
20 }, 18 disabled:false
21 19 },
22 restore: function(){ 20 {
23 this.callParent([true]); //animate 21 xtype: 'button',
24 }, 22 iconCls:'load',
25 23 itemId: 'LoadProxyButton',
26 closeAction: 'hide', 24 text: 'Обновить',
27 items: [ 25 action: 'loadProxy',
28 { 26 disabled:false
29 xtype : 'mvvm-DetailProxyView', 27 }
30 28 ]
31 viewModel : { 29
32 data : { 30
33 rec : { 31 },
34 proxy:"http_proxy='http://user:password@proxyserver:7777'" 32
35 } 33
36 }
37 }
38 }
39 ]
40 });
41
42 winaddproxy.show();
43 }
44
45
46
47 }
48 }] ,
49
50 34
51 35
52 columns: [{ 36 items: [
53 text : '№', 37
54 dataIndex : 'id', 38 {
55 flex: 1 39 xtype:'fieldset',
56 }, 40 checkboxToggle:true,
57 { 41 itemId:'fshttp',
58 text : 'Proxy сервер', 42 title: 'HTTP',
59 dataIndex : 'proxy', 43 defaultType: 'textfield',
60 flex : 5 44 collapsed: false,
61 }, 45 layout: 'anchor',
62 { 46 defaults: {
63 xtype: 'actioncolumn', 47 anchor: '100%'
64 text : '#', 48 },
65 flex:1, 49 items :[ // HTTP
66 dataIndex: 'guid', 50 {
67 items: [{ 51 fieldLabel: 'IP адрес',
68 icon: 'resources/img/tools.png', 52 itemId: 'httpAdress',
69 handler: function (grid, rowIndex, colIndex) { 53 allowBlank:false
70 var rec = grid.getStore().getAt(rowIndex); 54 },{
71 55 fieldLabel: 'Порт',
72 if (wintoolsproxy==null) { 56 itemId: 'httpPort',
73 var wintoolsproxy = Ext.create('widget.window', { // создание окна 57 allowBlank:false
74 title:'Изменить', 58 },
75 59 {
76 maximize: function(){ 60 xtype:'fieldset',
77 this.callParent([true]); //animate 61 checkboxToggle:true,
78 }, 62 itemId:'fshttpAuth',
63 title: 'Авторизация',
64 defaultType: 'textfield',
65 collapsed: true,
66 layout: 'anchor',
67 defaults: {
68 anchor: '100%'
69 },
70 items :[{
71 fieldLabel: 'Логин',
72 itemId: 'httpLogin',
73 allowBlank:false
74 },
75 {
76 fieldLabel: 'Пароль',
77 itemId: 'httpPassword',
78 allowBlank:false
79 }]
80 }
81
82
83 ]
84 },
85
86 //HTTPS
87
88 {
89 xtype:'fieldset',
90 checkboxToggle:true,
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 }]
129 }
130
131
132 ]
133 },
134
135 //FTP
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 }]
178 }
179
180
181 ]
182 }
183 ]
79 184
80 restore: function(){
81 this.callParent([true]); //animate
82 },
83
84 closeAction: 'hide',
85 items: [
86 {
87 xtype : 'mvvm-DetailProxyView',
88 viewModel : {
89 data : {
90 rec : rec
91 }
92 }
93 }
94 ]
95
96 });
97
98 wintoolsproxy.show();
99 }
100 }
101 }
102 ],
103
104 action: 'tools'
105 },
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
117
118 var selectedRecord = grid.getStore().getAt(rowIndex);
119 grid.getStore().each(function(rec) {
120 if (rec == selectedRecord) {
121 grid.store.remove(rec);
122 }
123 });
124 grid.getView().refresh();
125
126
127
128
129
130 }
131 }],
132 185
133 action: 'delete' 186
134 }
135
136
137
138 ]
139 }); 187 });
...\ No newline at end of file ...\ No newline at end of file
......