]>
git.proxmox.com Git - proxmox-widget-toolkit.git/blob - node/HostsView.js
1 Ext
.define('Proxmox.node.HostsView', {
2 extend
: 'Ext.panel.Panel',
3 xtype
: 'proxmoxNodeHostsView',
12 text
: gettext('Save'),
16 var me
= this.up('panel');
17 Proxmox
.Utils
.API2Request({
20 data
: me
.down('#hostsfield').getValue()
23 url
: '/nodes/' + me
.nodename
+ '/hosts',
25 success: function(response
, opts
) {
28 failure: function(response
, opts
) {
29 Ext
.Msg
.alert('Error', response
.htmlStatus
);
35 text
: gettext('Revert'),
39 var me
= this.up('panel');
40 me
.down('#hostsfield').reset();
52 'font-family': 'monospace',
56 dirtychange: function(ta
, dirty
) {
57 var me
= this.up('panel');
58 me
.down('#savebtn').setDisabled(!dirty
);
59 me
.down('#resetbtn').setDisabled(!dirty
);
65 initComponent : function() {
69 throw "no node name specified";
72 me
.store
= Ext
.create('Ext.data.Store', {
75 url
: "/api2/json/nodes/" + me
.nodename
+ "/hosts",
81 Proxmox
.Utils
.monStoreErrors(me
, me
.store
);
83 me
.mon(me
.store
, 'load', function(store
, records
, success
) {
84 if (!success
|| records
.length
< 1) {
87 me
.digest
= records
[0].data
.digest
;
88 var data
= records
[0].data
.data
;
89 me
.down('#hostsfield').setValue(data
);
90 me
.down('#hostsfield').resetOriginalValue();