]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
apt repositories: replace OfficialHost with Origin
authorFabian Ebner <f.ebner@proxmox.com>
Wed, 30 Jun 2021 10:20:19 +0000 (12:20 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 30 Jun 2021 11:41:21 +0000 (13:41 +0200)
to adapt to the new backend behavior.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
src/node/APTRepositories.js

index fb6edaf13c2bcef982223c1be0c0d104bafeb9be..6812d468842d7b00aef58928c395ac5e5073779c 100644 (file)
@@ -3,7 +3,7 @@ Ext.define('apt-repolist', {
     fields: [
        'Path',
        'Index',
-       'OfficialHost',
+       'Origin',
        'FileType',
        'Enabled',
        'Comment',
@@ -191,21 +191,9 @@ Ext.define('Proxmox.node.APTRepositoriesGrid', {
            flex: 1,
        },
        {
-           header: gettext('Official'),
-           dataIndex: 'OfficialHost',
-           renderer: function(value, cell, record) {
-               let icon = (cls) => `<i class="fa fa-fw ${cls}"></i>`;
-
-               if (value === undefined || value === null) {
-                   return icon('fa-question-circle-o');
-               }
-               const enabled = record.data.Enabled;
-               if (!value) {
-                   return icon('fa-question ' + (enabled ? 'warning' : 'faded'));
-               }
-               return icon('fa-check ' + (enabled ? 'good' : 'faded'));
-           },
-           width: 70,
+           header: gettext('Origin'),
+           dataIndex: 'Origin',
+           width: 100,
        },
        {
            header: gettext('Comment'),
@@ -218,7 +206,7 @@ Ext.define('Proxmox.node.APTRepositoriesGrid', {
        let me = this;
 
        let warnings = {};
-       let officialHosts = {};
+       let origins = {};
 
        let addLine = function(obj, key, line) {
            if (obj[key]) {
@@ -235,14 +223,14 @@ Ext.define('Proxmox.node.APTRepositoriesGrid', {
                (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;
+           } else if (info.kind === 'origin') {
+               origins[key] = info.message;
            }
        }
 
        gridData.forEach(function(record) {
            const key = `${record.Path}:${record.Index}`;
-           record.OfficialHost = !!officialHosts[key];
+           record.Origin = origins[key];
        });
 
        me.rowBodyFeature.getAdditionalData = function(innerData, rowIndex, record, orig) {