From: Thomas Ellmenreich <t.ellmenreich@proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Thomas Ellmenreich <t.ellmenreich@proxmox.com>
Subject: [PATCH manager v5 2/2] fix #5475: configurable window title
Date: Thu, 24 Sep 2026 11:52:51 +0200 [thread overview]
Message-ID: <20260924095251.143579-3-t.ellmenreich@proxmox.com> (raw)
In-Reply-To: <20260924095251.143579-1-t.ellmenreich@proxmox.com>
Added a new 'ui-settings' format string to the datacenter.cfg which now
has a 'title' option to configure the browser tab title for pve tabs.
Adjusted the index.html templating to construct the correct window title
on every request according to the cluster configuration.
Signed-off-by: Thomas Ellmenreich <t.ellmenreich@proxmox.com>
---
PVE/Service/pveproxy.pm | 35 ++++++++++++++++++++
www/index.html.tpl | 2 +-
www/manager6/UIOptions.js | 6 ++++
www/manager6/dc/OptionView.js | 61 +++++++++++++++++++++++++++++++++++
4 files changed, 103 insertions(+), 1 deletion(-)
diff --git a/PVE/Service/pveproxy.pm b/PVE/Service/pveproxy.pm
index dfdd014c..cb745929 100755
--- a/PVE/Service/pveproxy.pm
+++ b/PVE/Service/pveproxy.pm
@@ -202,6 +202,38 @@ my sub get_path_mtime {
return $mtime;
}
+my $FQDN_CACHE = (
+ timestamp => undef,
+ fqdn => undef,
+);
+
+my sub get_window_title_prefix {
+ my ($title_enum, $nodename) = @_;
+
+ if (!defined($title_enum)) {
+ return;
+ }
+
+ return eval {
+ if ($title_enum eq "node-and-cluster") {
+ my $clinfo = PVE::Cluster::get_clinfo();
+ my $clustername = $clinfo->{cluster}->{name};
+
+ return "$nodename - $clustername" if $clustername;
+ } elsif ($title_enum eq "fqdn") {
+ my $now = time();
+ if (!$FQDN_CACHE->{timestamp} || $now - $FQDN_CACHE->{timestamp} >= 24 * 60 * 60) {
+ $FQDN_CACHE->{timestamp} = $now;
+ $FQDN_CACHE->{fqdn} = PVE::Tools::get_fqdn($nodename);
+ }
+
+ return $FQDN_CACHE->{fqdn};
+ }
+ };
+
+ die "failed to create '$title_enum' window title: $@" if $@;
+}
+
# NOTE: Requests to those pages are not authenticated so we must be very careful here
sub get_index {
my ($nodename, $server, $r, $args) = @_;
@@ -232,10 +264,12 @@ sub get_index {
}
}
+ my $window_title_prefix;
my $consent_text;
eval {
my $dc_conf = PVE::Cluster::cfs_read_file('datacenter.cfg');
$consent_text = $dc_conf->{'consent-text'};
+ $window_title_prefix = get_window_title_prefix($dc_conf->{'ui-settings'}->{'title'}, $nodename);
if (!$lang) {
$lang = $dc_conf->{language} // 'en';
@@ -277,6 +311,7 @@ sub get_index {
console => $args->{console},
nodename => $nodename,
arch => PVE::Tools::get_host_dpkg_arch(),
+ window_title => ($window_title_prefix // "$nodename") . " - Proxmox Virtual Environment",
debug => $debug,
version => "$version",
wtversion => $wtversion,
diff --git a/www/index.html.tpl b/www/index.html.tpl
index c18e6411..a45bad39 100644
--- a/www/index.html.tpl
+++ b/www/index.html.tpl
@@ -4,7 +4,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
- <title>[% nodename %] - Proxmox Virtual Environment</title>
+ <title>[% window_title %]</title>
<link rel="icon" sizes="128x128" href="/pve2/images/logo-128.png" />
<link rel="apple-touch-icon" sizes="128x128" href="/pve2/images/logo-128.png" />
<link rel="stylesheet" type="text/css" href="/pve2/ext6/theme-crisp/resources/theme-crisp-all.css?ver=7.0.0" />
diff --git a/www/manager6/UIOptions.js b/www/manager6/UIOptions.js
index 8c4674af..e94a75df 100644
--- a/www/manager6/UIOptions.js
+++ b/www/manager6/UIOptions.js
@@ -90,6 +90,12 @@ Ext.define('PVE.UIOptions', {
alphabetical: gettext('Alphabetical'),
},
+ titleOptions: {
+ __default__: gettext('Node Name (Default)'),
+ 'node-and-cluster': gettext('Node and Cluster Name'),
+ fqdn: gettext('Fully Qualified Domain Name (FQDN)'),
+ },
+
shouldSortTags: function () {
return !(PVE.UIOptions.options['tag-style']?.ordering === 'config');
},
diff --git a/www/manager6/dc/OptionView.js b/www/manager6/dc/OptionView.js
index dc12aa7e..c63e0baa 100644
--- a/www/manager6/dc/OptionView.js
+++ b/www/manager6/dc/OptionView.js
@@ -91,6 +91,67 @@ Ext.define('PVE.dc.OptionView', {
defaultValue: '__default__',
deleteEmpty: true,
});
+ me.rows['ui-settings'] = {
+ required: true,
+ renderer: (value) => {
+ if (value === undefined) {
+ return gettext('No Overrides');
+ }
+ let txt = '';
+ if (value.title) {
+ txt += Ext.String.format(gettext('Title: {0}'), PVE.UIOptions.titleOptions[value.title]);
+ }
+ return txt;
+ },
+ header: gettext('UI Settings'),
+ editor: {
+ xtype: 'proxmoxWindowEdit',
+ width: 800,
+ subject: gettext('UI Settings'),
+ fieldDefaults: {
+ labelWidth: 100,
+ },
+ url: '/api2/extjs/cluster/options',
+ items: [
+ {
+ xtype: 'inputpanel',
+ setValues: function (values) {
+ if (values === undefined) {
+ return undefined;
+ }
+ values = values?.['ui-settings'] ?? {};
+ values.title = values.title || '__default__';
+ return Proxmox.panel.InputPanel.prototype.setValues.call(this, values);
+ },
+ onGetValues: function (values) {
+ let style = {};
+ if (values.title) {
+ style.title = values.title;
+ }
+ let value = PVE.Parser.printPropertyString(style);
+ if (value === '') {
+ return {
+ delete: 'ui-settings',
+ };
+ }
+ return {
+ 'ui-settings': value,
+ };
+ },
+ items: [
+ {
+ xtype: 'proxmoxKVComboBox',
+ name: 'title',
+ fieldLabel: gettext('Title'),
+ comboItems: Object.entries(PVE.UIOptions.titleOptions),
+ deleteEmpty: true,
+ defaultValue: '__default__',
+ },
+ ],
+ },
+ ],
+ },
+ };
me.add_text_row('email_from', gettext('Email from address'), {
deleteEmpty: true,
vtype: 'proxmoxMail',
--
2.47.3
next prev parent reply other threads:[~2026-09-24 9:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-24 9:52 [PATCH cluster/manager v5 0/2] Configurable window titles for nodes Thomas Ellmenreich
2026-09-24 9:52 ` [PATCH cluster v5 1/2] fix #5475: configurable window title Thomas Ellmenreich
2026-09-24 12:01 ` Arthur Bied-Charreton
2026-09-24 9:52 ` Thomas Ellmenreich [this message]
2026-09-24 12:00 ` [PATCH manager v5 2/2] " Arthur Bied-Charreton
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=20260924095251.143579-3-t.ellmenreich@proxmox.com \
--to=t.ellmenreich@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.