ui: traffic-control view: various code cleanups

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-11-20 21:54:53 +01:00
parent 07a579c632
commit ba80611324
1 changed files with 12 additions and 14 deletions

View File

@ -28,7 +28,7 @@ Ext.define('PBS.config.TrafficControlView', {
title: gettext('Traffic Control'),
// tools: [PBS.Utils.get_help_tool("backup-remote")],
// tools: [PBS.Utils.get_help_tool("backup-remote")], // TODO!
controller: {
xclass: 'Ext.app.ViewController',
@ -36,15 +36,14 @@ Ext.define('PBS.config.TrafficControlView', {
addRemote: function() {
let me = this;
Ext.create('PBS.window.TrafficControlEdit', {
autoShow: true,
listeners: {
destroy: function() {
me.reload();
destroy: () => me.reload(),
},
},
}).show();
});
},
editRemote: function() {
editTrafficControl: function() {
let me = this;
let view = me.getView();
let selection = view.getSelection();
@ -52,12 +51,11 @@ Ext.define('PBS.config.TrafficControlView', {
Ext.create('PBS.window.TrafficControlEdit', {
name: selection[0].data.name,
autoShow: true,
listeners: {
destroy: function() {
me.reload();
destroy: () => me.reload(),
},
},
}).show();
});
},
render_bandwidth: v => v ? Proxmox.Utils.autoscale_size_unit(v) + '/s' : '',
@ -71,7 +69,7 @@ Ext.define('PBS.config.TrafficControlView', {
listeners: {
activate: 'reload',
itemdblclick: 'editRemote',
itemdblclick: 'editTrafficControl',
},
store: {
@ -98,7 +96,7 @@ Ext.define('PBS.config.TrafficControlView', {
{
xtype: 'proxmoxButton',
text: gettext('Edit'),
handler: 'editRemote',
handler: 'editTrafficControl',
disabled: true,
},
{