Commit 9f54c469 9f54c469d1d4e6dc2b5d4df5c6c8ddc6f74757ff by root

save

1 parent db7d888b
Showing 24 changed files with 103 additions and 91 deletions
......@@ -135,7 +135,7 @@
<dependency>
<groupId>org.emercit</groupId>
<artifactId>utilstools</artifactId>
<version>1.19</version>
<version>1.21</version>
</dependency>
<dependency>
......
7018931d960794577dd2bdceca298daa
\ No newline at end of file
ad98ab874f05a2dcd17c731f07484a9b8bf9cb5c
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<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"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.emercit</groupId>
<artifactId>utilstools</artifactId>
<version>1.20</version>
</project>
3d9fc1e23966dbe0affb0e7b55c2f24b
\ No newline at end of file
b916c18fdcdabbd4fa06c0905962fdab1ac24bbc
\ No newline at end of file
eb2b34eedfed8215eac2dab36e46a6dc
\ No newline at end of file
09f3ef732de8e1e5e508b943a1edd683eafe83e0
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<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"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.emercit</groupId>
<artifactId>utilstools</artifactId>
<version>1.21</version>
</project>
6d56e7561927517d16e40fb5dababf66
\ No newline at end of file
f9b1e636e351bfc0a62a211932d96c5b9cbe0f2f
\ No newline at end of file
......@@ -3,7 +3,7 @@
<groupId>org.emercit</groupId>
<artifactId>utilstools</artifactId>
<versioning>
<release>1.19</release>
<release>1.21</release>
<versions>
<version>1.0</version>
<version>1.1</version>
......@@ -25,7 +25,9 @@
<version>1.17</version>
<version>1.18</version>
<version>1.19</version>
<version>1.20</version>
<version>1.21</version>
</versions>
<lastUpdated>20150803150448</lastUpdated>
<lastUpdated>20150804023457</lastUpdated>
</versioning>
</metadata>
......
d34ae0920d262ed8a7e7789704f6bd3f
\ No newline at end of file
c9b18dea54a893e48d929c6b566329b1
\ No newline at end of file
......
8b381d539ac70fc11e401d627b0d6ff9d263d66d
\ No newline at end of file
68228ae65b16d9fbc4558423f27c44a7e54d4b93
\ No newline at end of file
......
......@@ -56,22 +56,24 @@ public class ProxyController {
@RequestMapping(value="proxy/update" , method = RequestMethod.POST)
public @ResponseBody MsgResult update(@RequestBody ProxyBean[] beans) {
Vector<ProxyBean> dbs=new Vector<ProxyBean>();
Vector<ProxyBean> dbs=ProxyService.INSTANCE.getAllProxyBean();
for (ProxyBean d:beans) {
for (int i=0;i<beans.length;i++) {
for (ProxyBean d:dbs) {
ProxyBean db=new ProxyBean();
if (d.getProtocol().equals(beans[i].getProtocol())) {
//db.setId(d.getId());
db.setProtocol(d.getProtocol());
db.setHost(d.getHost());
db.setPort(d.getPort());
db.setLogin(d.getLogin());
db.setPass(d.getPass());
db.setEnabled(d.getEnabled());
// db.setAuth(d.getAuth());
dbs.add(db);
d.setProtocol(beans[i].getProtocol());
d.setHost(beans[i].getHost());
d.setPort(beans[i].getPort());
d.setLogin(beans[i].getLogin());
d.setPass(beans[i].getPass());
d.setEnabled(beans[i].getEnabled());
d.setUseauth(beans[i].getUseauth());
}
}
}
return Msg.getMsgResultByCode(ProxyService.INSTANCE.Upd(dbs));
}
......
......@@ -42,7 +42,5 @@ public enum EthService {
public int Reload(EthBean m) {
return ethlinux.reload(m.getName());
}
}
\ No newline at end of file
......
......@@ -57,19 +57,20 @@ Ext.define('App.controller.Proxy', {
},
saveProxy:function() {
saveProxy:function(btn) {
//var proxyView = btn.up('mvvm-ProxyView');
//proxyView.mask("Сохранение...");
var records = [];
records.push(this.getModelFromForm(0,"http"));
records.push(this.getModelFromForm(1,"https"));
records.push(this.getModelFromForm(2,"ftp"));
records.push(this.getModelFromForm("http"));
records.push(this.getModelFromForm("https"));
records.push(this.getModelFromForm("ftp"));
var data=Ext.util.JSON.encode(records);
var data=Ext.util.JSON.encode(records);
Ext.Ajax.request({
method: "POST",
url: 'api/proxy/update',
......@@ -79,12 +80,12 @@ Ext.define('App.controller.Proxy', {
},
params: data,
success: function(response, opts) {
// proxyView.unmask();
var result = Ext.JSON.decode(response.responseText);
Ext.Msg.alert(result.type+" "+"Код-"+result.code,result.message);
}, failure: function(response, opts) {
networksettingView.unmask();
proxyView.unmask();
Ext.Msg.alert('Ошибка', 'Сервер недоступен');
}
});
......@@ -94,58 +95,45 @@ Ext.define('App.controller.Proxy', {
},
getModelFromForm:function (id,protocol) {
var host;
var port;
var login;
var pass;
var enabled;
var auth;
var proxy;
getModelFromForm:function (protocol) {
var formproxy=Ext.getCmp("formproxy");
var fsHttps = formproxy.down('#fs'+protocol);
enabled=fsHttps.checkboxCmp.getValue();
host=fsHttps.down('#'+protocol+'Adress').getValue();
port=parseInt(fsHttps.down('#'+protocol+'Port').getValue());
var enabled=fsHttps.checkboxCmp.getValue();
if(port==null) {
port=0;
}
var host=fsHttps.down('#'+protocol+'Adress').getValue();
var port=parseInt(fsHttps.down('#'+protocol+'Port').getValue());
var fsHttpsAuth=fsHttps.down('#fs'+protocol+'Auth');
auth=fsHttpsAuth.checkboxCmp.getValue();
login=fsHttpsAuth.down('#'+protocol+'Login').getValue();
pass=fsHttpsAuth.down('#'+protocol+'Password').getValue();
var useauth=fsHttpsAuth.checkboxCmp.getValue();
proxy = {
id:id,
var login=fsHttpsAuth.down('#'+protocol+'Login').getValue();
var pass=fsHttpsAuth.down('#'+protocol+'Password').getValue();
var proxy = {
protocol:protocol,
host:host,
port:0,
port:port,
login:login,
pass:pass,
enabled:enabled,
auth:auth
useauth:useauth
};
return proxy;
},
loadProxy:function() {
loadProxy:function(btn) {
// var proxyView = btn.up('mvvm-ProxyView');
// proxyView.mask("Загрузка...");
Ext.Ajax.request({
method: "GET",
......@@ -156,15 +144,20 @@ Ext.define('App.controller.Proxy', {
},
success: function(response, opts) {
var result = Ext.JSON.decode(response.responseText);
// proxyView.unmask();
var result = Ext.JSON.decode(response.responseText);
for(var i in result){
this.setModelToForm(result[i]);
this.setModelToForm(result[i]);
}
}, failure: function(response, opts) {
Ext.Msg.alert('Failure', 'Ошибка сохранения');
}
Ext.Msg.alert('Успешно', 'Загрузка данных выполнена');
}, failure: function(response, opts) {
proxyView.unmask();
Ext.Msg.alert('Ошибка', 'Сервер недоступен');
}
});
}
......
......@@ -30,11 +30,7 @@ Ext.define('App.view.Proxy', {
},
items: [
{
xtype:'fieldset',
checkboxToggle:true,
......
......@@ -20,13 +20,9 @@ public class EthLinux implements IEth {
private CmdExec cmdexec=new CmdExec();
private Vector<EthBean> ebs=new Vector<EthBean>();
private Db db=new Db(Paths.BEAN_ETH);
private Vector<String> extinfo;
private String mac;
private EthBean emp;
public EthLinux() {
......@@ -38,8 +34,6 @@ public class EthLinux implements IEth {
public int reload(String name) {
try {
Vector<String> buff=cmdexec.Run("ifdown"+" "+name);
Thread.sleep(5000);
......@@ -54,7 +48,6 @@ public class EthLinux implements IEth {
log.error(e.getMessage());
return Msg.RestartEthErr.getCode();
}
}
......
......@@ -21,6 +21,10 @@ public class ProxyBean implements Serializable {
private boolean useauth;
public ProxyBean() {
......@@ -56,7 +60,7 @@ public class ProxyBean implements Serializable {
this.enabled=value;
}
public void setUseAuth(boolean value) {
public void setUseauth(boolean value) {
this.useauth=value;
}
......@@ -66,32 +70,32 @@ public class ProxyBean implements Serializable {
*/
public String getProtocol() {
return this.protocol;
return protocol;
}
public String getHost() {
return this.host;
return host;
}
public int getPort() {
return this.port;
return port;
}
public String getLogin() {
return this.login;
return login;
}
public String getPass() {
return this.pass;
return pass;
}
public boolean getEnabled() {
return this.enabled;
return enabled;
}
public boolean getUseAuth() {
return this.useauth;
public boolean getUseauth() {
return useauth;
}
......
......@@ -59,7 +59,7 @@ public class ProxyLinux implements IProxy {
for (ProxyBean pb:pbs) {
if (pb.getEnabled()) {
if (pb.getUseAuth()) {
if (pb.getUseauth()) {
bw.write(pb.getProtocol()+"_proxy"+"='"+"http://"+pb.getLogin()+":"+pb.getPass()+"@"+pb.getHost()+":"+pb.getPort()+"'\n");
}else {
bw.write(pb.getProtocol()+"_proxy"+"='"+"http://"+pb.getHost()+":"+pb.getPort()+"'\n");
......@@ -90,7 +90,7 @@ public class ProxyLinux implements IProxy {
pmp.setPort(DefSettings.Proxy_http_port);
pmp.setLogin(DefSettings.Proxy_http_login);
pmp.setPass(DefSettings.Proxy_http_pass);
pmp.setUseAuth(DefSettings.Proxy_http_useauth);
pmp.setUseauth(DefSettings.Proxy_http_useauth);
pbs.add(pmp);
//HTTPS PROXY
pmp=new ProxyBean();
......@@ -100,7 +100,7 @@ public class ProxyLinux implements IProxy {
pmp.setPort(DefSettings.Proxy_https_port);
pmp.setLogin(DefSettings.Proxy_https_login);
pmp.setPass(DefSettings.Proxy_https_pass);
pmp.setUseAuth(DefSettings.Proxy_https_useauth);
pmp.setUseauth(DefSettings.Proxy_https_useauth);
pbs.add(pmp);
//FTP PROXY
pmp=new ProxyBean();
......@@ -110,7 +110,7 @@ public class ProxyLinux implements IProxy {
pmp.setPort(DefSettings.Proxy_ftp_port);
pmp.setLogin(DefSettings.Proxy_ftp_login);
pmp.setPass(DefSettings.Proxy_ftp_pass);
pmp.setUseAuth(DefSettings.Proxy_ftp_useauth);
pmp.setUseauth(DefSettings.Proxy_ftp_useauth);
pbs.add(pmp);
return Config(pbs);
......
......@@ -64,7 +64,7 @@ public class DefSettings {
public static final String Server_name="Локальный сервер";
public static final String Server_ip="127.0.0.1";
public static final int Server_port=80;
public static final String Server_type="СЗС";
public static final String Server_type="szs";
public static final String Server_title="";
//JETTY
public static final int jetty_id=0;
......