Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Дмитрий Корытько
/
hware
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
2fae680f
...
2fae680f8c4af151eded595ec7097383cb8a9e6f
authored
2015-07-21 15:39:31 +0400
by
root
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
save
1 parent
8fb6e0fa
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
212 additions
and
71 deletions
DevTools/pom.xml
DevTools/src/main/webapp/resources/js/app.js
DevTools/src/main/webapp/resources/js/app/controller/DetailDns.js
DevTools/src/main/webapp/resources/js/app/controller/MainConfig.js
DevTools/src/main/webapp/resources/js/app/controller/NetworkSetting.js
DevTools/src/main/webapp/resources/js/app/controller/PingUtil.js
DevTools/src/main/webapp/resources/js/app/view/MainConfig.js
DevTools/src/main/webapp/resources/js/app/view/NetworkSetting.js
DevTools/src/main/webapp/resources/js/app/view/PingUtil.js
DevTools/src/main/webapp/resources/js/app/view/PingUtilViewModel.js
DevTools/pom.xml
View file @
2fae680
...
...
@@ -157,6 +157,26 @@
<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>
...
...
DevTools/src/main/webapp/resources/js/app.js
View file @
2fae680
...
...
@@ -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'
}
]
},
{
...
...
DevTools/src/main/webapp/resources/js/app/controller/DetailDns.js
View file @
2fae680
...
...
@@ -13,7 +13,7 @@ Ext.define('App.controller.DetailDns', {
onSaveButtonClick
:
function
(
btn
)
{
console
.
log
(
'result:'
);
var
store
=
Ext
.
getCmp
(
'grdDns'
).
getStore
();
...
...
DevTools/src/main/webapp/resources/js/app/controller/MainConfig.js
View file @
2fae680
...
...
@@ -22,6 +22,8 @@ Ext.define('App.controller.MainConfig', {
onLoadButtonClick
:
function
()
{
Ext
.
Ajax
.
request
({
method
:
"GET"
,
url
:
'api/devinfo/'
,
...
...
DevTools/src/main/webapp/resources/js/app/controller/NetworkSetting.js
View file @
2fae680
...
...
@@ -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
()
{
...
...
DevTools/src/main/webapp/resources/js/app/controller/PingUtil.js
View file @
2fae680
...
...
@@ -4,27 +4,34 @@ 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'
);
startPing
:
function
(
btn
,
e
,
options
)
{
var
form
=
Ext
.
getCmp
(
'winPing'
);
//get the bound record
var
record
=
pingutilView
.
getViewModel
().
getData
().
rec
;
if
(
form
!=
null
)
{
if
(
record
)
{
var
data
=
Ext
.
util
.
JSON
.
encode
(
record
);
var
ipValue
=
Ext
.
getCmp
(
'ipaddress'
).
getValue
();
form
.
mask
(
"Выполнение ..."
);
if
(
ipValue
!=
""
)
{
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'
...
...
@@ -34,24 +41,31 @@ Ext.define('App.controller.PingUtil', {
var
result
=
Ext
.
JSON
.
decode
(
response
.
responseText
);
if
(
result
)
{
Ext
.
Msg
.
alert
(
'Success'
,
'Обновление конфигурации выполнено!'
);
//record.commit();
}
else
{
Ext
.
Msg
.
alert
(
'Failure'
,
'Обновление конфигурации не выполнено!'
);
var
str
=
""
;
for
(
var
i
in
result
){
str
=
str
+
result
[
i
]
+
"\n"
;
}
// console.log(str);
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
...
...
DevTools/src/main/webapp/resources/js/app/view/MainConfig.js
View file @
2fae680
...
...
@@ -15,9 +15,7 @@ Ext.define('App.view.MainConfig', {
type
:
'mainconfigform'
// references DetailViewModel
},
bbar
:
{
items
:
[
{
bbar
:
{
items
:
[{
xtype
:
'button'
,
iconCls
:
'save'
,
itemId
:
'SaveMainConfigButton'
,
...
...
@@ -27,16 +25,14 @@ Ext.define('App.view.MainConfig', {
},
{
xtype
:
'button'
,
iconCls
:
'save
'
,
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
...
...
DevTools/src/main/webapp/resources/js/app/view/NetworkSetting.js
View file @
2fae680
...
...
@@ -21,41 +21,29 @@ Ext.define('App.view.NetworkSetting', {
bbar
:
{
items
:
[
{
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'
,
...
...
DevTools/src/main/webapp/resources/js/app/view/PingUtil.js
View file @
2fae680
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
,
initComponent
:
function
(){
bind
:
{
// reference : 'App.model.MainConfig',
// title : '{rec.title}'
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
:
[
viewModel
:
{
type
:
'pingutilform'
// references DetailViewModel
{
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'
...
...
@@ -48,3 +152,5 @@ Ext.define('App.view.PingUtil', {
]
});
*/
\ No newline at end of file
...
...
DevTools/src/main/webapp/resources/js/app/view/PingUtilViewModel.js
deleted
100644 → 0
View file @
8fb6e0f
Ext
.
define
(
'App.view.PingUtilViewModel'
,
{
extend
:
'Ext.app.ViewModel'
,
alias
:
'viewmodel.pingutilform'
,
data
:
{
rec
:
null
}
});
\ No newline at end of file
Please
register
or
sign in
to post a comment