]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
apt repos: code/format cleanups
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 23 Jun 2021 17:00:57 +0000 (19:00 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 23 Jun 2021 17:01:24 +0000 (19:01 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/node/APTRepositories.js

index 2121a0f91b6238e0f550b7a62591c0cb1f595dfa..5a9e08af6558c4a11b5993072aa24430929fae1f 100644 (file)
@@ -33,10 +33,7 @@ Ext.define('Proxmox.node.APTRepositoriesErrors', {
        {
            header: gettext('File'),
            dataIndex: 'path',
-           renderer: function(value, cell, record) {
-               return "<i class='pve-grid-fa fa fa-fw " +
-                   "fa-exclamation-triangle'></i>" + value;
-           },
+           renderer: value => `<i class='pve-grid-fa fa fa-fw fa-exclamation-triangle'></i>${value}`,
            width: 350,
        },
        {
@@ -49,7 +46,6 @@ Ext.define('Proxmox.node.APTRepositoriesErrors', {
 
 Ext.define('Proxmox.node.APTRepositoriesGrid', {
     extend: 'Ext.grid.GridPanel',
-
     xtype: 'proxmoxNodeAPTRepositoriesGrid',
 
     title: gettext('APT Repositories'),
@@ -71,6 +67,7 @@ Ext.define('Proxmox.node.APTRepositoriesGrid', {
                items: [],
            },
        },
+       '-',
        {
            xtype: 'proxmoxButton',
            text: gettext('Enable') + '/' + gettext('Disable'),
@@ -216,7 +213,8 @@ Ext.define('Proxmox.node.APTRepositoriesGrid', {
        for (const info of infos) {
            const key = `${info.path}:${info.index}`;
            if (info.kind === 'warning' ||
-               (info.kind === 'ignore-pre-upgrade-warning' && !me.majorUpgradeAllowed)) {
+               (info.kind === 'ignore-pre-upgrade-warning' && !me.majorUpgradeAllowed)
+           ) {
                addLine(warnings, key, gettext('Warning') + ": " + info.message);
            } else if (info.kind === 'badge' && info.message === 'official host name') {
                officialHosts[key] = true;
@@ -285,7 +283,6 @@ Ext.define('Proxmox.node.APTRepositoriesGrid', {
 
 Ext.define('Proxmox.node.APTRepositories', {
     extend: 'Ext.panel.Panel',
-
     xtype: 'proxmoxNodeAPTRepositories',
     mixins: ['Proxmox.Mixin.CBind'],
 
@@ -364,13 +361,10 @@ Ext.define('Proxmox.node.APTRepositories', {
        Proxmox.Utils.API2Request({
            url: `/nodes/${me.nodename}/subscription`,
            method: 'GET',
-           failure: function(response, opts) {
-               Ext.Msg.alert(gettext('Error'), response.htmlStatus);
-           },
+           failure: (response, opts) => Ext.Msg.alert(gettext('Error'), response.htmlStatus),
            success: function(response, opts) {
                const res = response.result;
-               const subscription = !(res === null || res === undefined ||
-                   !res || res.data.status.toLowerCase() !== 'active');
+               const subscription = !(!res || !res.data || res.data.status.toLowerCase() !== 'active');
                vm.set('subscriptionActive', subscription);
            },
        });