From ba806113243e689e9b0737e7ef996821cce8c17b Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Sat, 20 Nov 2021 21:54:53 +0100 Subject: [PATCH] ui: traffic-control view: various code cleanups Signed-off-by: Thomas Lamprecht --- www/config/TrafficControlView.js | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/www/config/TrafficControlView.js b/www/config/TrafficControlView.js index 21dd7745..aa504515 100644 --- a/www/config/TrafficControlView.js +++ b/www/config/TrafficControlView.js @@ -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,28 +36,26 @@ 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(); if (selection.length < 1) return; - Ext.create('PBS.window.TrafficControlEdit', { - name: selection[0].data.name, + 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, }, {