From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: pmg-devel@lists.proxmox.com
Subject: [PATCH pmg-gui 4/5] login: show optional consent-banner before login
Date: Mon, 8 Jun 2026 08:56:22 +0200 [thread overview]
Message-ID: <20260608065653.624545-5-s.ivanov@proxmox.com> (raw)
In-Reply-To: <20260608065653.624545-1-s.ivanov@proxmox.com>
adapted from pve-manager commit:
2e42468a ("show optional consent-banner before login")
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
js/LoginView.js | 11 +++++++++++
js/SystemOptions.js | 7 +++++++
pmg-index.html.tt | 1 +
3 files changed, 19 insertions(+)
diff --git a/js/LoginView.js b/js/LoginView.js
index e897683..4651423 100644
--- a/js/LoginView.js
+++ b/js/LoginView.js
@@ -31,6 +31,17 @@ Ext.define('PMG.LoginView', {
me.lookup('quarantineButton').setVisible(!!Proxmox.QuarantineLink);
if (view.targetview !== 'quarantineview') {
+ if (Proxmox.ConsentText) {
+ let oidc_auth_redirect = Proxmox.Utils.getOpenIDRedirectionAuthorization();
+ if (oidc_auth_redirect === undefined) {
+ Ext.create('Proxmox.window.ConsentModal', {
+ autoShow: true,
+ consent: Proxmox.Markdown.parse(
+ Proxmox.Utils.base64ToUtf8(Proxmox.ConsentText),
+ ),
+ });
+ }
+ }
return;
}
diff --git a/js/SystemOptions.js b/js/SystemOptions.js
index 517eb71..5bf7127 100644
--- a/js/SystemOptions.js
+++ b/js/SystemOptions.js
@@ -93,6 +93,13 @@ Ext.define('PMG.SystemOptions', {
me.add_proxy_row('http_proxy', gettext('HTTP proxy'));
+ me.add_textareafield_row('consent-text', gettext('Consent Text'), {
+ deleteEmpty: true,
+ fieldOpts: {
+ maxLength: 64 * 1024,
+ },
+ });
+
me.callParent();
me.on('activate', me.rstore.startUpdate);
diff --git a/pmg-index.html.tt b/pmg-index.html.tt
index 10f9a2d..3e3c4b6 100644
--- a/pmg-index.html.tt
+++ b/pmg-index.html.tt
@@ -45,6 +45,7 @@
UserName: '[% username %]',
CSRFPreventionToken: '[% token %]',
QuarantineLink: [% IF quarantinelink %] true [% ELSE %] false [% END %],
+ ConsentText: '[% consenttext %]',
};
</script>
<script type="text/javascript" src="/proxmoxlib.js?ver=[% wtversion %]"></script>
--
2.47.3
next prev parent reply other threads:[~2026-06-08 6:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-08 6:56 [PATCH pmg-api/pmg-docs/pmg-gui 0/5] add optional consent-banner to be shown before login Stoiko Ivanov
2026-06-08 6:56 ` [PATCH pmg-docs 1/5] pmgconfig: add short documentation of the consent banner Stoiko Ivanov
2026-06-08 6:56 ` [PATCH pmg-api 2/5] config: add consent-text key Stoiko Ivanov
2026-06-08 6:56 ` [PATCH pmg-api 3/5] pmgproxy: pass consent-text as template variable to index Stoiko Ivanov
2026-06-08 6:56 ` Stoiko Ivanov [this message]
2026-06-08 6:56 ` [PATCH pmg-gui 5/5] system options: add online help link for consent banner Stoiko Ivanov
2026-06-08 7:19 ` [PATCH pmg-api/pmg-docs/pmg-gui 0/5] add optional consent-banner to be shown before login Dominik Csapak
2026-06-08 7:42 ` Stoiko Ivanov
2026-06-08 11:01 ` applied: " 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=20260608065653.624545-5-s.ivanov@proxmox.com \
--to=s.ivanov@proxmox.com \
--cc=pmg-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox