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 7A47CDDC3 for ; Fri, 22 Sep 2023 16:37:05 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 44D78BCB9 for ; Fri, 22 Sep 2023 16:37:05 +0200 (CEST) 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 ; Fri, 22 Sep 2023 16:37:04 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id CB2844884E for ; Fri, 22 Sep 2023 16:37:03 +0200 (CEST) From: Philipp Hufnagl To: pve-devel@lists.proxmox.com Date: Fri, 22 Sep 2023 16:36:57 +0200 Message-Id: <20230922143658.1639173-4-p.hufnagl@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230922143658.1639173-1-p.hufnagl@proxmox.com> References: <20230922143658.1639173-1-p.hufnagl@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.003 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 Subject: [pve-devel] [PATCH proxmox-widget-toolkit v1 1/2] fix #4546: css: Inform user administrator about user accounts expiring soon 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: Fri, 22 Sep 2023 14:37:05 -0000 Adds a new css class to underlay information urgency in table columns for dark and light mode. This underlay color then is used to notifiy user administrators about user accounts that will expire soon Signed-off-by: Philipp Hufnagl --- src/Utils.js | 6 +++++- src/css/ext6-pmx.css | 4 ++++ src/proxmox-dark/scss/abstracts/_variables.scss | 1 + src/proxmox-dark/scss/proxmox/_general.scss | 5 +++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Utils.js b/src/Utils.js index f269607..a7ded2a 100644 --- a/src/Utils.js +++ b/src/Utils.js @@ -174,10 +174,14 @@ utilities: { return value ? Proxmox.Utils.enabledText : Proxmox.Utils.disabledText; }, - format_expire: function(date) { + format_expire: function(date, meta) { if (!date) { return Proxmox.Utils.neverText; } + let expieWariningThreshold = Ext.Date.add(new Date(), Ext.Date.DAY, 7); + if (expieWariningThreshold >= date) { + meta.tdCls += 'proxmox-hint-row'; + } return Ext.Date.format(date, "Y-m-d"); }, diff --git a/src/css/ext6-pmx.css b/src/css/ext6-pmx.css index 2ffd2a8..439f3a0 100644 --- a/src/css/ext6-pmx.css +++ b/src/css/ext6-pmx.css @@ -76,6 +76,10 @@ background-color: #f3d6d7; } +.proxmox-hint-row { + background-color: #5eb9ff; +} + .proxmox-warning-row { background-color: #f5e5d8; } diff --git a/src/proxmox-dark/scss/abstracts/_variables.scss b/src/proxmox-dark/scss/abstracts/_variables.scss index cac51eb..8bcae09 100644 --- a/src/proxmox-dark/scss/abstracts/_variables.scss +++ b/src/proxmox-dark/scss/abstracts/_variables.scss @@ -26,6 +26,7 @@ $background-darker: hsl(0deg, 0%, 15%); $background-darkest: hsl(0deg, 0%, 10%); $background-invalid: hsl(360deg, 60%, 20%); $background-warning: hsl(40deg, 100%, 20%); +$background-hint: hsl(233deg, 99%, 60%); // Buttons $neutral-button-color: hsl(0deg, 0%, 25%); diff --git a/src/proxmox-dark/scss/proxmox/_general.scss b/src/proxmox-dark/scss/proxmox/_general.scss index c319f6d..8b2a4d0 100644 --- a/src/proxmox-dark/scss/proxmox/_general.scss +++ b/src/proxmox-dark/scss/proxmox/_general.scss @@ -25,6 +25,11 @@ div[id^="versioninfo-"] + div[id^="panel-"] > div[id^="panel-"][id$="-bodyWrap"] background-color: $background-warning; } +// Info rows, e.g. when an user account expires soon +.proxmox-hint-row { + background-color: $background-hint; +} + // Disabled rows (e.g. disabled repos in Repository view) .proxmox-disabled-row td { color: $text-color-inactive; -- 2.39.2