save
Showing
10 changed files
with
258 additions
and
117 deletions
| ... | @@ -156,6 +156,26 @@ | ... | @@ -156,6 +156,26 @@ |
| 156 | <artifactId>proxymanager</artifactId> | 156 | <artifactId>proxymanager</artifactId> |
| 157 | <version>1.5</version> | 157 | <version>1.5</version> |
| 158 | </dependency> | 158 | </dependency> |
| 159 | |||
| 160 | |||
| 161 | |||
| 162 | |||
| 163 | |||
| 164 | <dependency> | ||
| 165 | <groupId>org.emercit</groupId> | ||
| 166 | <artifactId>remoteservers</artifactId> | ||
| 167 | <version>1.3</version> | ||
| 168 | </dependency> | ||
| 169 | |||
| 170 | |||
| 171 | |||
| 172 | <dependency> | ||
| 173 | <groupId>org.emercit</groupId> | ||
| 174 | <artifactId>pckutils</artifactId> | ||
| 175 | <version>1.0</version> | ||
| 176 | </dependency> | ||
| 177 | |||
| 178 | |||
| 159 | 179 | ||
| 160 | </dependencies> | 180 | </dependencies> |
| 161 | 181 | ... | ... |
| ... | @@ -11,6 +11,7 @@ Ext.application({ | ... | @@ -11,6 +11,7 @@ Ext.application({ |
| 11 | 'Proxy', | 11 | 'Proxy', |
| 12 | 'DetailDns', | 12 | 'DetailDns', |
| 13 | 'DetailProxy', | 13 | 'DetailProxy', |
| 14 | 'RemoteServer' | ||
| 14 | 15 | ||
| 15 | 16 | ||
| 16 | 17 | ||
| ... | @@ -21,7 +22,8 @@ Ext.application({ | ... | @@ -21,7 +22,8 @@ Ext.application({ |
| 21 | 'PingUtil', | 22 | 'PingUtil', |
| 22 | 'DetailDns', | 23 | 'DetailDns', |
| 23 | 'Dns', | 24 | 'Dns', |
| 24 | 'Proxy' | 25 | 'Proxy', |
| 26 | 'RemoteServer' | ||
| 25 | 27 | ||
| 26 | 28 | ||
| 27 | ], | 29 | ], |
| ... | @@ -105,7 +107,12 @@ Ext.application({ | ... | @@ -105,7 +107,12 @@ Ext.application({ |
| 105 | 107 | ||
| 106 | { | 108 | { |
| 107 | title: 'Удаленный сервер', | 109 | title: 'Удаленный сервер', |
| 108 | items:[] | 110 | items:[ |
| 111 | { | ||
| 112 | xtype :'mvvm-RemoteServerView', | ||
| 113 | id:'formremoteserver' | ||
| 114 | } | ||
| 115 | ] | ||
| 109 | }, | 116 | }, |
| 110 | 117 | ||
| 111 | { | 118 | { | ... | ... |
| ... | @@ -13,7 +13,7 @@ Ext.define('App.controller.DetailDns', { | ... | @@ -13,7 +13,7 @@ Ext.define('App.controller.DetailDns', { |
| 13 | 13 | ||
| 14 | onSaveButtonClick : function(btn) { | 14 | onSaveButtonClick : function(btn) { |
| 15 | 15 | ||
| 16 | console.log('result:'); | 16 | |
| 17 | 17 | ||
| 18 | var store=Ext.getCmp('grdDns').getStore(); | 18 | var store=Ext.getCmp('grdDns').getStore(); |
| 19 | 19 | ... | ... |
| ... | @@ -22,6 +22,8 @@ Ext.define('App.controller.MainConfig', { | ... | @@ -22,6 +22,8 @@ Ext.define('App.controller.MainConfig', { |
| 22 | 22 | ||
| 23 | onLoadButtonClick:function() { | 23 | onLoadButtonClick:function() { |
| 24 | 24 | ||
| 25 | |||
| 26 | |||
| 25 | Ext.Ajax.request({ | 27 | Ext.Ajax.request({ |
| 26 | method: "GET", | 28 | method: "GET", |
| 27 | url: 'api/devinfo/', | 29 | url: 'api/devinfo/', | ... | ... |
| ... | @@ -7,9 +7,19 @@ Ext.define('App.controller.NetworkSetting', { | ... | @@ -7,9 +7,19 @@ Ext.define('App.controller.NetworkSetting', { |
| 7 | this.control({ | 7 | this.control({ |
| 8 | 'toolbar button[action=saveEth]' : { | 8 | 'toolbar button[action=saveEth]' : { |
| 9 | click : this.onSaveButtonClick | 9 | click : this.onSaveButtonClick |
| 10 | }, | ||
| 11 | |||
| 12 | 'toolbar button[action=showformping]' : { | ||
| 13 | click : this.OpenPingPanel | ||
| 10 | } | 14 | } |
| 15 | |||
| 16 | |||
| 17 | |||
| 11 | }); | 18 | }); |
| 12 | 19 | ||
| 20 | |||
| 21 | |||
| 22 | |||
| 13 | /* | 23 | /* |
| 14 | Ext.TaskManager.start({ | 24 | Ext.TaskManager.start({ |
| 15 | run: this.ReloadData, | 25 | run: this.ReloadData, |
| ... | @@ -20,6 +30,15 @@ Ext.define('App.controller.NetworkSetting', { | ... | @@ -20,6 +30,15 @@ Ext.define('App.controller.NetworkSetting', { |
| 20 | }, | 30 | }, |
| 21 | 31 | ||
| 22 | 32 | ||
| 33 | OpenPingPanel:function() { | ||
| 34 | |||
| 35 | |||
| 36 | var panel = Ext.create("App.view.PingUtil"); | ||
| 37 | |||
| 38 | panel.show(); | ||
| 39 | |||
| 40 | }, | ||
| 41 | |||
| 23 | 42 | ||
| 24 | 43 | ||
| 25 | ReloadData: function() { | 44 | ReloadData: function() { | ... | ... |
| ... | @@ -4,54 +4,68 @@ Ext.define('App.controller.PingUtil', { | ... | @@ -4,54 +4,68 @@ Ext.define('App.controller.PingUtil', { |
| 4 | init : function() { | 4 | init : function() { |
| 5 | 5 | ||
| 6 | this.control({ | 6 | this.control({ |
| 7 | 'mvvm-PingUtilView > button#SaveRecord' : { | 7 | '#btnping': { |
| 8 | click : this.onSaveButtonClick | 8 | click: this.startPing |
| 9 | } | 9 | |
| 10 | } | ||
| 10 | }); | 11 | }); |
| 11 | }, | 12 | }, |
| 12 | onSaveButtonClick : function(btn) { | 13 | startPing :function (btn, e, options) { |
| 13 | //get reference to the form | 14 | |
| 14 | var pingutilView = btn.up('mvvm-PingUtilView'); | 15 | |
| 15 | 16 | ||
| 16 | //get the bound record | 17 | var form = Ext.getCmp('winPing'); |
| 17 | var record = pingutilView.getViewModel().getData().rec; | 18 | |
| 18 | 19 | if (form!=null) { | |
| 19 | if (record) { | 20 | |
| 21 | |||
| 22 | |||
| 23 | var ipValue=Ext.getCmp('ipaddress').getValue(); | ||
| 24 | form.mask("Выполнение ..."); | ||
| 25 | |||
| 26 | if (ipValue!="") { | ||
| 20 | 27 | ||
| 21 | var data=Ext.util.JSON.encode(record); | 28 | var data=Ext.util.JSON.encode(ipValue); |
| 22 | |||
| 23 | 29 | ||
| 30 | |||
| 24 | 31 | ||
| 25 | Ext.Ajax.request({ | 32 | Ext.Ajax.request({ |
| 26 | method: "POST", | 33 | method: "POST", |
| 27 | url: 'api/mainconfig/update', | 34 | url: 'api/utils/ping', |
| 28 | headers: { | 35 | headers: { |
| 29 | 'Accept': 'application/json', | 36 | 'Accept': 'application/json', |
| 30 | 'Content-Type': 'application/json' | 37 | 'Content-Type': 'application/json' |
| 31 | }, | 38 | }, |
| 32 | params: data, | 39 | params: data, |
| 33 | success: function(response, opts) { | 40 | success: function(response, opts) { |
| 41 | |||
| 42 | var result = Ext.JSON.decode(response.responseText); | ||
| 43 | |||
| 44 | var str=""; | ||
| 45 | for(var i in result){ | ||
| 46 | |||
| 47 | str=str+result[i]+"\n"; | ||
| 48 | } | ||
| 34 | 49 | ||
| 35 | var result = Ext.JSON.decode(response.responseText); | 50 | // console.log(str); |
| 36 | 51 | ||
| 37 | if(result) { | 52 | Ext.getCmp('pingResult').setValue(str); |
| 38 | Ext.Msg.alert('Success', 'Обновление конфигурации выполнено!'); | 53 | |
| 39 | //record.commit(); | 54 | form.unmask(); |
| 40 | } | ||
| 41 | else | ||
| 42 | { | ||
| 43 | Ext.Msg.alert('Failure', 'Обновление конфигурации не выполнено!'); | ||
| 44 | } | ||
| 45 | 55 | ||
| 46 | 56 | ||
| 47 | }, failure: function(response, opts) { | 57 | }, failure: function(response, opts) { |
| 48 | Ext.Msg.alert('Failure', 'Обновление конфигурации не выполнено!'); | 58 | Ext.Msg.alert('Ошибка', 'Ошибка досупа к серверу'); |
| 49 | } | 59 | } |
| 50 | }); | 60 | }); |
| 61 | }else { | ||
| 62 | //Ext.Msg.alert('Ошибка', 'Введите '); | ||
| 63 | |||
| 64 | } | ||
| 51 | 65 | ||
| 52 | } | 66 | |
| 53 | else { | 67 | |
| 54 | Ext.Msg.alert('Failure', 'Обновление конфигурации не выполнено!'); | 68 | |
| 55 | } | 69 | } |
| 56 | } | 70 | } |
| 57 | }); | 71 | }); |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -15,28 +15,24 @@ Ext.define('App.view.MainConfig', { | ... | @@ -15,28 +15,24 @@ Ext.define('App.view.MainConfig', { |
| 15 | type: 'mainconfigform' // references DetailViewModel | 15 | type: 'mainconfigform' // references DetailViewModel |
| 16 | }, | 16 | }, |
| 17 | 17 | ||
| 18 | bbar: { | 18 | bbar: {items: [{ |
| 19 | 19 | xtype: 'button', | |
| 20 | items: [ { | 20 | iconCls:'save', |
| 21 | xtype: 'button', | 21 | itemId: 'SaveMainConfigButton', |
| 22 | iconCls:'save', | 22 | text: 'Сохранить', |
| 23 | itemId: 'SaveMainConfigButton', | 23 | action: 'saveMainConfig', |
| 24 | text: 'Сохранить', | 24 | disabled:false |
| 25 | action: 'saveMainConfig', | 25 | }, |
| 26 | disabled:false | 26 | { |
| 27 | }, | 27 | xtype: 'button', |
| 28 | { | 28 | iconCls:'load', |
| 29 | xtype: 'button', | 29 | itemId: 'LoadMainConfigButton', |
| 30 | iconCls:'save', | 30 | text: 'Обновить', |
| 31 | itemId: 'LoadMainConfigButton', | 31 | action: 'loadMainConfig', |
| 32 | text: 'Обновить', | 32 | disabled:false |
| 33 | action: 'loadMainConfig', | 33 | }] |
| 34 | disabled:false | ||
| 35 | } | ||
| 36 | ] | ||
| 37 | }, | 34 | }, |
| 38 | 35 | ||
| 39 | |||
| 40 | items : [{ | 36 | items : [{ |
| 41 | xtype : 'textfield', | 37 | xtype : 'textfield', |
| 42 | bind : '{guid}', | 38 | bind : '{guid}', |
| ... | @@ -45,8 +41,7 @@ Ext.define('App.view.MainConfig', { | ... | @@ -45,8 +41,7 @@ Ext.define('App.view.MainConfig', { |
| 45 | disable:true, | 41 | disable:true, |
| 46 | width:500, | 42 | width:500, |
| 47 | margin:'5 5 10 3' | 43 | margin:'5 5 10 3' |
| 48 | }, | 44 | },{ |
| 49 | { | ||
| 50 | xtype : 'textarea', | 45 | xtype : 'textarea', |
| 51 | bind : '{description}', | 46 | bind : '{description}', |
| 52 | fieldLabel : 'ОПИСАНИЕ', | 47 | fieldLabel : 'ОПИСАНИЕ', |
| ... | @@ -54,6 +49,5 @@ Ext.define('App.view.MainConfig', { | ... | @@ -54,6 +49,5 @@ Ext.define('App.view.MainConfig', { |
| 54 | width:500, | 49 | width:500, |
| 55 | id:'title', | 50 | id:'title', |
| 56 | margin:'5 5 10 3' | 51 | margin:'5 5 10 3' |
| 57 | } | 52 | }] |
| 58 | ] | ||
| 59 | }); | 53 | }); |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -21,42 +21,30 @@ Ext.define('App.view.NetworkSetting', { | ... | @@ -21,42 +21,30 @@ Ext.define('App.view.NetworkSetting', { |
| 21 | 21 | ||
| 22 | bbar: { | 22 | bbar: { |
| 23 | 23 | ||
| 24 | items: [ | 24 | items: [{ |
| 25 | 25 | xtype: 'button', | |
| 26 | 26 | iconCls:'save', | |
| 27 | { | 27 | itemId: 'SaveEthButton', |
| 28 | xtype: 'button', | 28 | text: 'Сохранить', |
| 29 | iconCls:'save', | 29 | action: 'saveEth', |
| 30 | itemId: 'SaveEthButton', | 30 | disabled:false |
| 31 | text: 'Сохранить', | 31 | },{ |
| 32 | action: 'saveEth', | 32 | xtype: 'button', |
| 33 | disabled:false | 33 | iconCls:'load', |
| 34 | }, | 34 | itemId: 'LoadEthButton', |
| 35 | { | 35 | text: 'Обновить', |
| 36 | xtype: 'button', | 36 | action: 'loadEth', |
| 37 | iconCls:'load', | 37 | disabled:false |
| 38 | itemId: 'LoadEthButton', | 38 | },{ |
| 39 | text: 'Обновить', | 39 | xtype: 'button', |
| 40 | action: 'loadEth', | 40 | iconCls:'restart', |
| 41 | disabled:false | 41 | itemId: 'RebootEthButton', |
| 42 | }, | 42 | text: 'Перезагрузить', |
| 43 | 43 | action: 'rebootEth', | |
| 44 | { | 44 | disabled:false |
| 45 | xtype: 'button', | 45 | }] |
| 46 | iconCls:'restart', | ||
| 47 | itemId: 'RebootEthButton', | ||
| 48 | text: 'Перезагрузить', | ||
| 49 | action: 'rebootEth', | ||
| 50 | disabled:false | ||
| 51 | } | ||
| 52 | |||
| 53 | ] | ||
| 54 | |||
| 55 | |||
| 56 | }, | 46 | }, |
| 57 | 47 | items : [ | |
| 58 | |||
| 59 | items : [ | ||
| 60 | { | 48 | { |
| 61 | xtype : 'mvvm-EthView', | 49 | xtype : 'mvvm-EthView', |
| 62 | id:'cbxeth' | 50 | id:'cbxeth' | ... | ... |
| 1 | |||
| 2 | |||
| 1 | Ext.define('App.view.PingUtil', { | 3 | Ext.define('App.view.PingUtil', { |
| 2 | extend : 'Ext.form.Panel', | 4 | extend:'Ext.Window', |
| 3 | xtype : 'mvvm-PingUtilView', | 5 | closeAction: 'destroy', |
| 4 | requires : [ | 6 | requires: [ |
| 5 | 'App.view.PingUtilViewModel' | 7 | |
| 6 | ], | 8 | ], |
| 7 | 9 | ||
| 8 | frame : true, | 10 | initComponent: function(){ |
| 9 | padding : 10, | 11 | |
| 10 | 12 | ||
| 11 | bind : { | 13 | Ext.apply(this, { |
| 12 | // reference : 'App.model.MainConfig', | 14 | layout: 'fit', |
| 13 | // title : '{rec.title}' | 15 | title:'Проверка пинга', |
| 14 | }, | 16 | // closeAction: 'hide', |
| 15 | 17 | alias: 'winutils', | |
| 16 | viewModel: { | 18 | id:'winPing', |
| 17 | type: 'pingutilform' // references DetailViewModel | 19 | height: 320, |
| 18 | }, | 20 | width:720, |
| 21 | items: [ | ||
| 22 | { xtype: 'fieldset', | ||
| 23 | title: '', | ||
| 24 | defaultType: 'textfield', | ||
| 25 | layout: 'anchor', | ||
| 26 | defaults: { | ||
| 27 | anchor: '100%' | ||
| 28 | }, | ||
| 29 | items: [ | ||
| 30 | { | ||
| 31 | xtype: 'fieldcontainer', | ||
| 32 | combineErrors: true, | ||
| 33 | msgTarget : 'side', | ||
| 34 | layout: 'hbox', | ||
| 35 | defaults: { | ||
| 36 | flex: 1, | ||
| 37 | }, | ||
| 38 | items: [ | ||
| 39 | |||
| 40 | { | ||
| 41 | xtype: 'textfield', | ||
| 42 | id: 'ipaddress', | ||
| 43 | fieldLabel: 'HOST', | ||
| 44 | flex: 4, | ||
| 45 | margin: '5 5 5 5' | ||
| 46 | |||
| 47 | }, | ||
| 48 | { | ||
| 49 | text:'ping', | ||
| 50 | xtype:'button', | ||
| 51 | itemId:'btnping', | ||
| 52 | action:'btnping', | ||
| 53 | margin: '5 5 5 5', | ||
| 54 | flex: 1, | ||
| 55 | } | ||
| 56 | ] | ||
| 57 | }, | ||
| 58 | |||
| 59 | |||
| 60 | { | ||
| 61 | xtype: 'fieldcontainer', | ||
| 62 | combineErrors: true, | ||
| 63 | msgTarget : 'side', | ||
| 64 | layout: 'hbox', | ||
| 65 | defaults: { | ||
| 66 | flex: 1, | ||
| 67 | }, | ||
| 68 | items: [ | ||
| 69 | { | ||
| 70 | fieldLabel : 'РЕЗУЛЬТАТ', | ||
| 71 | margin:'5 5 10 3', | ||
| 72 | id:'pingResult', | ||
| 73 | xtype : 'textareafield', | ||
| 74 | grow : true, | ||
| 75 | preventScrollbars: false, | ||
| 76 | width:700, | ||
| 77 | height:200 | ||
| 78 | } | ||
| 79 | ] | ||
| 80 | }, | ||
| 81 | |||
| 82 | ], | ||
| 83 | |||
| 84 | tbar: [ | ||
| 85 | { | ||
| 86 | xtype: 'combobox', | ||
| 87 | id:'cbxups', | ||
| 88 | name:'cbxups', | ||
| 89 | fieldLabel:'ИБП:', | ||
| 90 | // store:Ext.create('App.store.Ups'), | ||
| 91 | valueField:'id', | ||
| 92 | displayField:'title', | ||
| 93 | queryMode:'local', | ||
| 94 | width:230, | ||
| 95 | labelWidth:40, | ||
| 96 | margin:'5 5 5 5', | ||
| 97 | action:'cbxups' | ||
| 98 | |||
| 99 | }, | ||
| 100 | { | ||
| 101 | text:'Журнал событий', | ||
| 102 | xtype:'button', | ||
| 103 | name:'btnevents', | ||
| 104 | id:'btnevents', | ||
| 105 | action:'events', | ||
| 106 | width:125, | ||
| 107 | margin: '2 2 2 2' | ||
| 108 | |||
| 109 | |||
| 110 | } | ||
| 111 | ] | ||
| 112 | |||
| 113 | |||
| 114 | }] | ||
| 115 | }); | ||
| 116 | |||
| 117 | |||
| 118 | this.callParent(arguments); | ||
| 119 | } | ||
| 120 | }); | ||
| 121 | |||
| 122 | ////////////////////////// | ||
| 123 | /* | ||
| 19 | 124 | ||
| 20 | items : [ | 125 | items : [ |
| 21 | 126 | ||
| 22 | { | 127 | { |
| 23 | xtype : 'textfield', | 128 | xtype : 'textfield', |
| 24 | bind : '{rec.host}', | ||
| 25 | fieldLabel : 'HOST', | 129 | fieldLabel : 'HOST', |
| 26 | disable:true, | 130 | disable:true, |
| 27 | margin:'5 5 10 3' | 131 | margin:'5 5 10 3' |
| ... | @@ -47,4 +151,6 @@ Ext.define('App.view.PingUtil', { | ... | @@ -47,4 +151,6 @@ Ext.define('App.view.PingUtil', { |
| 47 | 151 | ||
| 48 | 152 | ||
| 49 | ] | 153 | ] |
| 50 | }); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 154 | }); | ||
| 155 | |||
| 156 | */ | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or sign in to post a comment