* [PATCH cluster/manager/proxmox{,-backup}/widget-toolkit 0/8] add location property to node/datacenter config for PVE/PBS
@ 2026-05-08 8:40 Dominik Csapak
2026-05-08 8:40 ` [PATCH cluster 1/1] datacenter config: add location property Dominik Csapak
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: Dominik Csapak @ 2026-05-08 8:40 UTC (permalink / raw)
To: pve-devel, pbs-devel
This is in preparation of the next version of my 'world map' feature for
PDM[0]. Since we want to have the location saved on PVE/PBS side, I'm sending
this now already while I'm working on changing the PDM side
I't currently very simple, just property string config in pve/pbs datacenter
and node-config. The second patch in widget-toolkit makes it somewhat useful
for others too by providing a link to openstreetmap. (Not sure if we want to
include such things, thus it's a separate patch)
0: https://lore.proxmox.com/pdm-devel/20260505073203.398548-1-d.csapak@proxmox.com/T/#t
pve-cluster:
Dominik Csapak (1):
datacenter config: add location property
src/PVE/DataCenterConfig.pm | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
proxmox-widget-toolkti:
Dominik Csapak (2):
add window and renderer for locations
utils: render location: add a link to that location on openstreetmap
src/Makefile | 1 +
src/Utils.js | 13 +++++++++
src/window/LocationEdit.js | 57 ++++++++++++++++++++++++++++++++++++++
3 files changed, 71 insertions(+)
create mode 100644 src/window/LocationEdit.js
pve-manager:
Dominik Csapak (2):
node config: add location property
ui: add location to datacenter and node options
PVE/NodeConfig.pm | 30 ++++++++++++++++++++++++++++
www/manager6/dc/OptionView.js | 9 +++++++++
www/manager6/node/NodeOptionsView.js | 16 +++++++++++++++
3 files changed, 55 insertions(+)
proxmox:
Dominik Csapak (1):
pbs-api-types: node config: add location property
pbs-api-types/src/node.rs | 46 ++++++++++++++++++++++++++++++++++++++-
1 file changed, 45 insertions(+), 1 deletion(-)
proxmox-backup:
Dominik Csapak (2):
api: node: config: add location property
ui: node options: add location property
src/api2/node/config.rs | 8 ++++++++
www/config/NodeOptionView.js | 11 +++++++++++
2 files changed, 19 insertions(+)
Summary over all repositories:
10 files changed, 218 insertions(+), 1 deletions(-)
--
Generated by git-murpp 0.8.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH cluster 1/1] datacenter config: add location property
2026-05-08 8:40 [PATCH cluster/manager/proxmox{,-backup}/widget-toolkit 0/8] add location property to node/datacenter config for PVE/PBS Dominik Csapak
@ 2026-05-08 8:40 ` Dominik Csapak
2026-05-08 8:40 ` [PATCH widget-toolkit 1/2] add window and renderer for locations Dominik Csapak
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Dominik Csapak @ 2026-05-08 8:40 UTC (permalink / raw)
To: pve-devel, pbs-devel
consisting of an optional name and a set of coordinates.
This can be used by management systems (such as PDM) to query and
display the location of a cluster, e.g. on a world map.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
src/PVE/DataCenterConfig.pm | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/src/PVE/DataCenterConfig.pm b/src/PVE/DataCenterConfig.pm
index 6513594..e7fb31a 100644
--- a/src/PVE/DataCenterConfig.pm
+++ b/src/PVE/DataCenterConfig.pm
@@ -343,6 +343,28 @@ my $user_tag_privs_format = {
},
};
+my $location_format = {
+ name => {
+ type => 'string',
+ description => 'The name of the location of this node',
+ typetext => '<name>',
+ optional => 1,
+ maxLength => 128,
+ },
+ latitude => {
+ type => 'number',
+ description => "The latitude of the nodes location in degrees.",
+ minimum => -90,
+ maximum => 90,
+ },
+ longitude => {
+ type => 'number',
+ description => "The longitude of the nodes location in degrees.",
+ minimum => -180,
+ maximum => 180,
+ },
+};
+
my $datacenter_schema = {
type => "object",
additionalProperties => 0,
@@ -544,6 +566,12 @@ my $datacenter_schema = {
maxLength => 64 * 1024,
description => "Consent text that is displayed before logging in.",
},
+ location => {
+ type => 'string',
+ format => $location_format,
+ description => "The location of the cluster.",
+ optional => 1,
+ },
},
};
--
2.47.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH widget-toolkit 1/2] add window and renderer for locations
2026-05-08 8:40 [PATCH cluster/manager/proxmox{,-backup}/widget-toolkit 0/8] add location property to node/datacenter config for PVE/PBS Dominik Csapak
2026-05-08 8:40 ` [PATCH cluster 1/1] datacenter config: add location property Dominik Csapak
@ 2026-05-08 8:40 ` Dominik Csapak
2026-05-08 8:40 ` [RFC PATCH widget-toolkit 2/2] utils: render location: add a link to that location on openstreetmap Dominik Csapak
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Dominik Csapak @ 2026-05-08 8:40 UTC (permalink / raw)
To: pve-devel, pbs-devel
PVE and PBS gained a location property (per node and datacenter) which
is a propertystring containing of a name and coordinates.
Add a window to edit and a renderer for that.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
src/Makefile | 1 +
src/Utils.js | 12 ++++++++
src/window/LocationEdit.js | 57 ++++++++++++++++++++++++++++++++++++++
3 files changed, 70 insertions(+)
create mode 100644 src/window/LocationEdit.js
diff --git a/src/Makefile b/src/Makefile
index 74ea4ab..9c52339 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -110,6 +110,7 @@ JSSRC= \
window/AddYubico.js \
window/TfaEdit.js \
window/NotesEdit.js \
+ window/LocationEdit.js \
window/ThemeEdit.js \
window/SyncWindow.js \
node/APT.js \
diff --git a/src/Utils.js b/src/Utils.js
index 5457ffa..390a302 100644
--- a/src/Utils.js
+++ b/src/Utils.js
@@ -1571,6 +1571,18 @@ Ext.define('Proxmox.Utils', {
}
hiddenElement.click();
},
+
+ renderLocation: function (value) {
+ if (!value) {
+ return Proxmox.Utils.NoneText;
+ }
+ let location = Proxmox.Utils.parsePropertyString(value);
+ let degrees = `${location.latitude} °, ${location.longitude} °`;
+ if (location.name) {
+ return `${location.name} (${degrees})`;
+ }
+ return degrees;
+ },
},
singleton: true,
diff --git a/src/window/LocationEdit.js b/src/window/LocationEdit.js
new file mode 100644
index 0000000..f7b6c6d
--- /dev/null
+++ b/src/window/LocationEdit.js
@@ -0,0 +1,57 @@
+Ext.define('Proxmox.window.LocationEdit', {
+ extend: 'Proxmox.window.Edit',
+ alias: 'widget.pmxLocationEditWindow',
+
+ title: gettext('Location'),
+
+ autoLoad: true,
+
+ items: [
+ {
+ xtype: 'inputpanel',
+ onGetValues: function (values) {
+ let propertyString = Proxmox.Utils.printPropertyString(values);
+ if (!propertyString) {
+ return { delete: 'location' };
+ } else {
+ return {
+ location: propertyString,
+ };
+ }
+ },
+
+ onSetValues: function (value) {
+ if (value.location) {
+ return Proxmox.Utils.parsePropertyString(value.location);
+ }
+ return {};
+ },
+
+ items: [
+ {
+ xtype: 'proxmoxtextfield',
+ fieldLabel: gettext('Name'),
+ allowBlank: true,
+ emptyText: gettext('Optional'),
+ name: 'name',
+ },
+ {
+ xtype: 'numberfield',
+ minimum: -90.0,
+ maximum: 90.0,
+ name: 'latitude',
+ decimalPrecision: 6,
+ fieldLabel: gettext('Latitude'),
+ },
+ {
+ xtype: 'numberfield',
+ minimum: -180.0,
+ maximum: 180.0,
+ name: 'longitude',
+ decimalPrecision: 6,
+ fieldLabel: gettext('Longitude'),
+ },
+ ],
+ },
+ ],
+});
--
2.47.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [RFC PATCH widget-toolkit 2/2] utils: render location: add a link to that location on openstreetmap
2026-05-08 8:40 [PATCH cluster/manager/proxmox{,-backup}/widget-toolkit 0/8] add location property to node/datacenter config for PVE/PBS Dominik Csapak
2026-05-08 8:40 ` [PATCH cluster 1/1] datacenter config: add location property Dominik Csapak
2026-05-08 8:40 ` [PATCH widget-toolkit 1/2] add window and renderer for locations Dominik Csapak
@ 2026-05-08 8:40 ` Dominik Csapak
2026-05-08 8:40 ` [PATCH manager 1/2] node config: add location property Dominik Csapak
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Dominik Csapak @ 2026-05-08 8:40 UTC (permalink / raw)
To: pve-devel, pbs-devel
since that can have the coordinates in the url.
set noreferrer for the link to avoid tracking.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
Not sure if we want to add links to external services, so it's an extra
patch.
we could also add links to google maps, apple maps, etc.
src/Utils.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/Utils.js b/src/Utils.js
index 390a302..6b12399 100644
--- a/src/Utils.js
+++ b/src/Utils.js
@@ -1577,7 +1577,8 @@ Ext.define('Proxmox.Utils', {
return Proxmox.Utils.NoneText;
}
let location = Proxmox.Utils.parsePropertyString(value);
- let degrees = `${location.latitude} °, ${location.longitude} °`;
+ let link = `https://openstreetmap.org#map=20/${location.latitude}/${location.longitude}`;
+ let degrees = `${location.latitude} °, ${location.longitude} °, <a href='${link}' target="_blank" rel="noreferrer">open on OpenStreetMap</a>`;
if (location.name) {
return `${location.name} (${degrees})`;
}
--
2.47.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH manager 1/2] node config: add location property
2026-05-08 8:40 [PATCH cluster/manager/proxmox{,-backup}/widget-toolkit 0/8] add location property to node/datacenter config for PVE/PBS Dominik Csapak
` (2 preceding siblings ...)
2026-05-08 8:40 ` [RFC PATCH widget-toolkit 2/2] utils: render location: add a link to that location on openstreetmap Dominik Csapak
@ 2026-05-08 8:40 ` Dominik Csapak
2026-05-08 8:40 ` [PATCH manager 2/2] ui: add location to datacenter and node options Dominik Csapak
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Dominik Csapak @ 2026-05-08 8:40 UTC (permalink / raw)
To: pve-devel, pbs-devel
consisting of an optional name and a set of coordinates.
This can be used by management systems (such as PDM) to query and
display the location of a node, e.g. on a world map.
It's added per node in addition to the one in the datacente config, so
an admin can provide a different location per node instead of only one
per cluster.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
PVE/NodeConfig.pm | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/PVE/NodeConfig.pm b/PVE/NodeConfig.pm
index 87eea2a5..0ed959b7 100644
--- a/PVE/NodeConfig.pm
+++ b/PVE/NodeConfig.pm
@@ -186,6 +186,36 @@ $confdesc->{acme} = {
optional => 1,
};
+my $location_desc = {
+ name => {
+ type => 'string',
+ description => 'The name of the location of this node',
+ typetext => "<name>",
+ optional => 1,
+ maxLength => 128,
+ },
+ latitude => {
+ type => 'number',
+ description => "The latitude of the nodes location in degrees.",
+ minimum => -90,
+ maximum => 90,
+ },
+ longitude => {
+ type => 'number',
+ description => "The longitude of the nodes location in degrees.",
+ minimum => -180,
+ maximum => 180,
+ },
+};
+
+$confdesc->{location} = {
+ type => 'string',
+ format => $location_desc,
+ description =>
+ "The location of the node. Overrides the default from the datacenter config.",
+ optional => 1,
+};
+
for my $i (0 .. $MAXDOMAINS) {
$confdesc->{"acmedomain$i"} = {
type => 'string',
--
2.47.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH manager 2/2] ui: add location to datacenter and node options
2026-05-08 8:40 [PATCH cluster/manager/proxmox{,-backup}/widget-toolkit 0/8] add location property to node/datacenter config for PVE/PBS Dominik Csapak
` (3 preceding siblings ...)
2026-05-08 8:40 ` [PATCH manager 1/2] node config: add location property Dominik Csapak
@ 2026-05-08 8:40 ` Dominik Csapak
2026-05-08 8:40 ` [PATCH proxmox 1/1] pbs-api-types: node config: add location property Dominik Csapak
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Dominik Csapak @ 2026-05-08 8:40 UTC (permalink / raw)
To: pve-devel, pbs-devel
uses the renderer and edit window from widget toolkit.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
www/manager6/dc/OptionView.js | 9 +++++++++
www/manager6/node/NodeOptionsView.js | 16 ++++++++++++++++
2 files changed, 25 insertions(+)
diff --git a/www/manager6/dc/OptionView.js b/www/manager6/dc/OptionView.js
index 7c8d3792..da9d216b 100644
--- a/www/manager6/dc/OptionView.js
+++ b/www/manager6/dc/OptionView.js
@@ -568,6 +568,15 @@ Ext.define('PVE.dc.OptionView', {
onlineHelp: 'gui_consent_banner',
});
+ me.rows.location = {
+ required: true,
+ header: gettext('Location'),
+ renderer: Proxmox.Utils.renderLocation,
+ editor: {
+ xtype: 'pmxLocationEditWindow',
+ },
+ };
+
me.selModel = Ext.create('Ext.selection.RowModel', {});
Ext.apply(me, {
diff --git a/www/manager6/node/NodeOptionsView.js b/www/manager6/node/NodeOptionsView.js
index 88170531..5e9ce791 100644
--- a/www/manager6/node/NodeOptionsView.js
+++ b/www/manager6/node/NodeOptionsView.js
@@ -41,6 +41,22 @@ Ext.define('Proxmox.node.NodeOptionsView', {
},
],
+ rows: {
+ location: {
+ required: true,
+ header: gettext('Location'),
+ renderer: function (value) {
+ if (!value) {
+ return gettext('from Datacenter options');
+ }
+ return Proxmox.Utils.renderLocation(value);
+ },
+ editor: {
+ xtype: 'pmxLocationEditWindow',
+ },
+ },
+ },
+
gridRows: [
{
xtype: 'integer',
--
2.47.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH proxmox 1/1] pbs-api-types: node config: add location property
2026-05-08 8:40 [PATCH cluster/manager/proxmox{,-backup}/widget-toolkit 0/8] add location property to node/datacenter config for PVE/PBS Dominik Csapak
` (4 preceding siblings ...)
2026-05-08 8:40 ` [PATCH manager 2/2] ui: add location to datacenter and node options Dominik Csapak
@ 2026-05-08 8:40 ` Dominik Csapak
2026-05-08 8:40 ` [PATCH proxmox-backup 1/2] api: node: " Dominik Csapak
2026-05-08 8:40 ` [PATCH proxmox-backup 2/2] ui: node options: " Dominik Csapak
7 siblings, 0 replies; 9+ messages in thread
From: Dominik Csapak @ 2026-05-08 8:40 UTC (permalink / raw)
To: pve-devel, pbs-devel
consisting of an optional name and a set of coordinates.
This can be used by management systems (such as PDM) to query and
display the location of a node, e.g. on a world map.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
pbs-api-types/src/node.rs | 46 ++++++++++++++++++++++++++++++++++++++-
1 file changed, 45 insertions(+), 1 deletion(-)
diff --git a/pbs-api-types/src/node.rs b/pbs-api-types/src/node.rs
index 73f8bd91..53950d92 100644
--- a/pbs-api-types/src/node.rs
+++ b/pbs-api-types/src/node.rs
@@ -41,6 +41,42 @@ pub struct NodeSwapCounters {
pub free: u64,
}
+pub const LOCATION_NAME_SCHEMA: Schema = StringSchema::new("A location name.")
+ .format(&api_types::SINGLE_LINE_COMMENT_FORMAT)
+ .max_length(128)
+ .schema();
+
+#[api(
+ properties: {
+ name: {
+ schema: LOCATION_NAME_SCHEMA,
+ optional: true,
+ },
+ latitude: {
+ type: Number,
+ minimum: -90.0,
+ maximum: 90.0,
+ },
+ longitude: {
+ type: Number,
+ minimum: -180.0,
+ maximum: 180.0,
+ },
+ },
+)]
+#[derive(Serialize, Deserialize, Clone, PartialEq)]
+#[serde(rename_all = "kebab-case")]
+/// Location information about a node.
+pub struct NodeLocation {
+ /// The name of the location of this node.
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub name: Option<String>,
+ /// The latitude of the nodes location in degrees.
+ pub latitude: f64,
+ /// The longitude of the nodes location in degrees.
+ pub longitude: f64,
+}
+
#[api]
#[derive(Serialize, Deserialize, Default)]
#[serde(rename_all = "kebab-case")]
@@ -325,7 +361,11 @@ pub enum Translation {
optional: true,
type: String,
max_length: 64 * 1024,
- }
+ },
+ location: {
+ optional: true,
+ type: String,
+ },
},
)]
#[derive(Deserialize, Serialize, Updater)]
@@ -380,6 +420,10 @@ pub struct NodeConfig {
/// Consent banner text
#[serde(skip_serializing_if = "Option::is_none")]
pub consent_text: Option<String>,
+
+ /// The location of the PBS instance.
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub location: Option<PropertyString<NodeLocation>>,
}
impl NodeConfig {
--
2.47.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH proxmox-backup 1/2] api: node: config: add location property
2026-05-08 8:40 [PATCH cluster/manager/proxmox{,-backup}/widget-toolkit 0/8] add location property to node/datacenter config for PVE/PBS Dominik Csapak
` (5 preceding siblings ...)
2026-05-08 8:40 ` [PATCH proxmox 1/1] pbs-api-types: node config: add location property Dominik Csapak
@ 2026-05-08 8:40 ` Dominik Csapak
2026-05-08 8:40 ` [PATCH proxmox-backup 2/2] ui: node options: " Dominik Csapak
7 siblings, 0 replies; 9+ messages in thread
From: Dominik Csapak @ 2026-05-08 8:40 UTC (permalink / raw)
To: pve-devel, pbs-devel
the `NodeConfig` gained a location property, handle it in the api.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
src/api2/node/config.rs | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/api2/node/config.rs b/src/api2/node/config.rs
index fb2c2ff4d..7ba2f0d35 100644
--- a/src/api2/node/config.rs
+++ b/src/api2/node/config.rs
@@ -67,6 +67,8 @@ pub enum DeletableProperty {
TaskLogMaxDays,
/// Delete the consent-text property
ConsentText,
+ /// Delete the location property
+ Location,
}
#[api(
@@ -157,6 +159,9 @@ pub fn update_node_config(
DeletableProperty::ConsentText => {
config.consent_text = None;
}
+ DeletableProperty::Location => {
+ config.location = None;
+ }
}
}
}
@@ -203,6 +208,9 @@ pub fn update_node_config(
if update.consent_text.is_some() {
config.consent_text = update.consent_text;
}
+ if update.location.is_some() {
+ config.location = update.location;
+ }
pbs_config::node::save_config(&config)?;
--
2.47.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH proxmox-backup 2/2] ui: node options: add location property
2026-05-08 8:40 [PATCH cluster/manager/proxmox{,-backup}/widget-toolkit 0/8] add location property to node/datacenter config for PVE/PBS Dominik Csapak
` (6 preceding siblings ...)
2026-05-08 8:40 ` [PATCH proxmox-backup 1/2] api: node: " Dominik Csapak
@ 2026-05-08 8:40 ` Dominik Csapak
7 siblings, 0 replies; 9+ messages in thread
From: Dominik Csapak @ 2026-05-08 8:40 UTC (permalink / raw)
To: pve-devel, pbs-devel
use the renderer and edit window from widget-toolkit.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
www/config/NodeOptionView.js | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/www/config/NodeOptionView.js b/www/config/NodeOptionView.js
index 962e30709..48abe66e9 100644
--- a/www/config/NodeOptionView.js
+++ b/www/config/NodeOptionView.js
@@ -35,6 +35,17 @@ Ext.define('PBS.NodeOptionView', {
},
],
+ rows: {
+ location: {
+ required: true,
+ header: gettext('Location'),
+ renderer: Proxmox.Utils.renderLocation,
+ editor: {
+ xtype: 'pmxLocationEditWindow',
+ },
+ },
+ },
+
gridRows: [
{
xtype: 'text',
--
2.47.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
end of thread, other threads:[~2026-05-08 8:42 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-08 8:40 [PATCH cluster/manager/proxmox{,-backup}/widget-toolkit 0/8] add location property to node/datacenter config for PVE/PBS Dominik Csapak
2026-05-08 8:40 ` [PATCH cluster 1/1] datacenter config: add location property Dominik Csapak
2026-05-08 8:40 ` [PATCH widget-toolkit 1/2] add window and renderer for locations Dominik Csapak
2026-05-08 8:40 ` [RFC PATCH widget-toolkit 2/2] utils: render location: add a link to that location on openstreetmap Dominik Csapak
2026-05-08 8:40 ` [PATCH manager 1/2] node config: add location property Dominik Csapak
2026-05-08 8:40 ` [PATCH manager 2/2] ui: add location to datacenter and node options Dominik Csapak
2026-05-08 8:40 ` [PATCH proxmox 1/1] pbs-api-types: node config: add location property Dominik Csapak
2026-05-08 8:40 ` [PATCH proxmox-backup 1/2] api: node: " Dominik Csapak
2026-05-08 8:40 ` [PATCH proxmox-backup 2/2] ui: node options: " Dominik Csapak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox