apt repositories: replace OfficialHost with Origin

to adapt to the new backend behavior.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
Fabian Ebner 2021-06-30 12:20:19 +02:00 committed by Thomas Lamprecht
parent e972890e69
commit d91987a558

View File

@ -3,7 +3,7 @@ Ext.define('apt-repolist', {
fields: [ fields: [
'Path', 'Path',
'Index', 'Index',
'OfficialHost', 'Origin',
'FileType', 'FileType',
'Enabled', 'Enabled',
'Comment', 'Comment',
@ -191,21 +191,9 @@ Ext.define('Proxmox.node.APTRepositoriesGrid', {
flex: 1, flex: 1,
}, },
{ {
header: gettext('Official'), header: gettext('Origin'),
dataIndex: 'OfficialHost', dataIndex: 'Origin',
renderer: function(value, cell, record) { width: 100,
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('Comment'), header: gettext('Comment'),
@ -218,7 +206,7 @@ Ext.define('Proxmox.node.APTRepositoriesGrid', {
let me = this; let me = this;
let warnings = {}; let warnings = {};
let officialHosts = {}; let origins = {};
let addLine = function(obj, key, line) { let addLine = function(obj, key, line) {
if (obj[key]) { if (obj[key]) {
@ -235,14 +223,14 @@ Ext.define('Proxmox.node.APTRepositoriesGrid', {
(info.kind === 'ignore-pre-upgrade-warning' && !me.majorUpgradeAllowed) (info.kind === 'ignore-pre-upgrade-warning' && !me.majorUpgradeAllowed)
) { ) {
addLine(warnings, key, gettext('Warning') + ": " + info.message); addLine(warnings, key, gettext('Warning') + ": " + info.message);
} else if (info.kind === 'badge' && info.message === 'official host name') { } else if (info.kind === 'origin') {
officialHosts[key] = true; origins[key] = info.message;
} }
} }
gridData.forEach(function(record) { gridData.forEach(function(record) {
const key = `${record.Path}:${record.Index}`; const key = `${record.Path}:${record.Index}`;
record.OfficialHost = !!officialHosts[key]; record.Origin = origins[key];
}); });
me.rowBodyFeature.getAdditionalData = function(innerData, rowIndex, record, orig) { me.rowBodyFeature.getAdditionalData = function(innerData, rowIndex, record, orig) {