Commit 8fb6e0fa 8fb6e0fad17eb8c7e6e3a9ff3da9917e972b97d9 by root

save

1 parent 170d4cb6
......@@ -31,6 +31,15 @@
background-image:url(resources/img/load.png) !important;
}
.restart {
background-image:url(resources/img/restart.png) !important;
}
.ping {
background-image:url(resources/img/ping.png) !important;
}
</style>
......
......@@ -34,26 +34,11 @@ Ext.application({
launch : function() {
var record = new Object({
run: function () {
var ret = null;
$.ajax({
url: 'api/mainconfig/get',
beforeSend: function () {
},
async: false,
dataType: "json",
type: "GET",
success: function (data) {
ret=data;
}
});
return ret;
}
});
//mask
Ext.getBody().mask("Загрузка...");
var data=record.run();
Ext.create('Ext.container.Viewport', {
......@@ -119,13 +104,14 @@ Ext.application({
},
{
title: 'Удаленный сервер',
items:[]
},
{
title: 'Управление',
items:[]
}
]
}
......@@ -141,11 +127,8 @@ Ext.application({
xtype: 'tabpanel',
items: [
{
title: 'ETH',
items:[{
xtype : 'mvvm-EthView',
id:'cbxeth'
},
title: 'ETHERNET',
items:[
{
xtype : 'mvvm-NetworkSettingView',
id:'fromnetwork',
......@@ -200,11 +183,14 @@ Ext.application({
]
}
},
]
},
/*
{
title: 'ПЕРЕМЕННЫЕ',
......@@ -258,6 +244,24 @@ Ext.application({
]
}
*/
{
title: 'СОХРАНЕНИЕ',
items:[
{
region: 'center',
xtype: 'tabpanel',
items: [
]
}
]
},
]
}
]
......@@ -265,7 +269,7 @@ Ext.application({
});
Ext.getBody().unmask();
}
});
......
......@@ -5,11 +5,22 @@ Ext.define('App.controller.MainConfig', {
this.control({
'mvvm-MainConfigView > button#SaveRecord' : {
'toolbar button[action=saveMainConfig]' : {
click : this.onSaveButtonClick
},
'toolbar button[action=loadMainConfig]' : {
click : this.onLoadButtonClick
}
});
this.onLoadButtonClick();
},
onLoadButtonClick:function() {
Ext.Ajax.request({
method: "GET",
......@@ -29,8 +40,10 @@ Ext.define('App.controller.MainConfig', {
}, failure: function(response, opts) {
}
});
},
onSaveButtonClick : function(btn) {
var mainconfigView = btn.up('mvvm-MainConfigView');
......
......@@ -5,7 +5,7 @@ Ext.define('App.controller.NetworkSetting', {
this.control({
'mvvm-NetworkSettingView > button#SaveRecord' : {
'toolbar button[action=saveEth]' : {
click : this.onSaveButtonClick
}
});
......@@ -40,6 +40,9 @@ Ext.define('App.controller.NetworkSetting', {
var eth=record ? record.get(combo.displayField) : null;
Ext.Ajax.request({
method: "GET",
url: 'api/net/byeth/'+eth,
......@@ -62,13 +65,22 @@ Ext.define('App.controller.NetworkSetting', {
}
});
//unmask
}
},
onSaveButtonClick : function(btn) {
var networksettingView = btn.up('mvvm-NetworkSettingView');
//mask
networksettingView.mask("Сохранение...");
var record = networksettingView.getViewModel().getData();
if (record) {
......@@ -77,7 +89,7 @@ Ext.define('App.controller.NetworkSetting', {
Ext.Ajax.request({
method: "POST",
url: 'api/net/update',
url: 'api/eth/update',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
......@@ -92,6 +104,7 @@ Ext.define('App.controller.NetworkSetting', {
}
}, failure: function(response, opts) {
Ext.Msg.alert('Failure', 'Обновление конфигурации не выполнено!');
}
});
......@@ -100,7 +113,7 @@ Ext.define('App.controller.NetworkSetting', {
}
networksettingView.unmask();
}
......
......@@ -15,7 +15,7 @@ Ext.define('App.store.Eth', {
type : 'ajax',
api: {
read: 'api/net/alleth'
read: 'api/eth/all'
},
reader : {
......
......@@ -20,7 +20,7 @@ Ext.define('App.view.Eth', {
Ext.Ajax.request({
method: "GET",
url: 'api/net/byeth/'+records[0].get('name'),
url: 'api/eth/byeth/'+records[0].get('name'),
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
......
......@@ -19,18 +19,41 @@ Ext.define('App.view.Gprs', {
type: 'gprsform'
},
bbar: {
items: [ {
xtype: 'button',
iconCls:'save',
itemId: 'SaveGprsButton',
text: 'Сохранить',
action: 'saveGprs',
disabled:false
},
{
xtype: 'button',
iconCls:'load',
itemId: 'LoadGprsButton',
text: 'Обновить',
action: 'loadGprs',
disabled:false
}
]
},
items : [
{
xtype: 'radiogroup',
fieldLabel: 'Оператор связи',
width:500,
columns: 2,
width:400,
height:100,
columns: 3,
itemId: 'internetGprs',
items: [
{
xtype: 'radiofield',
boxLabel: '<img src="resources/img/mts.jpg"/>',
boxLabel: '<img src="resources/img/mts.png"/>',
name: 'framework',
checked: true,
width:100,
......@@ -38,24 +61,21 @@ Ext.define('App.view.Gprs', {
},
{
xtype: 'radiofield',
boxLabel: 'Megafon',
boxLabel: '<img src="resources/img/megafon.png"/>',
name: 'framework',
width:100,
inputValue: 'megafon'
},
{
xtype: 'radiofield',
boxLabel: 'Beeline',
boxLabel: '<img src="resources/img/beeline.png"/>',
name: 'framework',
width:100,
inputValue: 'beeline'
}
]
},
{
xtype: 'button',
text: 'Применить'
}
]
});
\ No newline at end of file
......
......@@ -15,6 +15,28 @@ 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
}
]
},
items : [{
xtype : 'textfield',
bind : '{guid}',
......@@ -32,14 +54,6 @@ Ext.define('App.view.MainConfig', {
width:500,
id:'title',
margin:'5 5 10 3'
},
{
xtype : 'button',
text : 'Сохранить',
itemId : 'SaveRecord'
}
]
});
\ No newline at end of file
......
......@@ -8,8 +8,61 @@ Ext.define('App.view.NetworkSetting', {
frame : false,
padding : 3,
tbar: {
items: [ {
xtype: 'button',
iconCls:'ping',
itemId: 'pingButton',
text: 'проверка-ping',
action: 'showformping',
disabled:false
}]
},
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 : 'mvvm-EthView',
id:'cbxeth'
},
{
xtype : 'checkboxfield',
......@@ -27,6 +80,7 @@ Ext.define('App.view.NetworkSetting', {
bind : '{mac}',
id:'mac',
fieldLabel : 'MAC',
disabled:true,
margin:'5 5 10 3'
},
......@@ -58,17 +112,6 @@ Ext.define('App.view.NetworkSetting', {
margin:'5 5 10 3'
},
{
xtype : 'textfield',
bind : '{broadcast}',
fieldLabel : 'BROADCAST',
id:'broadcast',
margin:'5 5 10 3',
},
{
xtype : 'textarea',
bind : '{info}',
......@@ -80,20 +123,8 @@ Ext.define('App.view.NetworkSetting', {
width:700,
height:100,
},
{
xtype : 'button',
text : 'ПРИМЕНИТЬ',
itemId : 'SaveRecord',
margin:'5 5 10 3'
}
]
});
\ No newline at end of file
......