Commit 8fb6e0fa 8fb6e0fad17eb8c7e6e3a9ff3da9917e972b97d9 by root

save

1 parent 170d4cb6
...@@ -27,10 +27,19 @@ ...@@ -27,10 +27,19 @@
27 } 27 }
28 28
29 29
30 .load { 30 .load {
31 background-image:url(resources/img/load.png) !important; 31 background-image:url(resources/img/load.png) !important;
32 } 32 }
33 33
34 .restart {
35 background-image:url(resources/img/restart.png) !important;
36 }
37
38 .ping {
39 background-image:url(resources/img/ping.png) !important;
40 }
41
42
34 </style> 43 </style>
35 44
36 45
......
...@@ -34,26 +34,11 @@ Ext.application({ ...@@ -34,26 +34,11 @@ Ext.application({
34 34
35 launch : function() { 35 launch : function() {
36 36
37 var record = new Object({ 37
38 run: function () { 38 //mask
39 var ret = null; 39 Ext.getBody().mask("Загрузка...");
40 $.ajax({ 40
41 url: 'api/mainconfig/get', 41
42 beforeSend: function () {
43 },
44 async: false,
45 dataType: "json",
46 type: "GET",
47 success: function (data) {
48 ret=data;
49
50 }
51 });
52 return ret;
53 }
54 });
55
56 var data=record.run();
57 42
58 43
59 Ext.create('Ext.container.Viewport', { 44 Ext.create('Ext.container.Viewport', {
...@@ -119,14 +104,15 @@ Ext.application({ ...@@ -119,14 +104,15 @@ Ext.application({
119 }, 104 },
120 105
121 { 106 {
122 title: правление', 107 title: даленный сервер',
123 items:[] 108 items:[]
124 } 109 },
125
126
127
128 110
129 ] 111 {
112 title: 'Управление',
113 items:[]
114 }
115 ]
130 } 116 }
131 117
132 118
...@@ -141,11 +127,8 @@ Ext.application({ ...@@ -141,11 +127,8 @@ Ext.application({
141 xtype: 'tabpanel', 127 xtype: 'tabpanel',
142 items: [ 128 items: [
143 { 129 {
144 title: 'ETH', 130 title: 'ETHERNET',
145 items:[{ 131 items:[
146 xtype : 'mvvm-EthView',
147 id:'cbxeth'
148 },
149 { 132 {
150 xtype : 'mvvm-NetworkSettingView', 133 xtype : 'mvvm-NetworkSettingView',
151 id:'fromnetwork', 134 id:'fromnetwork',
...@@ -200,11 +183,14 @@ Ext.application({ ...@@ -200,11 +183,14 @@ Ext.application({
200 183
201 184
202 ] 185 ]
203 } 186 },
187
204 188
205 ] 189 ]
206 }, 190 },
207 191
192
193
208 /* 194 /*
209 { 195 {
210 title: 'ПЕРЕМЕННЫЕ', 196 title: 'ПЕРЕМЕННЫЕ',
...@@ -258,6 +244,24 @@ Ext.application({ ...@@ -258,6 +244,24 @@ Ext.application({
258 ] 244 ]
259 } 245 }
260 */ 246 */
247
248
249
250 {
251 title: 'СОХРАНЕНИЕ',
252 items:[
253 {
254 region: 'center',
255 xtype: 'tabpanel',
256 items: [
257
258 ]
259
260 }
261 ]
262 },
263
264
261 ] 265 ]
262 } 266 }
263 ] 267 ]
...@@ -265,7 +269,7 @@ Ext.application({ ...@@ -265,7 +269,7 @@ Ext.application({
265 269
266 }); 270 });
267 271
268 272 Ext.getBody().unmask();
269 } 273 }
270 }); 274 });
271 275
......
...@@ -5,32 +5,45 @@ Ext.define('App.controller.MainConfig', { ...@@ -5,32 +5,45 @@ Ext.define('App.controller.MainConfig', {
5 5
6 6
7 this.control({ 7 this.control({
8 'mvvm-MainConfigView > button#SaveRecord' : { 8 'toolbar button[action=saveMainConfig]' : {
9 click : this.onSaveButtonClick 9 click : this.onSaveButtonClick
10 },
11
12 'toolbar button[action=loadMainConfig]' : {
13 click : this.onLoadButtonClick
10 } 14 }
11 }); 15 });
12 16
17 this.onLoadButtonClick();
18
19 },
20
21
22
23 onLoadButtonClick:function() {
13 24
14 Ext.Ajax.request({ 25 Ext.Ajax.request({
15 method: "GET", 26 method: "GET",
16 url: 'api/devinfo/', 27 url: 'api/devinfo/',
17 headers: { 28 headers: {
18 'Accept': 'application/json', 29 'Accept': 'application/json',
19 'Content-Type': 'application/json' 30 'Content-Type': 'application/json'
20 }, 31 },
32
33 success: function(response, opts) {
34
35 var result = Ext.JSON.decode(response.responseText);
36
37 Ext.getCmp('guid').setValue(result.guid);
38 Ext.getCmp('title').setValue(result.description);
39
40 }, failure: function(response, opts) {
41 }
42 });
21 43
22 success: function(response, opts) {
23
24 var result = Ext.JSON.decode(response.responseText);
25
26 Ext.getCmp('guid').setValue(result.guid);
27 Ext.getCmp('title').setValue(result.description);
28
29 }, failure: function(response, opts) {
30 }
31 });
32 }, 44 },
33 45
46
34 onSaveButtonClick : function(btn) { 47 onSaveButtonClick : function(btn) {
35 48
36 var mainconfigView = btn.up('mvvm-MainConfigView'); 49 var mainconfigView = btn.up('mvvm-MainConfigView');
......
...@@ -5,7 +5,7 @@ Ext.define('App.controller.NetworkSetting', { ...@@ -5,7 +5,7 @@ Ext.define('App.controller.NetworkSetting', {
5 5
6 6
7 this.control({ 7 this.control({
8 'mvvm-NetworkSettingView > button#SaveRecord' : { 8 'toolbar button[action=saveEth]' : {
9 click : this.onSaveButtonClick 9 click : this.onSaveButtonClick
10 } 10 }
11 }); 11 });
...@@ -39,6 +39,9 @@ Ext.define('App.controller.NetworkSetting', { ...@@ -39,6 +39,9 @@ Ext.define('App.controller.NetworkSetting', {
39 }); 39 });
40 var eth=record ? record.get(combo.displayField) : null; 40 var eth=record ? record.get(combo.displayField) : null;
41 41
42
43
44
42 45
43 Ext.Ajax.request({ 46 Ext.Ajax.request({
44 method: "GET", 47 method: "GET",
...@@ -61,14 +64,23 @@ Ext.define('App.controller.NetworkSetting', { ...@@ -61,14 +64,23 @@ Ext.define('App.controller.NetworkSetting', {
61 }, failure: function(response, opts) { 64 }, failure: function(response, opts) {
62 } 65 }
63 }); 66 });
67
68 //unmask
69
64 70
65 } 71 }
66 }, 72 },
67 73
68 onSaveButtonClick : function(btn) { 74 onSaveButtonClick : function(btn) {
69 75
76
77
78
70 var networksettingView = btn.up('mvvm-NetworkSettingView'); 79 var networksettingView = btn.up('mvvm-NetworkSettingView');
71 80
81 //mask
82 networksettingView.mask("Сохранение...");
83
72 var record = networksettingView.getViewModel().getData(); 84 var record = networksettingView.getViewModel().getData();
73 if (record) { 85 if (record) {
74 86
...@@ -77,14 +89,14 @@ Ext.define('App.controller.NetworkSetting', { ...@@ -77,14 +89,14 @@ Ext.define('App.controller.NetworkSetting', {
77 89
78 Ext.Ajax.request({ 90 Ext.Ajax.request({
79 method: "POST", 91 method: "POST",
80 url: 'api/net/update', 92 url: 'api/eth/update',
81 headers: { 93 headers: {
82 'Accept': 'application/json', 94 'Accept': 'application/json',
83 'Content-Type': 'application/json' 95 'Content-Type': 'application/json'
84 }, 96 },
85 params: data, 97 params: data,
86 success: function(response, opts) { 98 success: function(response, opts) {
87 99
88 var result = Ext.JSON.decode(response.responseText); 100 var result = Ext.JSON.decode(response.responseText);
89 101
90 if(result) { 102 if(result) {
...@@ -92,6 +104,7 @@ Ext.define('App.controller.NetworkSetting', { ...@@ -92,6 +104,7 @@ Ext.define('App.controller.NetworkSetting', {
92 } 104 }
93 105
94 }, failure: function(response, opts) { 106 }, failure: function(response, opts) {
107
95 Ext.Msg.alert('Failure', 'Обновление конфигурации не выполнено!'); 108 Ext.Msg.alert('Failure', 'Обновление конфигурации не выполнено!');
96 } 109 }
97 }); 110 });
...@@ -100,7 +113,7 @@ Ext.define('App.controller.NetworkSetting', { ...@@ -100,7 +113,7 @@ Ext.define('App.controller.NetworkSetting', {
100 113
101 } 114 }
102 115
103 116 networksettingView.unmask();
104 117
105 118
106 } 119 }
......
...@@ -15,7 +15,7 @@ Ext.define('App.store.Eth', { ...@@ -15,7 +15,7 @@ Ext.define('App.store.Eth', {
15 type : 'ajax', 15 type : 'ajax',
16 api: { 16 api: {
17 17
18 read: 'api/net/alleth' 18 read: 'api/eth/all'
19 19
20 }, 20 },
21 reader : { 21 reader : {
......
...@@ -20,7 +20,7 @@ Ext.define('App.view.Eth', { ...@@ -20,7 +20,7 @@ Ext.define('App.view.Eth', {
20 20
21 Ext.Ajax.request({ 21 Ext.Ajax.request({
22 method: "GET", 22 method: "GET",
23 url: 'api/net/byeth/'+records[0].get('name'), 23 url: 'api/eth/byeth/'+records[0].get('name'),
24 headers: { 24 headers: {
25 'Accept': 'application/json', 25 'Accept': 'application/json',
26 'Content-Type': 'application/json' 26 'Content-Type': 'application/json'
......
...@@ -19,18 +19,41 @@ Ext.define('App.view.Gprs', { ...@@ -19,18 +19,41 @@ Ext.define('App.view.Gprs', {
19 type: 'gprsform' 19 type: 'gprsform'
20 }, 20 },
21 21
22
23 bbar: {
24
25 items: [ {
26 xtype: 'button',
27 iconCls:'save',
28 itemId: 'SaveGprsButton',
29 text: 'Сохранить',
30 action: 'saveGprs',
31 disabled:false
32 },
33 {
34 xtype: 'button',
35 iconCls:'load',
36 itemId: 'LoadGprsButton',
37 text: 'Обновить',
38 action: 'loadGprs',
39 disabled:false
40 }
41 ]
42 },
43
22 items : [ 44 items : [
23 45
24 { 46 {
25 xtype: 'radiogroup', 47 xtype: 'radiogroup',
26 fieldLabel: 'Оператор связи', 48 fieldLabel: 'Оператор связи',
27 width:500, 49 width:400,
28 columns: 2, 50 height:100,
51 columns: 3,
29 itemId: 'internetGprs', 52 itemId: 'internetGprs',
30 items: [ 53 items: [
31 { 54 {
32 xtype: 'radiofield', 55 xtype: 'radiofield',
33 boxLabel: '<img src="resources/img/mts.jpg"/>', 56 boxLabel: '<img src="resources/img/mts.png"/>',
34 name: 'framework', 57 name: 'framework',
35 checked: true, 58 checked: true,
36 width:100, 59 width:100,
...@@ -38,24 +61,21 @@ Ext.define('App.view.Gprs', { ...@@ -38,24 +61,21 @@ Ext.define('App.view.Gprs', {
38 }, 61 },
39 { 62 {
40 xtype: 'radiofield', 63 xtype: 'radiofield',
41 boxLabel: 'Megafon', 64 boxLabel: '<img src="resources/img/megafon.png"/>',
42 name: 'framework', 65 name: 'framework',
43 width:100, 66 width:100,
44 inputValue: 'megafon' 67 inputValue: 'megafon'
45 }, 68 },
46 { 69 {
47 xtype: 'radiofield', 70 xtype: 'radiofield',
48 boxLabel: 'Beeline', 71 boxLabel: '<img src="resources/img/beeline.png"/>',
49 name: 'framework', 72 name: 'framework',
50 width:100, 73 width:100,
51 inputValue: 'beeline' 74 inputValue: 'beeline'
52 } 75 }
53 ] 76 ]
54 },
55 {
56 xtype: 'button',
57 text: 'Применить'
58 } 77 }
59 78
79
60 ] 80 ]
61 }); 81 });
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -15,6 +15,28 @@ Ext.define('App.view.MainConfig', { ...@@ -15,6 +15,28 @@ Ext.define('App.view.MainConfig', {
15 type: 'mainconfigform' // references DetailViewModel 15 type: 'mainconfigform' // references DetailViewModel
16 }, 16 },
17 17
18 bbar: {
19
20 items: [ {
21 xtype: 'button',
22 iconCls:'save',
23 itemId: 'SaveMainConfigButton',
24 text: 'Сохранить',
25 action: 'saveMainConfig',
26 disabled:false
27 },
28 {
29 xtype: 'button',
30 iconCls:'save',
31 itemId: 'LoadMainConfigButton',
32 text: 'Обновить',
33 action: 'loadMainConfig',
34 disabled:false
35 }
36 ]
37 },
38
39
18 items : [{ 40 items : [{
19 xtype : 'textfield', 41 xtype : 'textfield',
20 bind : '{guid}', 42 bind : '{guid}',
...@@ -32,14 +54,6 @@ Ext.define('App.view.MainConfig', { ...@@ -32,14 +54,6 @@ Ext.define('App.view.MainConfig', {
32 width:500, 54 width:500,
33 id:'title', 55 id:'title',
34 margin:'5 5 10 3' 56 margin:'5 5 10 3'
35 }, 57 }
36
37
38 {
39 xtype : 'button',
40 text : 'Сохранить',
41 itemId : 'SaveRecord'
42 }
43
44 ] 58 ]
45 }); 59 });
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -7,9 +7,62 @@ Ext.define('App.view.NetworkSetting', { ...@@ -7,9 +7,62 @@ Ext.define('App.view.NetworkSetting', {
7 7
8 frame : false, 8 frame : false,
9 padding : 3, 9 padding : 3,
10 10
11 tbar: {
12 items: [ {
13 xtype: 'button',
14 iconCls:'ping',
15 itemId: 'pingButton',
16 text: 'проверка-ping',
17 action: 'showformping',
18 disabled:false
19 }]
20 },
21
22 bbar: {
23
24 items: [
25
26
27 {
28 xtype: 'button',
29 iconCls:'save',
30 itemId: 'SaveEthButton',
31 text: 'Сохранить',
32 action: 'saveEth',
33 disabled:false
34 },
35 {
36 xtype: 'button',
37 iconCls:'load',
38 itemId: 'LoadEthButton',
39 text: 'Обновить',
40 action: 'loadEth',
41 disabled:false
42 },
43
44 {
45 xtype: 'button',
46 iconCls:'restart',
47 itemId: 'RebootEthButton',
48 text: 'Перезагрузить',
49 action: 'rebootEth',
50 disabled:false
51 }
52
53 ]
54
55
56 },
57
11 58
12 items : [ 59 items : [
60 {
61 xtype : 'mvvm-EthView',
62 id:'cbxeth'
63 },
64
65
13 { 66 {
14 xtype : 'checkboxfield', 67 xtype : 'checkboxfield',
15 68
...@@ -26,7 +79,8 @@ Ext.define('App.view.NetworkSetting', { ...@@ -26,7 +79,8 @@ Ext.define('App.view.NetworkSetting', {
26 xtype : 'textfield', 79 xtype : 'textfield',
27 bind : '{mac}', 80 bind : '{mac}',
28 id:'mac', 81 id:'mac',
29 fieldLabel : 'MAC', 82 fieldLabel : 'MAC',
83 disabled:true,
30 margin:'5 5 10 3' 84 margin:'5 5 10 3'
31 85
32 }, 86 },
...@@ -57,18 +111,7 @@ Ext.define('App.view.NetworkSetting', { ...@@ -57,18 +111,7 @@ Ext.define('App.view.NetworkSetting', {
57 id:'netmask', 111 id:'netmask',
58 margin:'5 5 10 3' 112 margin:'5 5 10 3'
59 }, 113 },
60 114
61
62 {
63 xtype : 'textfield',
64 bind : '{broadcast}',
65 fieldLabel : 'BROADCAST',
66 id:'broadcast',
67 margin:'5 5 10 3',
68
69
70 },
71
72 { 115 {
73 xtype : 'textarea', 116 xtype : 'textarea',
74 bind : '{info}', 117 bind : '{info}',
...@@ -80,20 +123,8 @@ Ext.define('App.view.NetworkSetting', { ...@@ -80,20 +123,8 @@ Ext.define('App.view.NetworkSetting', {
80 width:700, 123 width:700,
81 height:100, 124 height:100,
82 125
83 }, 126 }
84 127
85
86 {
87 xtype : 'button',
88 text : 'ПРИМЕНИТЬ',
89 itemId : 'SaveRecord',
90 margin:'5 5 10 3'
91 }
92
93
94
95
96
97 128
98 ] 129 ]
99 }); 130 });
...\ No newline at end of file ...\ No newline at end of file
......