From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 8A0811FF142 for ; Tue, 05 May 2026 09:32:54 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 6A78918372; Tue, 5 May 2026 09:32:54 +0200 (CEST) From: Dominik Csapak To: pdm-devel@lists.proxmox.com Subject: [PATCH datacenter-manager/yew-widget-toolkit/yew-widget-toolkit-assets v2 0/8] add a new map widget for custom views Date: Tue, 5 May 2026 09:31:51 +0200 Message-ID: <20260505073203.398548-1-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.050 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 Message-ID-Hash: YBJ64Z22Y7LNNL3SGFWZAB2HYHAOGAVQ X-Message-ID-Hash: YBJ64Z22Y7LNNL3SGFWZAB2HYHAOGAVQ X-MailFrom: d.csapak@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: This series let's users add location info to remotes (longitude,latitude) and makes it possible to show them on a map in a custom view. This map is interactive, so it let's you zoom/pan/etc. (with touch controls too) It also adds new status info per remote to the resources status api call so we can show some sensible info on the map (success/warn/error). For now this is very basic only, but we can extend that in the future by e.g., adding a health call for each remote and including this info here. The source map data is from naturalearthdata.com (data is in the public domain) and is converted to geojson with 'ogr2ogr' (small script is included) I used the lowest resolution data which results in a ~350K json (~130K zipped) which should work in most scenarios (e.g. cpu perf on mid-tier mobiles) naming/location of api data and configs is open for debate, I'm not really sure if I found the right places, but they seemed to work out ok. NOTE: the world-map update script does not include the full json file now so it fits on the mailing list. please run ./update-world-map.sh to generate it after applying the patches for testing. When applying this world map should be checked in (maybe squashed into the commit with the script) changes from v1: * don't include world-map.json file in commit * fixed an issue with the wrong property name for the remote location in the ui proxmox-yew-widget-toolkit: Dominik Csapak (3): js-helper: add client-to-svg-coordinate conversion helper widget: charts: add interactive Map with zoom/pan and clustering widget: charts: add WorldMap with GeoJSON rendering Cargo.toml | 1 + js-helper-module.js | 7 + src/lib.rs | 5 + src/widget/charts/map/map_point.rs | 116 +++++++ src/widget/charts/map/mod.rs | 537 +++++++++++++++++++++++++++++ src/widget/charts/map/zoom_info.rs | 192 +++++++++++ src/widget/charts/mod.rs | 9 + src/widget/charts/world_map.rs | 219 ++++++++++++ 8 files changed, 1086 insertions(+) create mode 100644 src/widget/charts/map/map_point.rs create mode 100644 src/widget/charts/map/mod.rs create mode 100644 src/widget/charts/map/zoom_info.rs create mode 100644 src/widget/charts/world_map.rs proxmox-yew-widget-toolkit-assets: Dominik Csapak (1): charts: add necessary classes for Map scss/_charts.scss | 63 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) proxmox-datacenter-manager: Dominik Csapak (4): lib/api/ui: add location property to remote config lib/api: add new 'remote-list' info to the resource status ui: add world map geojson update script ui: views: add map component lib/pdm-api-types/src/remotes.rs | 22 ++- lib/pdm-api-types/src/resource.rs | 49 ++++++ lib/pdm-api-types/src/views.rs | 3 + server/src/api/pbs/mod.rs | 2 + server/src/api/pve/mod.rs | 2 + server/src/api/remotes/mod.rs | 9 + server/src/api/resources.rs | 38 +++- ui/Cargo.toml | 1 + ui/Makefile | 6 +- ui/index.html | 1 + ui/src/dashboard/map.rs | 281 ++++++++++++++++++++++++++++++ ui/src/dashboard/mod.rs | 3 + ui/src/dashboard/view.rs | 10 +- ui/src/dashboard/view/row_view.rs | 1 + ui/src/remotes/edit_remote.rs | 30 +++- ui/update-world-map.sh | 26 +++ 16 files changed, 467 insertions(+), 17 deletions(-) create mode 100644 ui/src/dashboard/map.rs create mode 100755 ui/update-world-map.sh Summary over all repositories: 25 files changed, 1616 insertions(+), 17 deletions(-) -- Generated by git-murpp 0.8.1