From 264c19582b491dcf049d0eb64b07361c9b145cf1 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Fri, 25 Sep 2020 18:36:58 +0200 Subject: [PATCH] ui: some more eslint auto-fixes Signed-off-by: Thomas Lamprecht --- www/Application.js | 7 +++---- www/DataStorePrune.js | 38 ++++++++++++++++++------------------- www/DataStoreStatistic.js | 30 ++++++++++++++--------------- www/NavigationTree.js | 40 +++++++++++++++++++-------------------- 4 files changed, 56 insertions(+), 59 deletions(-) diff --git a/www/Application.js b/www/Application.js index 71d92942..88f7f8ce 100644 --- a/www/Application.js +++ b/www/Application.js @@ -1,4 +1,3 @@ -/*global Proxmox*/ Ext.define('PBS.Application', { extend: 'Ext.app.Application', @@ -6,7 +5,7 @@ Ext.define('PBS.Application', { appProperty: 'app', stores: [ - 'NavigationStore' + 'NavigationStore', ], layout: 'fit', @@ -29,7 +28,7 @@ Ext.define('PBS.Application', { PBS.view = view; me.view = view; - if (me.currentView != undefined) { + if (me.currentView !== undefined) { me.currentView.destroy(); } @@ -58,7 +57,7 @@ Ext.define('PBS.Application', { } else { me.changeView('mainview', true); } - } + }, }); Ext.application('PBS.Application'); diff --git a/www/DataStorePrune.js b/www/DataStorePrune.js index 18ced062..7475aa9e 100644 --- a/www/DataStorePrune.js +++ b/www/DataStorePrune.js @@ -6,9 +6,9 @@ Ext.define('pbs-prune-list', { { name: 'backup-time', type: 'date', - dateFormat: 'timestamp' + dateFormat: 'timestamp', }, - ] + ], }); Ext.define('PBS.DataStorePruneInputPanel', { @@ -52,21 +52,21 @@ Ext.define('PBS.DataStorePruneInputPanel', { method: "POST", params: params, callback: function() { - return; // for easy breakpoint setting + // for easy breakpoint setting }, - failure: function (response, opts) { + failure: function(response, opts) { Ext.Msg.alert(gettext('Error'), response.htmlStatus); }, success: function(response, options) { var data = response.result.data; view.prune_store.setData(data); - } + }, }); }, control: { - field: { change: 'reload' } - } + field: { change: 'reload' }, + }, }, column1: [ @@ -111,16 +111,16 @@ Ext.define('PBS.DataStorePruneInputPanel', { allowBlank: true, fieldLabel: gettext('keep-yearly'), minValue: 1, - } + }, ], - initComponent : function() { + initComponent: function() { var me = this; me.prune_store = Ext.create('Ext.data.Store', { model: 'pbs-prune-list', - sorters: { property: 'backup-time', direction: 'DESC' } + sorters: { property: 'backup-time', direction: 'DESC' }, }); me.column2 = [ @@ -145,14 +145,14 @@ Ext.define('PBS.DataStorePruneInputPanel', { }, { text: "keep", - dataIndex: 'keep' - } - ] - } + dataIndex: 'keep', + }, + ], + }, ]; me.callParent(); - } + }, }); Ext.define('PBS.DataStorePrune', { @@ -163,7 +163,7 @@ Ext.define('PBS.DataStorePrune', { isCreate: true, - initComponent : function() { + initComponent: function() { var me = this; if (!me.datastore) { @@ -183,10 +183,10 @@ Ext.define('PBS.DataStorePrune', { xtype: 'pbsDataStorePruneInputPanel', url: '/api2/extjs/admin/datastore/' + me.datastore + "/prune", backup_type: me.backup_type, - backup_id: me.backup_id - }] + backup_id: me.backup_id, + }], }); me.callParent(); - } + }, }); diff --git a/www/DataStoreStatistic.js b/www/DataStoreStatistic.js index a3b8b4c0..c22640e4 100644 --- a/www/DataStoreStatistic.js +++ b/www/DataStoreStatistic.js @@ -19,10 +19,10 @@ Ext.define('pve-rrd-datastore', { return 0; } return (data.io_ticks*1000.0)/ios; - } + }, }, - { type: 'date', dateFormat: 'timestamp', name: 'time' } - ] + { type: 'date', dateFormat: 'timestamp', name: 'time' }, + ], }); Ext.define('PBS.DataStoreStatistic', { @@ -40,11 +40,11 @@ Ext.define('PBS.DataStoreStatistic', { throw "no datastore specified"; } - me.tbar = [ '->', { xtype: 'proxmoxRRDTypeSelector' } ]; + me.tbar = ['->', { xtype: 'proxmoxRRDTypeSelector' }]; var rrdstore = Ext.create('Proxmox.data.RRDStore', { rrdurl: "/api2/json/admin/datastore/" + me.datastore + "/rrd", - model: 'pve-rrd-datastore' + model: 'pve-rrd-datastore', }); me.items = { @@ -55,38 +55,38 @@ Ext.define('PBS.DataStoreStatistic', { defaults: { minHeight: 320, padding: 5, - columnWidth: 1 + columnWidth: 1, }, items: [ { xtype: 'proxmoxRRDChart', title: gettext('Storage usage (bytes)'), - fields: ['total','used'], + fields: ['total', 'used'], fieldTitles: [gettext('Total'), gettext('Storage usage')], - store: rrdstore + store: rrdstore, }, { xtype: 'proxmoxRRDChart', title: gettext('Transfer Rate (bytes/second)'), - fields: ['read_bytes','write_bytes'], + fields: ['read_bytes', 'write_bytes'], fieldTitles: [gettext('Read'), gettext('Write')], - store: rrdstore + store: rrdstore, }, { xtype: 'proxmoxRRDChart', title: gettext('Input/Output Operations per Second (IOPS)'), - fields: ['read_ios','write_ios'], + fields: ['read_ios', 'write_ios'], fieldTitles: [gettext('Read'), gettext('Write')], - store: rrdstore + store: rrdstore, }, { xtype: 'proxmoxRRDChart', title: gettext('IO Delay (ms)'), fields: ['io_delay'], fieldTitles: [gettext('IO Delay')], - store: rrdstore + store: rrdstore, }, - ] + ], }; me.listeners = { @@ -99,6 +99,6 @@ Ext.define('PBS.DataStoreStatistic', { }; me.callParent(); - } + }, }); diff --git a/www/NavigationTree.js b/www/NavigationTree.js index 0fd9458d..3fa782e1 100644 --- a/www/NavigationTree.js +++ b/www/NavigationTree.js @@ -10,7 +10,7 @@ Ext.define('PBS.store.NavigationStore', { text: gettext('Dashboard'), iconCls: 'fa fa-tachometer', path: 'pbsDashboard', - leaf: true + leaf: true, }, { text: gettext('Configuration'), @@ -22,13 +22,13 @@ Ext.define('PBS.store.NavigationStore', { text: gettext('User Management'), iconCls: 'fa fa-user', path: 'pbsUserView', - leaf: true + leaf: true, }, { text: gettext('Permissions'), iconCls: 'fa fa-unlock', path: 'pbsACLView', - leaf: true + leaf: true, }, { text: gettext('Remotes'), @@ -46,9 +46,9 @@ Ext.define('PBS.store.NavigationStore', { text: gettext('Subscription'), iconCls: 'fa fa-support', path: 'pbsSubscription', - leaf: true - } - ] + leaf: true, + }, + ], }, { text: gettext('Administration'), @@ -75,19 +75,19 @@ Ext.define('PBS.store.NavigationStore', { path: 'pbsZFSList', leaf: true, }, - ] - } - ] + ], + }, + ], }, { text: gettext('Datastore'), iconCls: 'fa fa-archive', path: 'pbsDataStoreConfig', expanded: true, - leaf: false + leaf: false, }, - ] - } + ], + }, }); Ext.define('PBS.view.main.NavigationTree', { @@ -98,13 +98,12 @@ Ext.define('PBS.view.main.NavigationTree', { xclass: 'Ext.app.ViewController', init: function(view) { - view.rstore = Ext.create('Proxmox.data.UpdateStore', { autoStart: true, interval: 15 * 1000, storeId: 'pbs-datastore-list', storeid: 'pbs-datastore-list', - model: 'pbs-datastore-list' + model: 'pbs-datastore-list', }); view.rstore.on('load', this.onLoad, this); @@ -119,7 +118,7 @@ Ext.define('PBS.view.main.NavigationTree', { // FIXME: newly added always get appended to the end.. records.sort((a, b) => { - if (a.id > b.id) return 1; + if (a.id > b.id) return 1; if (a.id < b.id) return -1; return 0; }); @@ -128,29 +127,28 @@ Ext.define('PBS.view.main.NavigationTree', { var length = records.length; var lookup_hash = {}; for (var i = 0; i < length; i++) { - var name = records[i].id; + let name = records[i].id; lookup_hash[name] = true; if (!list.findChild('text', name, false)) { list.appendChild({ text: name, path: `DataStore-${name}`, iconCls: 'fa fa-database', - leaf: true + leaf: true, }); } } var erase_list = []; list.eachChild(function(node) { - var name = node.data.text; + let name = node.data.text; if (!lookup_hash[name]) { erase_list.push(node); } }); Ext.Array.forEach(erase_list, function(node) { node.erase(); }); - - } + }, }, select: function(path) { @@ -163,5 +161,5 @@ Ext.define('PBS.view.main.NavigationTree', { expanderOnly: true, expanderFirst: false, store: 'NavigationStore', - ui: 'nav' + ui: 'nav', });