Commit d7c44780 d7c4478047620bd30a4191a060d10f83861652ee by root

save

1 parent 9f54c469
...@@ -36,6 +36,7 @@ Ext.application({ ...@@ -36,6 +36,7 @@ Ext.application({
36 'RemoteServer', 36 'RemoteServer',
37 'DeviceControl', 37 'DeviceControl',
38 'Log', 38 'Log',
39 'Gprs',
39 'Sv' 40 'Sv'
40 41
41 42
......
...@@ -58,12 +58,7 @@ Ext.define('App.controller.Dns', { ...@@ -58,12 +58,7 @@ Ext.define('App.controller.Dns', {
58 params: data, 58 params: data,
59 success: function(response, opts) { 59 success: function(response, opts) {
60 60
61 var Ok = Ext.JSON.decode(response.responseText); 61
62 if (Ok) {
63 Ext.Msg.alert('Success', 'Сохранение выполнено успешно');
64 }else {
65 Ext.Msg.alert('Failure', 'Ошибка сохранения');
66 }
67 62
68 }, failure: function(response, opts) { 63 }, failure: function(response, opts) {
69 64
......
...@@ -13,20 +13,49 @@ Ext.define('App.controller.Gprs', { ...@@ -13,20 +13,49 @@ Ext.define('App.controller.Gprs', {
13 } 13 }
14 14
15 }); 15 });
16
17 16
18 17
18 this.loadGprs();
19 },
20
21
22 saveGprs:function() {
23
24 var selected=Ext.getCmp('internetGprs').getValue();
25
26
27
28 var data=Ext.util.JSON.encode(selected);
29
30 Ext.Ajax.request({
31 method: "POST",
32 url: 'api/gsm/update',
33 headers: {
34 'Accept': 'application/json',
35 'Content-Type': 'application/json'
36 },
37 params: data,
38 success: function(response, opts) {
39
40 var result = Ext.JSON.decode(response.responseText);
41
42 Ext.Msg.alert(result.type+" "+"Код-"+result.code,result.message);
43
44 }, failure: function(response, opts) {
45 Ext.Msg.alert('Ошибка', 'Сервер недоступен');
46 }
47 });
19 48
20 this.loadGprs();
21 49
22
23 }, 50 },
24 51
25 loadGprs:function() { 52 loadGprs:function() {
26 53
54
55
27 Ext.Ajax.request({ 56 Ext.Ajax.request({
28 method: "GET", 57 method: "GET",
29 url: 'api/devcontrol/dateinfo', 58 url: 'api/gsm',
30 headers: { 59 headers: {
31 'Accept': 'application/json', 60 'Accept': 'application/json',
32 'Content-Type': 'application/json' 61 'Content-Type': 'application/json'
...@@ -35,13 +64,12 @@ Ext.define('App.controller.Gprs', { ...@@ -35,13 +64,12 @@ Ext.define('App.controller.Gprs', {
35 success: function(response, opts) { 64 success: function(response, opts) {
36 65
37 var result = Ext.JSON.decode(response.responseText); 66 var result = Ext.JSON.decode(response.responseText);
38 67
39 68 Ext.getCmp('internetGprs').setValue(result);
40 // Ext.getCmp('dtCurrent').setValue(result.dt); 69
41 // Ext.getCmp('ntpServer').setValue(result.ntp); 70 }, failure: function(response, opts) {
42 71 Ext.Msg.alert('Ошибка', 'Сервер недоступен');
43 }, failure: function(response, opts) { 72 }
44 }
45 }); 73 });
46 74
47 75
......
...@@ -66,7 +66,7 @@ Ext.define('App.controller.MainConfig', { ...@@ -66,7 +66,7 @@ Ext.define('App.controller.MainConfig', {
66 66
67 var result = Ext.JSON.decode(response.responseText); 67 var result = Ext.JSON.decode(response.responseText);
68 68
69 Ext.Msg.alert(result.type+" "+"Код-"+result.code,result.message); 69 // Ext.Msg.alert(result.type+" "+"Код-"+result.code,result.message);
70 70
71 }, failure: function(response, opts) { 71 }, failure: function(response, opts) {
72 Ext.Msg.alert('Ошибка', 'Сервер недоступен'); 72 Ext.Msg.alert('Ошибка', 'Сервер недоступен');
......
...@@ -82,7 +82,7 @@ Ext.define('App.controller.Proxy', { ...@@ -82,7 +82,7 @@ Ext.define('App.controller.Proxy', {
82 success: function(response, opts) { 82 success: function(response, opts) {
83 // proxyView.unmask(); 83 // proxyView.unmask();
84 var result = Ext.JSON.decode(response.responseText); 84 var result = Ext.JSON.decode(response.responseText);
85 Ext.Msg.alert(result.type+" "+"Код-"+result.code,result.message); 85 // Ext.Msg.alert(result.type+" "+"Код-"+result.code,result.message);
86 86
87 }, failure: function(response, opts) { 87 }, failure: function(response, opts) {
88 proxyView.unmask(); 88 proxyView.unmask();
...@@ -152,7 +152,7 @@ Ext.define('App.controller.Proxy', { ...@@ -152,7 +152,7 @@ Ext.define('App.controller.Proxy', {
152 } 152 }
153 153
154 154
155 Ext.Msg.alert('Успешно', 'Загрузка данных выполнена'); 155 // Ext.Msg.alert('Успешно', 'Загрузка данных выполнена');
156 156
157 }, failure: function(response, opts) { 157 }, failure: function(response, opts) {
158 proxyView.unmask(); 158 proxyView.unmask();
......
...@@ -45,7 +45,7 @@ Ext.define('App.view.Gprs', { ...@@ -45,7 +45,7 @@ Ext.define('App.view.Gprs', {
45 45
46 { 46 {
47 xtype: 'radiogroup', 47 xtype: 'radiogroup',
48 fieldLabel: 'Оператор связи', 48 fieldLabel: 'Оператор',
49 width:400, 49 width:400,
50 height:100, 50 height:100,
51 columns: 3, 51 columns: 3,
...@@ -54,22 +54,21 @@ Ext.define('App.view.Gprs', { ...@@ -54,22 +54,21 @@ Ext.define('App.view.Gprs', {
54 { 54 {
55 xtype: 'radiofield', 55 xtype: 'radiofield',
56 boxLabel: '<img src="resources/img/mts.png"/>', 56 boxLabel: '<img src="resources/img/mts.png"/>',
57 name: 'framework', 57 name: 'operator',
58 // checked: true,
59 width:100, 58 width:100,
60 inputValue: 'mts' 59 inputValue: 'mts'
61 }, 60 },
62 { 61 {
63 xtype: 'radiofield', 62 xtype: 'radiofield',
64 boxLabel: '<img src="resources/img/megafon.png"/>', 63 boxLabel: '<img src="resources/img/megafon.png"/>',
65 name: 'framework', 64 name: 'operator',
66 width:100, 65 width:100,
67 inputValue: 'megafon' 66 inputValue: 'megafon'
68 }, 67 },
69 { 68 {
70 xtype: 'radiofield', 69 xtype: 'radiofield',
71 boxLabel: '<img src="resources/img/beeline.png"/>', 70 boxLabel: '<img src="resources/img/beeline.png"/>',
72 name: 'framework', 71 name: 'operator',
73 width:100, 72 width:100,
74 inputValue: 'beeline' 73 inputValue: 'beeline'
75 } 74 }
......
...@@ -275,11 +275,6 @@ public class DevToolsBean extends RoundPanel implements Externalizable { ...@@ -275,11 +275,6 @@ public class DevToolsBean extends RoundPanel implements Externalizable {
275 275
276 }.execute(); 276 }.execute();
277 277
278
279
280
281
282
283 } 278 }
284 } 279 }
285 280
......
...@@ -63,22 +63,22 @@ public class Settings implements ISettings { ...@@ -63,22 +63,22 @@ public class Settings implements ISettings {
63 */ 63 */
64 public void configuring(SettingsBean model) { 64 public void configuring(SettingsBean model) {
65 65
66 devinfo.set(model.getDevInfoBean()); 66 devinfo.set(model.getDevInfoBean());
67 dnslinux.Config(model.getDnsbeans()); 67 dnslinux.Config(model.getDnsbeans());
68 68
69 DateInfo dateinfo=model.getDateInfo(); 69 DateInfo dateinfo=model.getDateInfo();
70 ntplinux.setUsNtpServer(dateinfo.getNtp()); 70 ntplinux.setUsNtpServer(dateinfo.getNtp());
71 71
72 gsm.set(model.getGSMBean()); 72 gsm.set(model.getGSMBean());
73 73
74 for (EthBean eb:model.getEthBeans()) { 74 for (EthBean eb:model.getEthBeans()) {
75 75
76 ethlinux.Update(eb); 76 ethlinux.Update(eb);
77 } 77 }
78 78
79 proxylinux.Config(model.getProxyBeans()); 79 proxylinux.Config(model.getProxyBeans());
80 80
81 remserv.set(model.getRserverbeans()); 81 remserv.set(model.getRserverbeans());
82 } 82 }
83 83
84 public SettingsBean make() { 84 public SettingsBean make() {
......