all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH proxmox-widget-toolkit 1/1] apt repositories: replace OfficialHost with Origin
Date: Wed, 30 Jun 2021 12:20:19 +0200	[thread overview]
Message-ID: <20210630102019.39057-5-f.ebner@proxmox.com> (raw)
In-Reply-To: <20210630102019.39057-1-f.ebner@proxmox.com>

to adapt to the new backend behavior.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
 src/node/APTRepositories.js | 28 ++++++++--------------------
 1 file changed, 8 insertions(+), 20 deletions(-)

diff --git a/src/node/APTRepositories.js b/src/node/APTRepositories.js
index fb6edaf..6812d46 100644
--- a/src/node/APTRepositories.js
+++ b/src/node/APTRepositories.js
@@ -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) {
-- 
2.30.2





  parent reply	other threads:[~2021-06-30 10:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-30 10:20 [pve-devel] [PATCH-SERIES proxmox-apt/proxmox-widget-toolkit] APT repos: Use Origin property instead of "official host" Fabian Ebner
2021-06-30 10:20 ` [pve-devel] [PATCH proxmox-apt 1/3] add get_cached_origin method and an initial config module Fabian Ebner
2021-06-30 10:20 ` [pve-devel] [PATCH proxmox-apt 2/3] check: return 'origin' property instead of 'badge' for official host Fabian Ebner
2021-06-30 10:20 ` [pve-devel] [PATCH proxmox-apt 3/3] standard repos: drop product acronym from repo name Fabian Ebner
2021-06-30 10:20 ` Fabian Ebner [this message]
2021-06-30 11:42 ` [pve-devel] applied-series: [PATCH-SERIES proxmox-apt/proxmox-widget-toolkit] APT repos: Use Origin property instead of "official host" Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210630102019.39057-5-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal