Commit 2fae680f 2fae680f8c4af151eded595ec7097383cb8a9e6f by root

save

1 parent 8fb6e0fa
......@@ -156,6 +156,26 @@
<artifactId>proxymanager</artifactId>
<version>1.5</version>
</dependency>
<dependency>
<groupId>org.emercit</groupId>
<artifactId>remoteservers</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>org.emercit</groupId>
<artifactId>pckutils</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
......
......@@ -11,6 +11,7 @@ Ext.application({
'Proxy',
'DetailDns',
'DetailProxy',
'RemoteServer'
......@@ -21,7 +22,8 @@ Ext.application({
'PingUtil',
'DetailDns',
'Dns',
'Proxy'
'Proxy',
'RemoteServer'
],
......@@ -105,7 +107,12 @@ Ext.application({
{
title: 'Удаленный сервер',
items:[]
items:[
{
xtype :'mvvm-RemoteServerView',
id:'formremoteserver'
}
]
},
{
......
......@@ -13,7 +13,7 @@ Ext.define('App.controller.DetailDns', {
onSaveButtonClick : function(btn) {
console.log('result:');
var store=Ext.getCmp('grdDns').getStore();
......
......@@ -22,6 +22,8 @@ Ext.define('App.controller.MainConfig', {
onLoadButtonClick:function() {
Ext.Ajax.request({
method: "GET",
url: 'api/devinfo/',
......
......@@ -7,9 +7,19 @@ Ext.define('App.controller.NetworkSetting', {
this.control({
'toolbar button[action=saveEth]' : {
click : this.onSaveButtonClick
},
'toolbar button[action=showformping]' : {
click : this.OpenPingPanel
}
});
/*
Ext.TaskManager.start({
run: this.ReloadData,
......@@ -20,6 +30,15 @@ Ext.define('App.controller.NetworkSetting', {
},
OpenPingPanel:function() {
var panel = Ext.create("App.view.PingUtil");
panel.show();
},
ReloadData: function() {
......
......@@ -4,54 +4,68 @@ Ext.define('App.controller.PingUtil', {
init : function() {
this.control({
'mvvm-PingUtilView > button#SaveRecord' : {
click : this.onSaveButtonClick
}
'#btnping': {
click: this.startPing
}
});
},
onSaveButtonClick : function(btn) {
//get reference to the form
var pingutilView = btn.up('mvvm-PingUtilView');
//get the bound record
var record = pingutilView.getViewModel().getData().rec;
if (record) {
startPing :function (btn, e, options) {
var form = Ext.getCmp('winPing');
if (form!=null) {
var ipValue=Ext.getCmp('ipaddress').getValue();
form.mask("Выполнение ...");
if (ipValue!="") {
var data=Ext.util.JSON.encode(record);
var data=Ext.util.JSON.encode(ipValue);
Ext.Ajax.request({
method: "POST",
url: 'api/mainconfig/update',
url: 'api/utils/ping',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
params: data,
success: function(response, opts) {
var result = Ext.JSON.decode(response.responseText);
var str="";
for(var i in result){
str=str+result[i]+"\n";
}
var result = Ext.JSON.decode(response.responseText);
// console.log(str);
if(result) {
Ext.Msg.alert('Success', 'Обновление конфигурации выполнено!');
//record.commit();
}
else
{
Ext.Msg.alert('Failure', 'Обновление конфигурации не выполнено!');
}
Ext.getCmp('pingResult').setValue(str);
form.unmask();
}, failure: function(response, opts) {
Ext.Msg.alert('Failure', 'Обновление конфигурации не выполнено!');
Ext.Msg.alert('Ошибка', 'Ошибка досупа к серверу');
}
});
}else {
//Ext.Msg.alert('Ошибка', 'Введите ');
}
}
else {
Ext.Msg.alert('Failure', 'Обновление конфигурации не выполнено!');
}
}
}
});
\ No newline at end of file
......
......@@ -15,28 +15,24 @@ Ext.define('App.view.MainConfig', {
type: 'mainconfigform' // references DetailViewModel
},
bbar: {
items: [ {
xtype: 'button',
iconCls:'save',
itemId: 'SaveMainConfigButton',
text: 'Сохранить',
action: 'saveMainConfig',
disabled:false
},
{
xtype: 'button',
iconCls:'save',
itemId: 'LoadMainConfigButton',
text: 'Обновить',
action: 'loadMainConfig',
disabled:false
}
]
bbar: {items: [{
xtype: 'button',
iconCls:'save',
itemId: 'SaveMainConfigButton',
text: 'Сохранить',
action: 'saveMainConfig',
disabled:false
},
{
xtype: 'button',
iconCls:'load',
itemId: 'LoadMainConfigButton',
text: 'Обновить',
action: 'loadMainConfig',
disabled:false
}]
},
items : [{
xtype : 'textfield',
bind : '{guid}',
......@@ -45,8 +41,7 @@ Ext.define('App.view.MainConfig', {
disable:true,
width:500,
margin:'5 5 10 3'
},
{
},{
xtype : 'textarea',
bind : '{description}',
fieldLabel : 'ОПИСАНИЕ',
......@@ -54,6 +49,5 @@ Ext.define('App.view.MainConfig', {
width:500,
id:'title',
margin:'5 5 10 3'
}
]
}]
});
\ No newline at end of file
......
......@@ -21,42 +21,30 @@ Ext.define('App.view.NetworkSetting', {
bbar: {
items: [
{
xtype: 'button',
iconCls:'save',
itemId: 'SaveEthButton',
text: 'Сохранить',
action: 'saveEth',
disabled:false
},
{
xtype: 'button',
iconCls:'load',
itemId: 'LoadEthButton',
text: 'Обновить',
action: 'loadEth',
disabled:false
},
{
xtype: 'button',
iconCls:'restart',
itemId: 'RebootEthButton',
text: 'Перезагрузить',
action: 'rebootEth',
disabled:false
}
]
items: [{
xtype: 'button',
iconCls:'save',
itemId: 'SaveEthButton',
text: 'Сохранить',
action: 'saveEth',
disabled:false
},{
xtype: 'button',
iconCls:'load',
itemId: 'LoadEthButton',
text: 'Обновить',
action: 'loadEth',
disabled:false
},{
xtype: 'button',
iconCls:'restart',
itemId: 'RebootEthButton',
text: 'Перезагрузить',
action: 'rebootEth',
disabled:false
}]
},
items : [
items : [
{
xtype : 'mvvm-EthView',
id:'cbxeth'
......
Ext.define('App.view.PingUtil', {
extend : 'Ext.form.Panel',
xtype : 'mvvm-PingUtilView',
requires : [
'App.view.PingUtilViewModel'
],
extend:'Ext.Window',
closeAction: 'destroy',
requires: [
],
frame : true,
padding : 10,
bind : {
// reference : 'App.model.MainConfig',
// title : '{rec.title}'
},
viewModel: {
type: 'pingutilform' // references DetailViewModel
},
initComponent: function(){
Ext.apply(this, {
layout: 'fit',
title:'Проверка пинга',
// closeAction: 'hide',
alias: 'winutils',
id:'winPing',
height: 320,
width:720,
items: [
{ xtype: 'fieldset',
title: '',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [
{
xtype: 'fieldcontainer',
combineErrors: true,
msgTarget : 'side',
layout: 'hbox',
defaults: {
flex: 1,
},
items: [
{
xtype: 'textfield',
id: 'ipaddress',
fieldLabel: 'HOST',
flex: 4,
margin: '5 5 5 5'
},
{
text:'ping',
xtype:'button',
itemId:'btnping',
action:'btnping',
margin: '5 5 5 5',
flex: 1,
}
]
},
{
xtype: 'fieldcontainer',
combineErrors: true,
msgTarget : 'side',
layout: 'hbox',
defaults: {
flex: 1,
},
items: [
{
fieldLabel : 'РЕЗУЛЬТАТ',
margin:'5 5 10 3',
id:'pingResult',
xtype : 'textareafield',
grow : true,
preventScrollbars: false,
width:700,
height:200
}
]
},
],
tbar: [
{
xtype: 'combobox',
id:'cbxups',
name:'cbxups',
fieldLabel:'ИБП:',
// store:Ext.create('App.store.Ups'),
valueField:'id',
displayField:'title',
queryMode:'local',
width:230,
labelWidth:40,
margin:'5 5 5 5',
action:'cbxups'
},
{
text:'Журнал событий',
xtype:'button',
name:'btnevents',
id:'btnevents',
action:'events',
width:125,
margin: '2 2 2 2'
}
]
}]
});
this.callParent(arguments);
}
});
//////////////////////////
/*
items : [
{
xtype : 'textfield',
bind : '{rec.host}',
fieldLabel : 'HOST',
disable:true,
margin:'5 5 10 3'
......@@ -47,4 +151,6 @@ Ext.define('App.view.PingUtil', {
]
});
\ No newline at end of file
});
*/
\ No newline at end of file
......
Ext.define('App.view.PingUtilViewModel', {
extend: 'Ext.app.ViewModel',
alias: 'viewmodel.pingutilform',
data : {
rec : null
}
});
\ No newline at end of file