save
Showing
14 changed files
with
179 additions
and
75 deletions
| ... | @@ -31,6 +31,15 @@ | ... | @@ -31,6 +31,15 @@ |
| 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 | ... | ... |
2.53 KB
3.24 KB
3.08 KB
489 Bytes
686 Bytes
| ... | @@ -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({ | ||
| 38 | run: function () { | ||
| 39 | var ret = null; | ||
| 40 | $.ajax({ | ||
| 41 | url: 'api/mainconfig/get', | ||
| 42 | beforeSend: function () { | ||
| 43 | }, | ||
| 44 | async: false, | ||
| 45 | dataType: "json", | ||
| 46 | type: "GET", | ||
| 47 | success: function (data) { | ||
| 48 | ret=data; | ||
| 49 | 37 | ||
| 50 | } | 38 | //mask |
| 51 | }); | 39 | Ext.getBody().mask("Загрузка..."); |
| 52 | return ret; | 40 | |
| 53 | } | ||
| 54 | }); | ||
| 55 | 41 | ||
| 56 | var data=record.run(); | ||
| 57 | 42 | ||
| 58 | 43 | ||
| 59 | Ext.create('Ext.container.Viewport', { | 44 | Ext.create('Ext.container.Viewport', { |
| ... | @@ -119,13 +104,14 @@ Ext.application({ | ... | @@ -119,13 +104,14 @@ Ext.application({ |
| 119 | }, | 104 | }, |
| 120 | 105 | ||
| 121 | { | 106 | { |
| 107 | title: 'Удаленный сервер', | ||
| 108 | items:[] | ||
| 109 | }, | ||
| 110 | |||
| 111 | { | ||
| 122 | title: 'Управление', | 112 | title: 'Управление', |
| 123 | items:[] | 113 | items:[] |
| 124 | } | 114 | } |
| 125 | |||
| 126 | |||
| 127 | |||
| 128 | |||
| 129 | ] | 115 | ] |
| 130 | } | 116 | } |
| 131 | 117 | ||
| ... | @@ -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,11 +5,22 @@ Ext.define('App.controller.MainConfig', { | ... | @@ -5,11 +5,22 @@ 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", |
| ... | @@ -29,8 +40,10 @@ Ext.define('App.controller.MainConfig', { | ... | @@ -29,8 +40,10 @@ Ext.define('App.controller.MainConfig', { |
| 29 | }, failure: function(response, opts) { | 40 | }, failure: function(response, opts) { |
| 30 | } | 41 | } |
| 31 | }); | 42 | }); |
| 43 | |||
| 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 | }); |
| ... | @@ -40,6 +40,9 @@ Ext.define('App.controller.NetworkSetting', { | ... | @@ -40,6 +40,9 @@ Ext.define('App.controller.NetworkSetting', { |
| 40 | var eth=record ? record.get(combo.displayField) : null; | 40 | var eth=record ? record.get(combo.displayField) : null; |
| 41 | 41 | ||
| 42 | 42 | ||
| 43 | |||
| 44 | |||
| 45 | |||
| 43 | Ext.Ajax.request({ | 46 | Ext.Ajax.request({ |
| 44 | method: "GET", | 47 | method: "GET", |
| 45 | url: 'api/net/byeth/'+eth, | 48 | url: 'api/net/byeth/'+eth, |
| ... | @@ -62,13 +65,22 @@ Ext.define('App.controller.NetworkSetting', { | ... | @@ -62,13 +65,22 @@ Ext.define('App.controller.NetworkSetting', { |
| 62 | } | 65 | } |
| 63 | }); | 66 | }); |
| 64 | 67 | ||
| 68 | //unmask | ||
| 69 | |||
| 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,7 +89,7 @@ Ext.define('App.controller.NetworkSetting', { | ... | @@ -77,7 +89,7 @@ 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' |
| ... | @@ -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 | } | ... | ... |
| ... | @@ -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 | }, | ||
| 36 | |||
| 37 | |||
| 38 | { | ||
| 39 | xtype : 'button', | ||
| 40 | text : 'Сохранить', | ||
| 41 | itemId : 'SaveRecord' | ||
| 42 | } | 57 | } |
| 43 | |||
| 44 | ] | 58 | ] |
| 45 | }); | 59 | }); |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -8,8 +8,61 @@ Ext.define('App.view.NetworkSetting', { | ... | @@ -8,8 +8,61 @@ Ext.define('App.view.NetworkSetting', { |
| 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 | ||
| ... | @@ -27,6 +80,7 @@ Ext.define('App.view.NetworkSetting', { | ... | @@ -27,6 +80,7 @@ Ext.define('App.view.NetworkSetting', { |
| 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 | }, |
| ... | @@ -58,17 +112,6 @@ Ext.define('App.view.NetworkSetting', { | ... | @@ -58,17 +112,6 @@ Ext.define('App.view.NetworkSetting', { |
| 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 | }, | ||
| 84 | |||
| 85 | |||
| 86 | { | ||
| 87 | xtype : 'button', | ||
| 88 | text : 'ПРИМЕНИТЬ', | ||
| 89 | itemId : 'SaveRecord', | ||
| 90 | margin:'5 5 10 3' | ||
| 91 | } | 126 | } |
| 92 | 127 | ||
| 93 | 128 | ||
| 94 | |||
| 95 | |||
| 96 | |||
| 97 | |||
| 98 | ] | 129 | ] |
| 99 | }); | 130 | }); |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or sign in to post a comment