storage IA: split /storage into Meghajtók + /storage/network (NAS)

User feedback on D1: the NAS-add button and the local-drive enrollment
buttons sat side by side with no separation — two different storage
classes interleaved on one page. Now two subpages under Tárhely:

- /storage — Tárhely — Meghajtók: physical drive registry, migrate,
  wizard entry points (Új meghajtó inicializálása / Meglévő meghajtó
  csatolása), unified agent view, manual add. The enrollment buttons
  now live unambiguously in the local-drive context.
- /storage/network — Tárhely — Hálózati tárhely (NAS): the NAS share
  list (NAS-megosztások) + add form + its JS (moved verbatim, incl.
  its own openDialog copy for the remove overlay).
- layout.html: Tárhely main-nav item gains two always-visible nested
  sub-links (Meghajtók / Hálózati tárhely, .nav-links-nested CSS);
  parent stays highlighted on both.
- handlers.go: NetworkStoragePaths moves out of storagePageData into
  the new networkStoragePageData (page key storage-network) +
  storageNetworkPageHandler; GET /storage/network route.
- Tests: /storage must NOT render the NAS section, /storage/network
  renders it and nothing drive-related; inventory + no-native-confirm
  scans cover the new template. Both template gates green.
This commit is contained in:
2026-07-02 19:34:27 +02:00
parent c427b40b2f
commit d3c97c62fe
7 changed files with 172 additions and 109 deletions
+13 -2
View File
@@ -987,8 +987,14 @@ func (s *Server) storagePageData() map[string]interface{} {
storageViews = append(storageViews, view)
}
data["StoragePaths"] = storageViews
// NAS network storage (Part A2) — separate section with the agent's per-share health (ok/idle/
// unreachable/unknown). Distinct from the physical-drive list above; no drive lifecycle actions.
return data
}
// networkStoragePageData builds the Tárhely → Hálózati tárhely (NAS) subpage: the NAS shares
// with the agent's per-share health (ok/idle/unreachable/unknown). Split from the physical
// drive page — the two storage classes were confusingly interleaved on one page.
func (s *Server) networkStoragePageData() map[string]interface{} {
data := s.settingsBaseData("storage-network", "Hálózati tárhely")
data["NetworkStoragePaths"] = s.networkStorageItems(context.Background())
return data
}
@@ -1061,6 +1067,11 @@ func (s *Server) storagePageHandler(w http.ResponseWriter, r *http.Request) {
s.executeTemplate(w, r, "storage", data)
}
// storageNetworkPageHandler serves the Tárhely → Hálózati tárhely (NAS) subpage.
func (s *Server) storageNetworkPageHandler(w http.ResponseWriter, r *http.Request) {
s.executeTemplate(w, r, "storage_network", s.networkStoragePageData())
}
// settingsNotificationsPageHandler serves GET /settings/notifications (the POST on the same
// path is the save handler — dispatch is split in the router).
func (s *Server) settingsNotificationsPageHandler(w http.ResponseWriter, r *http.Request) {