* [RFC PATCH datacenter-manager] ui: views: map: add hint for map data source
@ 2026-05-26 12:52 Dominik Csapak
0 siblings, 0 replies; only message in thread
From: Dominik Csapak @ 2026-05-26 12:52 UTC (permalink / raw)
To: pdm-devel
It's not strictly necessary, as the map data is in the public domain,
but it's probably a good idea to show users where the map data comes
from.
Suggested-by: Shannon Sterz <s.sterz@proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
sending as RFC because I'm not sure if we want this so prominently.
ui/css/pdm.scss | 7 +++++++
ui/src/dashboard/map.rs | 13 +++++++++++--
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/ui/css/pdm.scss b/ui/css/pdm.scss
index 549c006f..e2a70796 100644
--- a/ui/css/pdm.scss
+++ b/ui/css/pdm.scss
@@ -155,3 +155,10 @@
.dragging-item {
opacity: 0.5;
}
+
+.pdm-map-hint {
+ position: absolute;
+ right: 0px;
+ bottom: 0px;
+ padding: var(--pwt-spacer-1);
+}
diff --git a/ui/src/dashboard/map.rs b/ui/src/dashboard/map.rs
index df13b605..b98ffb3b 100644
--- a/ui/src/dashboard/map.rs
+++ b/ui/src/dashboard/map.rs
@@ -186,10 +186,19 @@ impl yew::Component for DashboardMapComp {
_ => return loading_column().into(),
};
- WorldMap::new(geojson)
+ let map = WorldMap::new(geojson)
+ .class(css::FlexFit)
+ .points(self.points.clone());
+
+ let link = "<a href='https://www.naturalearthdata.com' rel='noreferrer' target='_blank'>naturalearthdata.com</a>";
+ let text = tr!("Map data from {0}", link);
+
+ Container::new()
.with_std_props(&props.std_props)
.listeners(&props.listeners)
- .points(self.points.clone())
+ .class(css::Display::Flex)
+ .with_child(map)
+ .with_child(span(Html::from_html_unchecked(text.into())).class("pdm-map-hint"))
.into()
}
}
--
2.47.3
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-05-26 12:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-26 12:52 [RFC PATCH datacenter-manager] ui: views: map: add hint for map data source Dominik Csapak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox