]>
Commit | Line | Data |
---|---|---|
58377263 DT |
1 | Ext.define('Proxmox.node.NodeOptionsView', { |
2 | extend: 'Proxmox.grid.ObjectGrid', | |
3 | alias: ['widget.proxmoxNodeOptionsView'], | |
4 | mixins: ['Proxmox.Mixin.CBind'], | |
5 | ||
6 | cbindData: function(_initialconfig) { | |
7 | let me = this; | |
8 | ||
9 | let baseUrl = `/nodes/${me.nodename}/config`; | |
10 | me.url = `/api2/json${baseUrl}`; | |
11 | me.editorConfig = { | |
12 | url: `/api2/extjs/${baseUrl}`, | |
13 | }; | |
14 | ||
15 | return {}; | |
16 | }, | |
17 | ||
18 | listeners: { | |
19 | itemdblclick: function() { this.run_editor(); }, | |
20 | activate: function() { this.rstore.startUpdate(); }, | |
21 | destroy: function() { this.rstore.stopUpdate(); }, | |
22 | deactivate: function() { this.rstore.stopUpdate(); }, | |
23 | }, | |
24 | ||
25 | tbar: [ | |
26 | { | |
27 | text: gettext('Edit'), | |
28 | xtype: 'proxmoxButton', | |
29 | disabled: true, | |
30 | handler: btn => btn.up('grid').run_editor(), | |
31 | }, | |
32 | ], | |
33 | ||
34 | gridRows: [ | |
35 | { | |
36 | xtype: 'integer', | |
37 | name: 'startall-onboot-delay', | |
38 | text: gettext('Start on boot delay'), | |
39 | minValue: 0, | |
40 | maxValue: 300, | |
41 | labelWidth: 130, | |
42 | deleteEmpty: true, | |
43 | renderer: function(value) { | |
44 | if (value === undefined) { | |
45 | return Proxmox.Utils.defaultText; | |
46 | } | |
47 | ||
48 | let secString = value === '1' ? gettext('Second') : gettext('Seconds'); | |
49 | return `${value} ${secString}`; | |
50 | }, | |
51 | }, | |
52 | { | |
53 | xtype: 'text', | |
54 | name: 'wakeonlan', | |
ab78e7e2 | 55 | text: gettext('MAC address for Wake on LAN'), |
58377263 | 56 | vtype: 'MacAddress', |
ab78e7e2 | 57 | labelWidth: 150, |
58377263 DT |
58 | deleteEmpty: true, |
59 | renderer: function(value) { | |
60 | if (value === undefined) { | |
61 | return Proxmox.Utils.NoneText; | |
62 | } | |
63 | ||
64 | return value; | |
65 | }, | |
66 | }, | |
67 | ], | |
68 | }); |