From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 7E4BD69BBC for ; Wed, 20 Jan 2021 11:01:57 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 78D562558C for ; Wed, 20 Jan 2021 11:01:57 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 74D4D25562 for ; Wed, 20 Jan 2021 11:01:55 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 486E2447A0 for ; Wed, 20 Jan 2021 11:01:55 +0100 (CET) From: Fabian Ebner To: pve-devel@lists.proxmox.com Date: Wed, 20 Jan 2021 11:01:43 +0100 Message-Id: <20210120100143.16268-8-f.ebner@proxmox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210120100143.16268-1-f.ebner@proxmox.com> References: <20210120100143.16268-1-f.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.007 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [RFC widget-toolkit 7/7] APT repositories: show list of warnings X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2021 10:01:57 -0000 Signed-off-by: Fabian Ebner --- src/node/APTRepositories.js | 88 +++++++++++++++++++++++++++++++++++-- 1 file changed, 85 insertions(+), 3 deletions(-) diff --git a/src/node/APTRepositories.js b/src/node/APTRepositories.js index 5982306..2c46af5 100644 --- a/src/node/APTRepositories.js +++ b/src/node/APTRepositories.js @@ -1,3 +1,25 @@ +Ext.define('Proxmox.node.APTRepositories', { + extend: 'Ext.container.Container', + xtype: 'proxmoxNodeAPTRepositories', + + mixins: ['Proxmox.Mixin.CBind'], + + items: [ + { + xtype: 'proxmoxNodeAPTRepositoriesMain', + cbind: { + nodename: '{nodename}', + }, + }, + { + xtype: 'proxmoxNodeAPTRepositoriesWarnings', + cbind: { + nodename: '{nodename}', + }, + }, + ], +}); + Ext.define('apt-repolist', { extend: 'Ext.data.Model', fields: [ @@ -27,10 +49,9 @@ Ext.define('apt-repolist', { ], }); -Ext.define('Proxmox.node.APTRepositories', { +Ext.define('Proxmox.node.APTRepositoriesMain', { extend: 'Ext.grid.GridPanel', - - xtype: 'proxmoxNodeAPTRepositories', + xtype: 'proxmoxNodeAPTRepositoriesMain', sortableColumns: false, @@ -129,3 +150,64 @@ Ext.define('Proxmox.node.APTRepositories', { me.callParent(); }, }); + +Ext.define('apt-repolist-warnings', { + extend: 'Ext.data.Model', + fields: [ + { + name: "location", + convert: function(value, record) { + let path = record.data.path; + if (value || !path) { + return value; + } + let number = record.data.number || ''; + return path + ':' + number; + }, + }, + 'message', + ], +}); + +Ext.define('Proxmox.node.APTRepositoriesWarnings', { + extend: 'Ext.grid.GridPanel', + xtype: 'proxmoxNodeAPTRepositoriesWarnings', + + columns: [ + { + header: "Warning", + dataIndex: "message", + flex: 1, + }, + { + header: "Location", + dataIndex: "location", + flex: 1, + }, + ], + + initComponent: function() { + let me = this; + + if (!me.nodename) { + throw "no node name specified"; + } + + let store = Ext.create('Ext.data.Store', { + model: 'apt-repolist-warnings', + proxy: { + type: 'proxmox', + url: "/api2/json/nodes/" + me.nodename + "/apt/repositoriescheck", + }, + }); + + Ext.apply(me, { + store: store, + }); + + Proxmox.Utils.monStoreErrors(me, store, true); + store.load(); + + me.callParent(); + }, +}); -- 2.20.1