mirror of
https://github.com/hansjone/netx.git
synced 2026-10-19 03:00:46 +08:00
Harden topology tree against bad view filters and allow deleting UME World.
Coerce non-dict filter JSON so /tree no longer 500s, surface API failure details, and let users remove the UME World container for local resets. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
35a3980dc0
commit
961d523479
7 changed files with 89 additions and 30 deletions
|
|
@ -2318,30 +2318,38 @@ export function TopologyPage() {
|
|||
</span>
|
||||
</span>
|
||||
</button>
|
||||
{!umeNav ? (
|
||||
{!umeNav || containerFolder ? (
|
||||
<div className="topo-map-list__actions">
|
||||
<button
|
||||
type="button"
|
||||
className="topo-map-list__icon"
|
||||
title={t("topology.renameRegion")}
|
||||
aria-label={t("topology.renameRegion")}
|
||||
disabled={!!folder.is_system || renameRegionMut.isPending}
|
||||
onClick={() => promptRenameRegion(folder.id, folder.name)}
|
||||
>
|
||||
<PencilIcon />
|
||||
</button>
|
||||
{!containerFolder ? (
|
||||
<button
|
||||
type="button"
|
||||
className="topo-map-list__icon"
|
||||
title={t("topology.renameRegion")}
|
||||
aria-label={t("topology.renameRegion")}
|
||||
disabled={!!folder.is_system || renameRegionMut.isPending}
|
||||
onClick={() => promptRenameRegion(folder.id, folder.name)}
|
||||
>
|
||||
<PencilIcon />
|
||||
</button>
|
||||
) : null}
|
||||
<button
|
||||
type="button"
|
||||
className="topo-map-list__icon"
|
||||
title={t("topology.deleteRegion")}
|
||||
aria-label={t("topology.deleteRegion")}
|
||||
disabled={!!folder.is_system}
|
||||
disabled={
|
||||
deleteFolderMut.isPending ||
|
||||
(!!folder.is_system && !containerFolder)
|
||||
}
|
||||
onClick={() => {
|
||||
const msg = t("topology.deleteRegionConfirm").replace(
|
||||
"{{name}}",
|
||||
folder.name,
|
||||
);
|
||||
if (window.confirm(msg)) deleteFolderMut.mutate(folder.id);
|
||||
const msg = (
|
||||
containerFolder
|
||||
? t("topology.deleteUmeWorldConfirm")
|
||||
: t("topology.deleteRegionConfirm")
|
||||
).replace("{{name}}", folder.name);
|
||||
if (window.confirm(msg)) {
|
||||
deleteFolderMut.mutate(folder.id);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<CloseIcon />
|
||||
|
|
@ -4116,7 +4124,10 @@ export function TopologyPage() {
|
|||
</>
|
||||
) : treeFailed ? (
|
||||
<>
|
||||
{t("topology.treeLoadFailed")}{" "}
|
||||
{t("topology.treeLoadFailed")}
|
||||
{treeQuery.error ? (
|
||||
<span className="muted"> ({String(treeQuery.error)})</span>
|
||||
) : null}{" "}
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn--sm btn--ghost"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue