]> git.proxmox.com Git - proxmox-backup.git/commitdiff
ui: code cleanup
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 27 Oct 2020 11:27:38 +0000 (12:27 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 27 Oct 2020 12:13:00 +0000 (13:13 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/Subscription.js

index 9982c62c4df766889a90ff7d6b43bd8dc0e41da2..64f471232c52b40a43fbede1ebb55664d4b288dd 100644 (file)
@@ -20,7 +20,6 @@ Ext.define('PBS.Subscription', {
     xtype: 'pbsSubscription',
 
     title: gettext('Subscription'),
-
     border: true,
 
     onlineHelp: 'getting_help',
@@ -30,24 +29,12 @@ Ext.define('PBS.Subscription', {
     },
 
     initComponent: function() {
-       var me = this;
-
-       var reload = function() {
-           me.rstore.load();
-       };
-
-       var baseurl = '/nodes/localhost/subscription';
+       let me = this;
 
-       var render_status = function(value) {
-           var message = me.getObjectValue('message');
+       let reload = () => me.rstore.load();
+       let baseurl = '/nodes/localhost/subscription';
 
-           if (message) {
-               return value + ": " + message;
-           }
-           return value;
-       };
-
-       var rows = {
+       let rows = {
            productname: {
                header: gettext('Type'),
            },
@@ -56,7 +43,14 @@ Ext.define('PBS.Subscription', {
            },
            status: {
                header: gettext('Status'),
-               renderer: render_status,
+               renderer: (value) => {
+                   value = Ext.String.capitalize(value);
+                   let message = me.getObjectValue('message');
+                   if (message) {
+                       return value + ": " + message;
+                   }
+                   return value;
+               },
            },
            message: {
                visible: false,
@@ -64,9 +58,6 @@ Ext.define('PBS.Subscription', {
            serverid: {
                header: gettext('Server ID'),
            },
-           sockets: {
-               header: gettext('Sockets'),
-           },
            checktime: {
                header: gettext('Last checked'),
                renderer: Proxmox.Utils.render_timestamp,
@@ -77,13 +68,13 @@ Ext.define('PBS.Subscription', {
        };
 
        Ext.apply(me, {
-           url: '/api2/json' + baseurl,
+           url: `/api2/json${baseurl}`,
            cwidth1: 170,
            tbar: [
                {
                    text: gettext('Upload Subscription Key'),
                    handler: function() {
-                       var win = Ext.create('PBS.SubscriptionKeyEdit', {
+                       let win = Ext.create('PBS.SubscriptionKeyEdit', {
                            url: '/api2/extjs/' + baseurl,
                        });
                        win.show();