style(admin-ui): align technical icons and semantic status inks
This commit is contained in:
@@ -125,7 +125,7 @@ else
|
||||
HistorianDrainState.Disabled => "chip chip-idle",
|
||||
HistorianDrainState.Idle => "chip chip-idle",
|
||||
HistorianDrainState.Draining => "chip chip-ok",
|
||||
HistorianDrainState.BackingOff => "chip chip-caution",
|
||||
HistorianDrainState.BackingOff => "chip chip-warn",
|
||||
_ => "chip chip-idle",
|
||||
};
|
||||
|
||||
|
||||
@@ -334,9 +334,9 @@ else
|
||||
|
||||
private static string KindChipClass(string kind) => kind switch
|
||||
{
|
||||
"Activated" => "chip-alert",
|
||||
"Activated" => "chip-bad",
|
||||
"Cleared" => "chip-ok",
|
||||
"Acknowledged" or "Confirmed" => "chip-caution",
|
||||
"Acknowledged" or "Confirmed" => "chip-warn",
|
||||
"Shelved" or "Disabled" => "chip-idle",
|
||||
_ => "chip-idle",
|
||||
};
|
||||
|
||||
@@ -28,7 +28,7 @@ else
|
||||
{
|
||||
<section class="panel notice rise" style="animation-delay:.02s">
|
||||
The <strong>Scope target</strong> column resolves each row against the current configuration. A
|
||||
row marked <span class="chip chip-alert">unresolved</span> points at nothing — it is shipped in
|
||||
row marked <span class="chip chip-bad">unresolved</span> points at nothing — it is shipped in
|
||||
every deployment artifact but authorizes nobody, and the deploy gate rejects it.
|
||||
<AuthorizeView Policy="@AdminUiPolicies.ConfigEditor">Open it and re-pick the scope.</AuthorizeView>
|
||||
</section>
|
||||
@@ -79,7 +79,7 @@ else
|
||||
}
|
||||
else
|
||||
{
|
||||
<div><span class="chip chip-alert" title="@check.Message">unresolved</span></div>
|
||||
<div><span class="chip chip-bad" title="@check.Message">unresolved</span></div>
|
||||
<div class="text-danger small">@check.Message</div>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -230,11 +230,11 @@ else
|
||||
status is { } s && ZB.MOM.WW.OtOpcUa.ControlPlane.Coordinators.ConfigPublishCoordinator.IsDegraded(s, failureReason);
|
||||
|
||||
private static string StatusChipClass(NodeDeploymentStatus? status, string? failureReason) =>
|
||||
IsDegraded(status, failureReason) ? "chip-caution" : status switch
|
||||
IsDegraded(status, failureReason) ? "chip-warn" : status switch
|
||||
{
|
||||
NodeDeploymentStatus.Applied => "chip-ok",
|
||||
NodeDeploymentStatus.Applying => "chip-caution",
|
||||
NodeDeploymentStatus.Failed => "chip-alert",
|
||||
NodeDeploymentStatus.Applying => "chip-warn",
|
||||
NodeDeploymentStatus.Failed => "chip-bad",
|
||||
_ => "chip-idle",
|
||||
};
|
||||
|
||||
|
||||
@@ -322,8 +322,8 @@ else
|
||||
private static string StateChipClass(string state) => state switch
|
||||
{
|
||||
"Healthy" => "chip-ok",
|
||||
"Degraded" or "Connecting" or "Reconnecting" => "chip-caution",
|
||||
"Faulted" => "chip-alert",
|
||||
"Degraded" or "Connecting" or "Reconnecting" => "chip-warn",
|
||||
"Faulted" => "chip-bad",
|
||||
_ => "chip-idle",
|
||||
};
|
||||
|
||||
|
||||
@@ -608,10 +608,10 @@ else
|
||||
|
||||
private static string StatusChipClass(string status, bool unreachable) => (status, unreachable) switch
|
||||
{
|
||||
(_, true) => "chip-alert",
|
||||
(_, true) => "chip-bad",
|
||||
("Up", _) => "chip-ok",
|
||||
("Joining", _) or ("Leaving", _) or ("Exiting", _) or ("WeaklyUp", _) => "chip-caution",
|
||||
("Down", _) or ("Removed", _) => "chip-alert",
|
||||
("Joining", _) or ("Leaving", _) or ("Exiting", _) or ("WeaklyUp", _) => "chip-warn",
|
||||
("Down", _) or ("Removed", _) => "chip-bad",
|
||||
_ => "chip-idle",
|
||||
};
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<div class="kv"><span class="k">SearchBase</span><span class="v mono small" title="@_options.SearchBase">@DisplayText.Abbreviate(_options.SearchBase, 48)</span></div>
|
||||
@if (_options.Transport == ZB.MOM.WW.Auth.Abstractions.Ldap.LdapTransport.None && _options.AllowInsecure)
|
||||
{
|
||||
<div class="kv"><span class="k">Warning</span><span class="v"><span class="chip chip-alert">Plaintext credentials over LDAP — dev mode only</span></span></div>
|
||||
<div class="kv"><span class="k">Warning</span><span class="v"><span class="chip chip-bad">Plaintext credentials over LDAP — dev mode only</span></span></div>
|
||||
}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -179,8 +179,8 @@ else
|
||||
|
||||
private static string LevelChipClass(string level) => level switch
|
||||
{
|
||||
"Critical" or "Error" => "chip-alert",
|
||||
"Warning" => "chip-caution",
|
||||
"Critical" or "Error" => "chip-bad",
|
||||
"Warning" => "chip-warn",
|
||||
"Information" => "chip-idle",
|
||||
_ => "chip-idle",
|
||||
};
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
{
|
||||
<button type="button" class="btn btn-sm btn-link p-0 tree-twist" aria-label="@((node.Expanded ? "Collapse " : "Expand ") + node.DisplayName)" aria-expanded="@(node.Expanded ? "true" : "false")"
|
||||
@onclick="@(() => ToggleAsync(node))">
|
||||
@(node.Expanded ? "▼" : "▶")
|
||||
<TreeChevron Expanded="@node.Expanded" />
|
||||
</button>
|
||||
}
|
||||
else
|
||||
@@ -51,7 +51,6 @@
|
||||
<button type="button" aria-pressed="@(selected ? "true" : "false")"
|
||||
class="btn btn-sm p-0 px-1 border-0 d-inline-flex align-items-center gap-1 @(selected ? "bg-primary text-white rounded" : "btn-link text-decoration-none")"
|
||||
@onclick="@(() => OnSelect.InvokeAsync(node))">
|
||||
<span aria-hidden="true">@node.Icon</span>
|
||||
<span class="mono small">@node.DisplayName</span>
|
||||
<span class="chip chip-idle ms-1" style="font-size:0.65rem">@node.ScopeKind</span>
|
||||
</button>
|
||||
@@ -60,7 +59,6 @@
|
||||
{
|
||||
@* Label only — an enterprise heading, or a level with no ACL scope kind behind it. *@
|
||||
<span class="d-inline-flex align-items-center gap-1 text-muted">
|
||||
<span aria-hidden="true">@node.Icon</span>
|
||||
<span class="mono small">@node.DisplayName</span>
|
||||
</span>
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
@using ZB.MOM.WW.OtOpcUa.AdminUI.Uns
|
||||
@* Raw labels carry meaning; these fixed-stroke vectors are decorative and OS independent. *@
|
||||
<svg aria-hidden="true" focusable="false" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" style="flex-shrink:0">
|
||||
@switch (Kind)
|
||||
{
|
||||
case RawNodeKind.Enterprise:
|
||||
<path d="M3 14V2h10v12M1.5 14h13M6 5h.1M10 5h.1M6 8h.1M10 8h.1M6.5 14v-3h3v3" />
|
||||
break;
|
||||
case RawNodeKind.Cluster:
|
||||
<rect x="2" y="2" width="12" height="5" rx="1" /><rect x="2" y="9" width="12" height="5" rx="1" /><path d="M5 4.5h.1M5 11.5h.1M9 4.5h3M9 11.5h3" />
|
||||
break;
|
||||
case RawNodeKind.Folder:
|
||||
<path d="M2 5V3h5l2 2h5v8H2Z" />
|
||||
break;
|
||||
case RawNodeKind.Driver:
|
||||
<path d="M5 2v4M11 2v4M3.5 6h9v2a4.5 4.5 0 0 1-9 0ZM8 12.5V15" />
|
||||
break;
|
||||
case RawNodeKind.Device:
|
||||
<rect x="4" y="4" width="8" height="8" rx="1" /><path d="M6 1v3M10 1v3M6 12v3M10 12v3M1 6h3M1 10h3M12 6h3M12 10h3" />
|
||||
break;
|
||||
case RawNodeKind.TagGroup:
|
||||
<rect x="2" y="5" width="10" height="9" rx="1" /><path d="M5 5V2h9v9h-2M5 8h4M5 11h4" />
|
||||
break;
|
||||
case RawNodeKind.Tag:
|
||||
<path d="M2 2h6l6 6-6 6-6-6Z" /><circle cx="5" cy="5" r=".7" />
|
||||
break;
|
||||
default:
|
||||
<circle cx="8" cy="8" r="3" />
|
||||
break;
|
||||
}
|
||||
</svg>
|
||||
@code {
|
||||
/// <summary>The existing raw hierarchy kind; no operation or domain state is inferred.</summary>
|
||||
[Parameter] public RawNodeKind Kind { get; set; }
|
||||
}
|
||||
@@ -287,7 +287,7 @@
|
||||
<button type="button" class="btn btn-sm btn-link p-0 tree-twist"
|
||||
aria-label="@($"{(node.Expanded ? "Collapse" : "Expand")} {node.DisplayName}")" aria-expanded="@(node.Expanded ? "true" : "false")"
|
||||
aria-busy="@(node.Loading ? "true" : null)" @onclick="@(() => ToggleAsync(node))">
|
||||
@(node.Expanded ? "▼" : "▶")
|
||||
<TreeChevron Expanded="@node.Expanded" />
|
||||
</button>
|
||||
}
|
||||
else
|
||||
@@ -320,7 +320,7 @@
|
||||
@onchange="@(e => ToggleTagSelection(node, e.Value is true))" />
|
||||
</label>
|
||||
}
|
||||
<span aria-hidden="true">@KindIcon(node.Kind)</span>
|
||||
<RawKindIcon Kind="@node.Kind" />
|
||||
<span id="@(_labelScope + Convert.ToHexString(System.Text.Encoding.UTF8.GetBytes(node.Key)))" class="mono small @(muted ? "text-muted" : "")">@node.DisplayName</span>
|
||||
@if (muted)
|
||||
{
|
||||
@@ -333,18 +333,6 @@
|
||||
</span>
|
||||
};
|
||||
|
||||
private static string KindIcon(RawNodeKind kind) => kind switch
|
||||
{
|
||||
RawNodeKind.Enterprise => "🏢",
|
||||
RawNodeKind.Cluster => "🖥️",
|
||||
RawNodeKind.Folder => "📁",
|
||||
RawNodeKind.Driver => "🔌",
|
||||
RawNodeKind.Device => "📟",
|
||||
RawNodeKind.TagGroup => "🗂️",
|
||||
RawNodeKind.Tag => "🏷️",
|
||||
_ => "•",
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Lazy expansion — the whole point of WP2 (UNS never did this).
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -419,8 +407,8 @@
|
||||
|
||||
private List<ContextMenuItem> PickerContainerMenu(RawNode node) => new()
|
||||
{
|
||||
new() { Label = "Select all tags below", Icon = "☑", OnClick = () => SelectAllUnderAsync(node) },
|
||||
new() { Label = "Clear all tags below", Icon = "☐", OnClick = () => ClearAllUnderAsync(node) },
|
||||
new() { Label = "Select all tags below", OnClick = () => SelectAllUnderAsync(node) },
|
||||
new() { Label = "Clear all tags below", OnClick = () => ClearAllUnderAsync(node) },
|
||||
};
|
||||
|
||||
private bool IsTagSelected(RawNode node) =>
|
||||
@@ -455,63 +443,63 @@
|
||||
|
||||
private List<ContextMenuItem> ClusterMenu(RawNode node) => new()
|
||||
{
|
||||
new() { Label = "New folder", Icon = "📁", OnClick = () => OnNewFolder(node) },
|
||||
new() { Label = "New driver", Icon = "🔌", OnClick = () => OnNewDriver(node) },
|
||||
new() { Label = "New folder", OnClick = () => OnNewFolder(node) },
|
||||
new() { Label = "New driver", OnClick = () => OnNewDriver(node) },
|
||||
};
|
||||
|
||||
private List<ContextMenuItem> FolderMenu(RawNode node) => new()
|
||||
{
|
||||
new() { Label = "New folder", Icon = "📁", OnClick = () => OnNewFolder(node) },
|
||||
new() { Label = "New driver", Icon = "🔌", OnClick = () => OnNewDriver(node) },
|
||||
new() { Label = "New folder", OnClick = () => OnNewFolder(node) },
|
||||
new() { Label = "New driver", OnClick = () => OnNewDriver(node) },
|
||||
ContextMenuItem.Separator(),
|
||||
new() { Label = "Rename", Icon = "✏️", OnClick = () => OnRenameFolder(node) },
|
||||
new() { Label = "Delete", Icon = "🗑️", OnClick = () => OnDeleteFolder(node) },
|
||||
new() { Label = "Rename", OnClick = () => OnRenameFolder(node) },
|
||||
new() { Label = "Delete", OnClick = () => OnDeleteFolder(node) },
|
||||
};
|
||||
|
||||
private List<ContextMenuItem> DriverMenu(RawNode node) => new()
|
||||
{
|
||||
new() { Label = "Configure", Icon = "⚙", OnClick = () => OnConfigureDriver(node) },
|
||||
new() { Label = "New device", Icon = "📟", OnClick = () => OnNewDevice(node) },
|
||||
new() { Label = "Configure", OnClick = () => OnConfigureDriver(node) },
|
||||
new() { Label = "New device", OnClick = () => OnNewDevice(node) },
|
||||
ContextMenuItem.Separator(),
|
||||
new() { Label = node.Enabled ? "Disable" : "Enable", Icon = node.Enabled ? "⏸" : "▶",
|
||||
new() { Label = node.Enabled ? "Disable" : "Enable",
|
||||
OnClick = () => OnToggleDriverEnabled(node) },
|
||||
new() { Label = "Rename", Icon = "✏️", OnClick = () => OnRenameDriver(node) },
|
||||
new() { Label = "Delete", Icon = "🗑️", OnClick = () => OnDeleteDriver(node) },
|
||||
new() { Label = "Rename", OnClick = () => OnRenameDriver(node) },
|
||||
new() { Label = "Delete", OnClick = () => OnDeleteDriver(node) },
|
||||
};
|
||||
|
||||
private List<ContextMenuItem> DeviceMenu(RawNode node) => new()
|
||||
{
|
||||
new() { Label = "Configure", Icon = "⚙", OnClick = () => OnConfigureDevice(node) },
|
||||
new() { Label = "New tag-group", Icon = "🗂️", OnClick = () => OnNewTagGroup(node) },
|
||||
new() { Label = "Configure", OnClick = () => OnConfigureDevice(node) },
|
||||
new() { Label = "New tag-group", OnClick = () => OnNewTagGroup(node) },
|
||||
ContextMenuItem.Separator(),
|
||||
// "Add tags ▸" flattened — ContextMenu is single-level, so the submenu is a labelled group.
|
||||
new() { Label = "Add tags", Disabled = true },
|
||||
new() { Label = "Manual entry", Icon = "✍️", OnClick = () => OnAddManualTags(node) },
|
||||
new() { Label = "Import CSV", Icon = "📥", OnClick = () => OnImportCsv(node) },
|
||||
new() { Label = "Export CSV", Icon = "📤", OnClick = () => OnExportCsv(node) },
|
||||
new() { Label = "Browse device…", Icon = "🔭", OnClick = () => OnBrowseDevice(node) },
|
||||
new() { Label = "Manual entry", OnClick = () => OnAddManualTags(node) },
|
||||
new() { Label = "Import CSV", OnClick = () => OnImportCsv(node) },
|
||||
new() { Label = "Export CSV", OnClick = () => OnExportCsv(node) },
|
||||
new() { Label = "Browse device…", OnClick = () => OnBrowseDevice(node) },
|
||||
ContextMenuItem.Separator(),
|
||||
new() { Label = "Delete", Icon = "🗑️", OnClick = () => OnDeleteDevice(node) },
|
||||
new() { Label = "Delete", OnClick = () => OnDeleteDevice(node) },
|
||||
};
|
||||
|
||||
private List<ContextMenuItem> TagGroupMenu(RawNode node) => new()
|
||||
{
|
||||
new() { Label = "New group", Icon = "🗂️", OnClick = () => OnNewGroup(node) },
|
||||
new() { Label = "New group", OnClick = () => OnNewGroup(node) },
|
||||
ContextMenuItem.Separator(),
|
||||
new() { Label = "Add tags", Disabled = true },
|
||||
new() { Label = "Manual entry", Icon = "✍️", OnClick = () => OnAddManualTags(node) },
|
||||
new() { Label = "Import CSV", Icon = "📥", OnClick = () => OnImportCsv(node) },
|
||||
new() { Label = "Export CSV", Icon = "📤", OnClick = () => OnExportCsv(node) },
|
||||
new() { Label = "Browse device…", Icon = "🔭", OnClick = () => OnBrowseDevice(node) },
|
||||
new() { Label = "Manual entry", OnClick = () => OnAddManualTags(node) },
|
||||
new() { Label = "Import CSV", OnClick = () => OnImportCsv(node) },
|
||||
new() { Label = "Export CSV", OnClick = () => OnExportCsv(node) },
|
||||
new() { Label = "Browse device…", OnClick = () => OnBrowseDevice(node) },
|
||||
ContextMenuItem.Separator(),
|
||||
new() { Label = "Rename", Icon = "✏️", OnClick = () => OnRenameTagGroup(node) },
|
||||
new() { Label = "Delete", Icon = "🗑️", OnClick = () => OnDeleteTagGroup(node) },
|
||||
new() { Label = "Rename", OnClick = () => OnRenameTagGroup(node) },
|
||||
new() { Label = "Delete", OnClick = () => OnDeleteTagGroup(node) },
|
||||
};
|
||||
|
||||
private List<ContextMenuItem> TagMenu(RawNode node) => new()
|
||||
{
|
||||
new() { Label = "Edit", Icon = "✏️", OnClick = () => OnEditTag(node) },
|
||||
new() { Label = "Delete", Icon = "🗑️", OnClick = () => OnDeleteTag(node) },
|
||||
new() { Label = "Edit", OnClick = () => OnEditTag(node) },
|
||||
new() { Label = "Delete", OnClick = () => OnDeleteTag(node) },
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
@* Decorative geometry only; the owning button supplies its contextual accessible name. *@
|
||||
<svg aria-hidden="true" focusable="false" width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="@(Expanded ? "M3 4.5 6 7.5 9 4.5" : "M4.5 3 7.5 6 4.5 9")" />
|
||||
</svg>
|
||||
@code {
|
||||
/// <summary>Whether the owning tree button currently shows its expanded state.</summary>
|
||||
[Parameter] public bool Expanded { get; set; }
|
||||
}
|
||||
@@ -51,7 +51,7 @@
|
||||
<button type="button" class="btn btn-sm btn-link p-0 tree-twist"
|
||||
aria-label="@($"{(childrenShown ? "Collapse" : "Expand")} {node.DisplayName}")" aria-expanded="@(childrenShown ? "true" : "false")"
|
||||
aria-busy="@(node.Loading ? "true" : null)" @onclick="@(() => OnToggleExpand.InvokeAsync(node))">
|
||||
@(childrenShown ? "▼" : "▶")
|
||||
<TreeChevron Expanded="@childrenShown" />
|
||||
</button>
|
||||
}
|
||||
else
|
||||
@@ -101,7 +101,7 @@
|
||||
// either side of it are not adjacent and each carries its own margin.
|
||||
<button type="button" class="btn btn-sm btn-outline-secondary ms-2"
|
||||
aria-label="@($"+ Area under {node.DisplayName}")" @onclick="@(() => OnAddChild.InvokeAsync(node))">+ Area</button>
|
||||
<a class="btn btn-sm btn-link p-0 ms-2" aria-label="@($"Settings for {node.DisplayName}")" href="@($"/clusters/{node.ClusterId}")">⚙ settings</a>
|
||||
<a class="btn btn-sm btn-link p-0 ms-2" aria-label="@($"Settings for {node.DisplayName}")" href="@($"/clusters/{node.ClusterId}")">Settings</a>
|
||||
<button type="button" class="btn btn-sm btn-outline-danger ms-2"
|
||||
aria-label="@($"Delete {node.DisplayName}")" @onclick="@(() => OnDelete.InvokeAsync(node))">Delete</button>
|
||||
break;
|
||||
|
||||
@@ -15,27 +15,18 @@
|
||||
padding: 0.3rem 0.6rem;
|
||||
}
|
||||
|
||||
/* OtOpcUa domain pages (Alerts, ScriptLog, Fleet, Hosts, AlarmsHistorian,
|
||||
RoleGrants, ImportEquipment) use two extra status-chip variants on top of the
|
||||
kit's .chip base + .chip-ok/.chip-warn/.chip-bad/.chip-idle/.chip-info set.
|
||||
.chip-alert is the red/danger variant (mirrors the kit's .chip-bad);
|
||||
.chip-caution is the amber variant (mirrors the kit's .chip-warn). Both reuse
|
||||
the kit's status tokens so they stay on-palette. */
|
||||
.chip-alert { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-border); }
|
||||
.chip-caution { color: var(--warn-ink); background: var(--warn-bg); border-color: var(--warn-border); }
|
||||
/* Bootstrap utility text is host presentation, separate from decorative signal tokens.
|
||||
Keep error/success/warning labels readable on both Technical-Light paper and card. */
|
||||
.text-danger { color: var(--bad-ink) !important; }
|
||||
.text-warning { color: var(--warn-ink) !important; }
|
||||
.text-success { color: var(--ok-ink) !important; }
|
||||
|
||||
/* Button sizing lives in the kit since ZB.MOM.WW.Theme 0.4.0 (layout.css ships the
|
||||
.btn / .btn-sm CSS-variable overrides this sheet carried locally under 0.3.1). */
|
||||
|
||||
/* Red variant of the kit's .notice inline banner (theme.css styles .notice amber,
|
||||
off the --warn-* tokens). Error banners across the AdminUI want the red tint, and
|
||||
were reaching for it with an inline style="border-color:var(--alert)" — but no
|
||||
--alert token exists in Theme 0.3.1, site.css or anywhere else, so that inline
|
||||
rule resolved to nothing and the banner stayed amber. The kit's red family is the
|
||||
--bad-* set (--bad / --bad-bg / --bad-border), the same tokens .chip-alert above
|
||||
uses; combine as `class="panel notice notice-alert"`. */
|
||||
/* Application error notices use the shared semantic family and readable text ink. */
|
||||
.notice-alert {
|
||||
color: var(--bad);
|
||||
color: var(--bad-ink);
|
||||
background: var(--bad-bg);
|
||||
border-color: var(--bad-border);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user