]> git.proxmox.com Git - proxmox-backup.git/commitdiff
ui: some more eslint auto-fixes
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 25 Sep 2020 16:36:58 +0000 (18:36 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 25 Sep 2020 16:36:58 +0000 (18:36 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/Application.js
www/DataStorePrune.js
www/DataStoreStatistic.js
www/NavigationTree.js

index 71d929429bd8d73ac248a4401c1d383325dcc0c9..88f7f8ce43278065b4ad622b43d0afe306e2dfa7 100644 (file)
@@ -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');
index 18ced062bf8c8f767db4e20de9e162e847233fb6..7475aa9efc4597e56c13665a5cdc3399073e8f71 100644 (file)
@@ -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();
-    }
+    },
 });
index a3b8b4c05aaccc03d44b7dd28812ed1e35aecd0c..c22640e432ceab68665c290c472fb1107d6dcb94 100644 (file)
@@ -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();
-    }
+    },
 
 });
index 0fd9458de4df3816de0150e4370776fbe414b892..3fa782e119d29ea9b17a72a98db2608e6f4f01ad 100644 (file)
@@ -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',
 });