proxmox-widget-toolkit/node/DNSView.js
Dominik Csapak 1a68e95dec change time of startupdate
because these components are not always children of
a tabpanel or standalone, we cannot use activate here
else we do not trigger the startupdate

disadvantage: when used as a child of a tabpanel,
it starts immediately instead of when clicking on the tab

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-04-05 09:43:19 +02:00

46 lines
959 B
JavaScript

Ext.define('Proxmox.node.DNSView', {
extend: 'Proxmox.grid.ObjectGrid',
alias: ['widget.proxmoxNodeDNSView'],
initComponent : function() {
var me = this;
if (!me.nodename) {
throw "no node name specified";
}
var run_editor = function() {
var win = Ext.create('Proxmox.node.DNSEdit', {
nodename: me.nodename
});
win.show();
};
Ext.apply(me, {
url: "/api2/json/nodes/" + me.nodename + "/dns",
cwidth1: 130,
interval: 1000,
rows: {
search: { header: 'Search domain', required: true },
dns1: { header: gettext('DNS server') + " 1", required: true },
dns2: { header: gettext('DNS server') + " 2" },
dns3: { header: gettext('DNS server') + " 3" }
},
tbar: [
{
text: gettext("Edit"),
handler: run_editor
}
],
listeners: {
itemdblclick: run_editor
}
});
me.callParent();
me.on('destroy', me.rstore.stopUpdate);
me.rstore.startUpdate();
}
});