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 9EE2AB3EB9 for ; Wed, 29 Nov 2023 16:50:23 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 832E7AB75 for ; Wed, 29 Nov 2023 16:49:53 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (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 for ; Wed, 29 Nov 2023 16:49:52 +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 B1D044104A for ; Wed, 29 Nov 2023 16:49:52 +0100 (CET) From: Dominik Csapak To: pbs-devel@lists.proxmox.com Date: Wed, 29 Nov 2023 16:49:51 +0100 Message-Id: <20231129154952.1708772-2-d.csapak@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20231129154952.1708772-1-d.csapak@proxmox.com> References: <20231129154952.1708772-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.018 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pbs-devel] [PATCH proxmox-backup v2 2/3] ui: add fingerprint also to the 'show connection information' window X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Nov 2023 15:50:23 -0000 by globally calling the 'status' api once and saving the fingerprint into the global Proxmox variable. since not all users might have that permission, ignore errors for that, and don't show the fingerprint in this case Signed-off-by: Dominik Csapak --- changes from v1: * adapt to changes in DatastoreRepoInfo www/MainView.js | 11 +++++++++++ www/window/DatastoreRepoInfo.js | 9 +++++++++ 2 files changed, 20 insertions(+) diff --git a/www/MainView.js b/www/MainView.js index d35162e4..4dbfe9bf 100644 --- a/www/MainView.js +++ b/www/MainView.js @@ -184,6 +184,17 @@ Ext.define('PBS.MainView', { interval: 15*60*1000, }); + Proxmox.Utils.API2Request({ + url: `/api2/extjs/nodes/localhost/status`, + success: function({ result }) { + if (result?.data?.info?.fingerprint) { + Proxmox.Fingerprint = result.data.info.fingerprint; + } + }, + failure: function() { + // silently ignore errors + }, + }); // select treeitem and load page from url fragment, if set let token = Ext.util.History.getToken() || 'pbsDashboard'; diff --git a/www/window/DatastoreRepoInfo.js b/www/window/DatastoreRepoInfo.js index a7080c27..b2d4f402 100644 --- a/www/window/DatastoreRepoInfo.js +++ b/www/window/DatastoreRepoInfo.js @@ -13,6 +13,7 @@ Ext.define('PBS.window.DatastoreRepoInfo', { cbindData: function() { let me = this; + let fingerprint = Proxmox.Fingerprint; let host = window.location.hostname; let hostname = host; if (window.location.port.toString() !== "8007") { @@ -26,6 +27,7 @@ Ext.define('PBS.window.DatastoreRepoInfo', { return { datastore, hostname, + fingerprint, repository, repositoryWithUser, }; @@ -49,6 +51,13 @@ Ext.define('PBS.window.DatastoreRepoInfo', { value: '{hostname}', }, }, + { + fieldLabel: gettext('Fingerprint'), + cbind: { + value: '{fingerprint}', + hidden: '{!fingerprint}', + }, + }, { xtype: 'displayfield', value: '', -- 2.30.2