[PR #238] feat: encode cluster name in URL for multi-tab and shareable links #319

Closed
opened 2026-03-07 19:57:34 +03:00 by kerem · 0 comments
Owner

Original Pull Request: https://github.com/Corsinvest/cv4pve-admin/pull/238

State: closed
Merged: Yes


Summary

  • Cluster selection moved from session storage to URL: /module/{clusterName}/{slug}
  • Each browser tab is now independent (no cross-tab cluster override)
  • Links are shareable — the correct cluster is encoded in the URL
  • * used as sentinel for global/all-cluster modules (Scope.All)

Changes

  • ApplicationHelper: added IsAllCluster, IsValidClusterName
  • UrlHelper: added ModuleUrl(slug, clusterName), GetClusterNameFromUrl
  • ModuleBase: removed BaseUrl, added GetBaseUrl(clusterName)
  • ModuleLinkBase: removed RealUrl, use GetRealUrl(clusterName) everywhere
  • RenderModule: ClusterName now read from Blazor route parameter (not PageRoute)
  • MainLayout: reads cluster from URL on first render; CascadingValue wraps full layout
  • AdminService/IAdminService: removed session-storage cluster methods
  • ClusterSettings: validates * is not a valid cluster name
  • ModuleSearchProvider, PveSearchProvider, CommandPalette: use IsAllCluster
  • Diagnostic/Issues: removed redundant IsAllCluster guard
  • Status widget: use ClusterNames?.FirstOrDefault() ?? AllClusterName

Test plan

  • Navigate to /module/{cluster}/backup-analytics → loads correctly
  • Open two tabs with different clusters → each tab is independent
  • Change cluster via selector → URL updates to new cluster
  • Command palette search → links include correct cluster in URL
  • Global modules (Profile, System) → URL uses * as cluster
  • Invalid cluster in URL → NotFound page
**Original Pull Request:** https://github.com/Corsinvest/cv4pve-admin/pull/238 **State:** closed **Merged:** Yes --- ## Summary - Cluster selection moved from session storage to URL: `/module/{clusterName}/{slug}` - Each browser tab is now independent (no cross-tab cluster override) - Links are shareable — the correct cluster is encoded in the URL - `*` used as sentinel for global/all-cluster modules (`Scope.All`) ## Changes - `ApplicationHelper`: added `IsAllCluster`, `IsValidClusterName` - `UrlHelper`: added `ModuleUrl(slug, clusterName)`, `GetClusterNameFromUrl` - `ModuleBase`: removed `BaseUrl`, added `GetBaseUrl(clusterName)` - `ModuleLinkBase`: removed `RealUrl`, use `GetRealUrl(clusterName)` everywhere - `RenderModule`: `ClusterName` now read from Blazor route parameter (not PageRoute) - `MainLayout`: reads cluster from URL on first render; `CascadingValue` wraps full layout - `AdminService`/`IAdminService`: removed session-storage cluster methods - `ClusterSettings`: validates `*` is not a valid cluster name - `ModuleSearchProvider`, `PveSearchProvider`, `CommandPalette`: use `IsAllCluster` - `Diagnostic/Issues`: removed redundant `IsAllCluster` guard - `Status` widget: use `ClusterNames?.FirstOrDefault() ?? AllClusterName` ## Test plan - [ ] Navigate to `/module/{cluster}/backup-analytics` → loads correctly - [ ] Open two tabs with different clusters → each tab is independent - [ ] Change cluster via selector → URL updates to new cluster - [ ] Command palette search → links include correct cluster in URL - [ ] Global modules (Profile, System) → URL uses `*` as cluster - [ ] Invalid cluster in URL → NotFound page
kerem 2026-03-07 19:57:34 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cv4pve-admin#319
No description provided.