Commit 9f54c469 9f54c469d1d4e6dc2b5d4df5c6c8ddc6f74757ff by root

save

1 parent db7d888b
Showing 24 changed files with 103 additions and 91 deletions
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
135 <dependency> 135 <dependency>
136 <groupId>org.emercit</groupId> 136 <groupId>org.emercit</groupId>
137 <artifactId>utilstools</artifactId> 137 <artifactId>utilstools</artifactId>
138 <version>1.19</version> 138 <version>1.21</version>
139 </dependency> 139 </dependency>
140 140
141 <dependency> 141 <dependency>
......
1 7018931d960794577dd2bdceca298daa
...\ No newline at end of file ...\ No newline at end of file
1 ad98ab874f05a2dcd17c731f07484a9b8bf9cb5c
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4 <modelVersion>4.0.0</modelVersion>
5 <groupId>org.emercit</groupId>
6 <artifactId>utilstools</artifactId>
7 <version>1.20</version>
8 </project>
1 3d9fc1e23966dbe0affb0e7b55c2f24b
...\ No newline at end of file ...\ No newline at end of file
1 b916c18fdcdabbd4fa06c0905962fdab1ac24bbc
...\ No newline at end of file ...\ No newline at end of file
1 eb2b34eedfed8215eac2dab36e46a6dc
...\ No newline at end of file ...\ No newline at end of file
1 09f3ef732de8e1e5e508b943a1edd683eafe83e0
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4 <modelVersion>4.0.0</modelVersion>
5 <groupId>org.emercit</groupId>
6 <artifactId>utilstools</artifactId>
7 <version>1.21</version>
8 </project>
1 6d56e7561927517d16e40fb5dababf66
...\ No newline at end of file ...\ No newline at end of file
1 f9b1e636e351bfc0a62a211932d96c5b9cbe0f2f
...\ No newline at end of file ...\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
3 <groupId>org.emercit</groupId> 3 <groupId>org.emercit</groupId>
4 <artifactId>utilstools</artifactId> 4 <artifactId>utilstools</artifactId>
5 <versioning> 5 <versioning>
6 <release>1.19</release> 6 <release>1.21</release>
7 <versions> 7 <versions>
8 <version>1.0</version> 8 <version>1.0</version>
9 <version>1.1</version> 9 <version>1.1</version>
...@@ -25,7 +25,9 @@ ...@@ -25,7 +25,9 @@
25 <version>1.17</version> 25 <version>1.17</version>
26 <version>1.18</version> 26 <version>1.18</version>
27 <version>1.19</version> 27 <version>1.19</version>
28 <version>1.20</version>
29 <version>1.21</version>
28 </versions> 30 </versions>
29 <lastUpdated>20150803150448</lastUpdated> 31 <lastUpdated>20150804023457</lastUpdated>
30 </versioning> 32 </versioning>
31 </metadata> 33 </metadata>
......
1 d34ae0920d262ed8a7e7789704f6bd3f
...\ No newline at end of file ...\ No newline at end of file
1 c9b18dea54a893e48d929c6b566329b1
...\ No newline at end of file ...\ No newline at end of file
......
1 8b381d539ac70fc11e401d627b0d6ff9d263d66d
...\ No newline at end of file ...\ No newline at end of file
1 68228ae65b16d9fbc4558423f27c44a7e54d4b93
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -56,22 +56,24 @@ public class ProxyController { ...@@ -56,22 +56,24 @@ public class ProxyController {
56 @RequestMapping(value="proxy/update" , method = RequestMethod.POST) 56 @RequestMapping(value="proxy/update" , method = RequestMethod.POST)
57 public @ResponseBody MsgResult update(@RequestBody ProxyBean[] beans) { 57 public @ResponseBody MsgResult update(@RequestBody ProxyBean[] beans) {
58 58
59 Vector<ProxyBean> dbs=new Vector<ProxyBean>(); 59 Vector<ProxyBean> dbs=ProxyService.INSTANCE.getAllProxyBean();
60 60
61 for (ProxyBean d:beans) { 61 for (int i=0;i<beans.length;i++) {
62 for (ProxyBean d:dbs) {
62 63
63 ProxyBean db=new ProxyBean(); 64 if (d.getProtocol().equals(beans[i].getProtocol())) {
64 65
65 66
66 //db.setId(d.getId()); 67 d.setProtocol(beans[i].getProtocol());
67 db.setProtocol(d.getProtocol()); 68 d.setHost(beans[i].getHost());
68 db.setHost(d.getHost()); 69 d.setPort(beans[i].getPort());
69 db.setPort(d.getPort()); 70 d.setLogin(beans[i].getLogin());
70 db.setLogin(d.getLogin()); 71 d.setPass(beans[i].getPass());
71 db.setPass(d.getPass()); 72 d.setEnabled(beans[i].getEnabled());
72 db.setEnabled(d.getEnabled()); 73 d.setUseauth(beans[i].getUseauth());
73 // db.setAuth(d.getAuth()); 74 }
74 dbs.add(db); 75
76 }
75 } 77 }
76 return Msg.getMsgResultByCode(ProxyService.INSTANCE.Upd(dbs)); 78 return Msg.getMsgResultByCode(ProxyService.INSTANCE.Upd(dbs));
77 } 79 }
......
...@@ -42,7 +42,5 @@ public enum EthService { ...@@ -42,7 +42,5 @@ public enum EthService {
42 public int Reload(EthBean m) { 42 public int Reload(EthBean m) {
43 return ethlinux.reload(m.getName()); 43 return ethlinux.reload(m.getName());
44 } 44 }
45
46
47 } 45 }
48 46
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -57,19 +57,20 @@ Ext.define('App.controller.Proxy', { ...@@ -57,19 +57,20 @@ Ext.define('App.controller.Proxy', {
57 }, 57 },
58 58
59 59
60 60 saveProxy:function(btn) {
61 61
62 62 //var proxyView = btn.up('mvvm-ProxyView');
63 saveProxy:function() { 63
64 //proxyView.mask("Сохранение...");
64 65
65 var records = []; 66 var records = [];
66 67
67 records.push(this.getModelFromForm(0,"http")); 68 records.push(this.getModelFromForm("http"));
68 records.push(this.getModelFromForm(1,"https")); 69 records.push(this.getModelFromForm("https"));
69 records.push(this.getModelFromForm(2,"ftp")); 70 records.push(this.getModelFromForm("ftp"));
70 71
71 var data=Ext.util.JSON.encode(records); 72 var data=Ext.util.JSON.encode(records);
72 73
73 Ext.Ajax.request({ 74 Ext.Ajax.request({
74 method: "POST", 75 method: "POST",
75 url: 'api/proxy/update', 76 url: 'api/proxy/update',
...@@ -79,12 +80,12 @@ Ext.define('App.controller.Proxy', { ...@@ -79,12 +80,12 @@ Ext.define('App.controller.Proxy', {
79 }, 80 },
80 params: data, 81 params: data,
81 success: function(response, opts) { 82 success: function(response, opts) {
82 83 // proxyView.unmask();
83 var result = Ext.JSON.decode(response.responseText); 84 var result = Ext.JSON.decode(response.responseText);
84 Ext.Msg.alert(result.type+" "+"Код-"+result.code,result.message); 85 Ext.Msg.alert(result.type+" "+"Код-"+result.code,result.message);
85 86
86 }, failure: function(response, opts) { 87 }, failure: function(response, opts) {
87 networksettingView.unmask(); 88 proxyView.unmask();
88 Ext.Msg.alert('Ошибка', 'Сервер недоступен'); 89 Ext.Msg.alert('Ошибка', 'Сервер недоступен');
89 } 90 }
90 }); 91 });
...@@ -94,58 +95,45 @@ Ext.define('App.controller.Proxy', { ...@@ -94,58 +95,45 @@ Ext.define('App.controller.Proxy', {
94 95
95 }, 96 },
96 97
97 getModelFromForm:function (id,protocol) { 98 getModelFromForm:function (protocol) {
98 99
99 var host; 100
100 var port;
101 var login;
102 var pass;
103 var enabled;
104 var auth;
105
106 var proxy;
107 101
108 var formproxy=Ext.getCmp("formproxy"); 102 var formproxy=Ext.getCmp("formproxy");
109 103
110 var fsHttps = formproxy.down('#fs'+protocol); 104 var fsHttps = formproxy.down('#fs'+protocol);
111 105
112 106
113 enabled=fsHttps.checkboxCmp.getValue(); 107 var enabled=fsHttps.checkboxCmp.getValue();
114
115 host=fsHttps.down('#'+protocol+'Adress').getValue();
116 port=parseInt(fsHttps.down('#'+protocol+'Port').getValue());
117 108
118 if(port==null) { 109 var host=fsHttps.down('#'+protocol+'Adress').getValue();
119 port=0; 110 var port=parseInt(fsHttps.down('#'+protocol+'Port').getValue());
120 }
121 111
122 var fsHttpsAuth=fsHttps.down('#fs'+protocol+'Auth'); 112 var fsHttpsAuth=fsHttps.down('#fs'+protocol+'Auth');
123 113
124 auth=fsHttpsAuth.checkboxCmp.getValue(); 114 var useauth=fsHttpsAuth.checkboxCmp.getValue();
125
126 login=fsHttpsAuth.down('#'+protocol+'Login').getValue();
127 pass=fsHttpsAuth.down('#'+protocol+'Password').getValue();
128
129
130
131 115
132 proxy = { 116 var login=fsHttpsAuth.down('#'+protocol+'Login').getValue();
133 id:id, 117 var pass=fsHttpsAuth.down('#'+protocol+'Password').getValue();
118
119 var proxy = {
134 protocol:protocol, 120 protocol:protocol,
135 host:host, 121 host:host,
136 port:0, 122 port:port,
137 login:login, 123 login:login,
138 pass:pass, 124 pass:pass,
139 enabled:enabled, 125 enabled:enabled,
140 auth:auth 126 useauth:useauth
141 }; 127 };
142
143 return proxy; 128 return proxy;
144 }, 129 },
145 130
146 131
147 132
148 loadProxy:function() { 133 loadProxy:function(btn) {
134 // var proxyView = btn.up('mvvm-ProxyView');
135
136 // proxyView.mask("Загрузка...");
149 137
150 Ext.Ajax.request({ 138 Ext.Ajax.request({
151 method: "GET", 139 method: "GET",
...@@ -156,15 +144,20 @@ Ext.define('App.controller.Proxy', { ...@@ -156,15 +144,20 @@ Ext.define('App.controller.Proxy', {
156 }, 144 },
157 145
158 success: function(response, opts) { 146 success: function(response, opts) {
159 147 // proxyView.unmask();
160 var result = Ext.JSON.decode(response.responseText); 148 var result = Ext.JSON.decode(response.responseText);
161 149
162 for(var i in result){ 150 for(var i in result){
163 this.setModelToForm(result[i]); 151 this.setModelToForm(result[i]);
164 } 152 }
165 }, failure: function(response, opts) { 153
166 Ext.Msg.alert('Failure', 'Ошибка сохранения'); 154
167 } 155 Ext.Msg.alert('Успешно', 'Загрузка данных выполнена');
156
157 }, failure: function(response, opts) {
158 proxyView.unmask();
159 Ext.Msg.alert('Ошибка', 'Сервер недоступен');
160 }
168 }); 161 });
169 162
170 } 163 }
......
...@@ -30,11 +30,7 @@ Ext.define('App.view.Proxy', { ...@@ -30,11 +30,7 @@ Ext.define('App.view.Proxy', {
30 30
31 }, 31 },
32 32
33
34
35
36 items: [ 33 items: [
37
38 { 34 {
39 xtype:'fieldset', 35 xtype:'fieldset',
40 checkboxToggle:true, 36 checkboxToggle:true,
......
...@@ -20,13 +20,9 @@ public class EthLinux implements IEth { ...@@ -20,13 +20,9 @@ public class EthLinux implements IEth {
20 private CmdExec cmdexec=new CmdExec(); 20 private CmdExec cmdexec=new CmdExec();
21 21
22 private Vector<EthBean> ebs=new Vector<EthBean>(); 22 private Vector<EthBean> ebs=new Vector<EthBean>();
23
24 private Db db=new Db(Paths.BEAN_ETH); 23 private Db db=new Db(Paths.BEAN_ETH);
25
26 private Vector<String> extinfo; 24 private Vector<String> extinfo;
27
28 private String mac; 25 private String mac;
29
30 private EthBean emp; 26 private EthBean emp;
31 27
32 public EthLinux() { 28 public EthLinux() {
...@@ -38,8 +34,6 @@ public class EthLinux implements IEth { ...@@ -38,8 +34,6 @@ public class EthLinux implements IEth {
38 34
39 35
40 public int reload(String name) { 36 public int reload(String name) {
41
42
43 try { 37 try {
44 Vector<String> buff=cmdexec.Run("ifdown"+" "+name); 38 Vector<String> buff=cmdexec.Run("ifdown"+" "+name);
45 Thread.sleep(5000); 39 Thread.sleep(5000);
...@@ -54,7 +48,6 @@ public class EthLinux implements IEth { ...@@ -54,7 +48,6 @@ public class EthLinux implements IEth {
54 log.error(e.getMessage()); 48 log.error(e.getMessage());
55 return Msg.RestartEthErr.getCode(); 49 return Msg.RestartEthErr.getCode();
56 } 50 }
57
58 } 51 }
59 52
60 53
......
...@@ -21,6 +21,10 @@ public class ProxyBean implements Serializable { ...@@ -21,6 +21,10 @@ public class ProxyBean implements Serializable {
21 21
22 private boolean useauth; 22 private boolean useauth;
23 23
24
25
26
27
24 public ProxyBean() { 28 public ProxyBean() {
25 29
26 30
...@@ -56,7 +60,7 @@ public class ProxyBean implements Serializable { ...@@ -56,7 +60,7 @@ public class ProxyBean implements Serializable {
56 this.enabled=value; 60 this.enabled=value;
57 } 61 }
58 62
59 public void setUseAuth(boolean value) { 63 public void setUseauth(boolean value) {
60 this.useauth=value; 64 this.useauth=value;
61 } 65 }
62 66
...@@ -66,32 +70,32 @@ public class ProxyBean implements Serializable { ...@@ -66,32 +70,32 @@ public class ProxyBean implements Serializable {
66 */ 70 */
67 71
68 public String getProtocol() { 72 public String getProtocol() {
69 return this.protocol; 73 return protocol;
70 } 74 }
71 75
72 public String getHost() { 76 public String getHost() {
73 return this.host; 77 return host;
74 } 78 }
75 79
76 public int getPort() { 80 public int getPort() {
77 return this.port; 81 return port;
78 } 82 }
79 83
80 public String getLogin() { 84 public String getLogin() {
81 return this.login; 85 return login;
82 } 86 }
83 87
84 public String getPass() { 88 public String getPass() {
85 return this.pass; 89 return pass;
86 } 90 }
87 91
88 92
89 public boolean getEnabled() { 93 public boolean getEnabled() {
90 return this.enabled; 94 return enabled;
91 } 95 }
92 96
93 public boolean getUseAuth() { 97 public boolean getUseauth() {
94 return this.useauth; 98 return useauth;
95 } 99 }
96 100
97 101
......
...@@ -59,7 +59,7 @@ public class ProxyLinux implements IProxy { ...@@ -59,7 +59,7 @@ public class ProxyLinux implements IProxy {
59 for (ProxyBean pb:pbs) { 59 for (ProxyBean pb:pbs) {
60 60
61 if (pb.getEnabled()) { 61 if (pb.getEnabled()) {
62 if (pb.getUseAuth()) { 62 if (pb.getUseauth()) {
63 bw.write(pb.getProtocol()+"_proxy"+"='"+"http://"+pb.getLogin()+":"+pb.getPass()+"@"+pb.getHost()+":"+pb.getPort()+"'\n"); 63 bw.write(pb.getProtocol()+"_proxy"+"='"+"http://"+pb.getLogin()+":"+pb.getPass()+"@"+pb.getHost()+":"+pb.getPort()+"'\n");
64 }else { 64 }else {
65 bw.write(pb.getProtocol()+"_proxy"+"='"+"http://"+pb.getHost()+":"+pb.getPort()+"'\n"); 65 bw.write(pb.getProtocol()+"_proxy"+"='"+"http://"+pb.getHost()+":"+pb.getPort()+"'\n");
...@@ -90,7 +90,7 @@ public class ProxyLinux implements IProxy { ...@@ -90,7 +90,7 @@ public class ProxyLinux implements IProxy {
90 pmp.setPort(DefSettings.Proxy_http_port); 90 pmp.setPort(DefSettings.Proxy_http_port);
91 pmp.setLogin(DefSettings.Proxy_http_login); 91 pmp.setLogin(DefSettings.Proxy_http_login);
92 pmp.setPass(DefSettings.Proxy_http_pass); 92 pmp.setPass(DefSettings.Proxy_http_pass);
93 pmp.setUseAuth(DefSettings.Proxy_http_useauth); 93 pmp.setUseauth(DefSettings.Proxy_http_useauth);
94 pbs.add(pmp); 94 pbs.add(pmp);
95 //HTTPS PROXY 95 //HTTPS PROXY
96 pmp=new ProxyBean(); 96 pmp=new ProxyBean();
...@@ -100,7 +100,7 @@ public class ProxyLinux implements IProxy { ...@@ -100,7 +100,7 @@ public class ProxyLinux implements IProxy {
100 pmp.setPort(DefSettings.Proxy_https_port); 100 pmp.setPort(DefSettings.Proxy_https_port);
101 pmp.setLogin(DefSettings.Proxy_https_login); 101 pmp.setLogin(DefSettings.Proxy_https_login);
102 pmp.setPass(DefSettings.Proxy_https_pass); 102 pmp.setPass(DefSettings.Proxy_https_pass);
103 pmp.setUseAuth(DefSettings.Proxy_https_useauth); 103 pmp.setUseauth(DefSettings.Proxy_https_useauth);
104 pbs.add(pmp); 104 pbs.add(pmp);
105 //FTP PROXY 105 //FTP PROXY
106 pmp=new ProxyBean(); 106 pmp=new ProxyBean();
...@@ -110,7 +110,7 @@ public class ProxyLinux implements IProxy { ...@@ -110,7 +110,7 @@ public class ProxyLinux implements IProxy {
110 pmp.setPort(DefSettings.Proxy_ftp_port); 110 pmp.setPort(DefSettings.Proxy_ftp_port);
111 pmp.setLogin(DefSettings.Proxy_ftp_login); 111 pmp.setLogin(DefSettings.Proxy_ftp_login);
112 pmp.setPass(DefSettings.Proxy_ftp_pass); 112 pmp.setPass(DefSettings.Proxy_ftp_pass);
113 pmp.setUseAuth(DefSettings.Proxy_ftp_useauth); 113 pmp.setUseauth(DefSettings.Proxy_ftp_useauth);
114 pbs.add(pmp); 114 pbs.add(pmp);
115 115
116 return Config(pbs); 116 return Config(pbs);
......
...@@ -64,7 +64,7 @@ public class DefSettings { ...@@ -64,7 +64,7 @@ public class DefSettings {
64 public static final String Server_name="Локальный сервер"; 64 public static final String Server_name="Локальный сервер";
65 public static final String Server_ip="127.0.0.1"; 65 public static final String Server_ip="127.0.0.1";
66 public static final int Server_port=80; 66 public static final int Server_port=80;
67 public static final String Server_type="СЗС"; 67 public static final String Server_type="szs";
68 public static final String Server_title=""; 68 public static final String Server_title="";
69 //JETTY 69 //JETTY
70 public static final int jetty_id=0; 70 public static final int jetty_id=0;
......