mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-07-27 07:54:52 +00:00
ui: ha/GroupView: eslint fixes and code cleanup/refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
ad9091d0d1
commit
09eb422315
@ -26,25 +26,23 @@ Ext.define('PVE.ha.GroupsView', {
|
|||||||
|
|
||||||
var sm = Ext.create('Ext.selection.RowModel', {});
|
var sm = Ext.create('Ext.selection.RowModel', {});
|
||||||
|
|
||||||
var run_editor = function() {
|
let run_editor = function() {
|
||||||
var rec = sm.getSelection()[0];
|
let rec = sm.getSelection()[0];
|
||||||
|
Ext.create('PVE.ha.GroupEdit', {
|
||||||
var win = Ext.create('PVE.ha.GroupEdit', {
|
|
||||||
groupId: rec.data.group,
|
groupId: rec.data.group,
|
||||||
|
listeners: {
|
||||||
|
destroy: () => store.load(),
|
||||||
|
},
|
||||||
|
autoShow: true,
|
||||||
});
|
});
|
||||||
win.on('destroy', reload);
|
|
||||||
win.show();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var remove_btn = Ext.create('Proxmox.button.StdRemoveButton', {
|
let remove_btn = Ext.create('Proxmox.button.StdRemoveButton', {
|
||||||
selModel: sm,
|
selModel: sm,
|
||||||
baseurl: '/cluster/ha/groups/',
|
baseurl: '/cluster/ha/groups/',
|
||||||
callback: function() {
|
callback: () => store.load(),
|
||||||
reload();
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
let edit_btn = new Proxmox.button.Button({
|
||||||
var edit_btn = new Proxmox.button.Button({
|
|
||||||
text: gettext('Edit'),
|
text: gettext('Edit'),
|
||||||
disabled: true,
|
disabled: true,
|
||||||
selModel: sm,
|
selModel: sm,
|
||||||
@ -62,12 +60,16 @@ Ext.define('PVE.ha.GroupsView', {
|
|||||||
text: gettext('Create'),
|
text: gettext('Create'),
|
||||||
disabled: !caps.nodes['Sys.Console'],
|
disabled: !caps.nodes['Sys.Console'],
|
||||||
handler: function() {
|
handler: function() {
|
||||||
var win = Ext.create('PVE.ha.GroupEdit', {});
|
Ext.create('PVE.ha.GroupEdit', {
|
||||||
win.on('destroy', reload);
|
listeners: {
|
||||||
win.show();
|
destroy: () => store.load(),
|
||||||
|
},
|
||||||
|
autoShow: true,
|
||||||
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
edit_btn, remove_btn,
|
edit_btn,
|
||||||
|
remove_btn,
|
||||||
],
|
],
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
@ -105,11 +107,7 @@ Ext.define('PVE.ha.GroupsView', {
|
|||||||
],
|
],
|
||||||
listeners: {
|
listeners: {
|
||||||
activate: reload,
|
activate: reload,
|
||||||
beforeselect: function(grid, record, index, eOpts) {
|
beforeselect: (grid, record, index, eOpts) => caps.nodes['Sys.Console'],
|
||||||
if (!caps.nodes['Sys.Console']) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
itemdblclick: run_editor,
|
itemdblclick: run_editor,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user