feat(web): browse Knowledge Base by mixed Network/Fleet/Services/Storage/Identity/Knowledge categories
Replace the layer-based (Infrastructure/Governance/Cognition) browsing tabs with a synthesized category taxonomy built from the ontology's finer-grained `domain` field, since layer lumped unrelated entity types (an LXC and a DNS record and a storage volume) into one bucket. Network and Fleet each span two domains, so the table view now fans out per-domain fetches and merges, while the graph view maps domain->category client-side. Also carries over several detail-panel polish items (Tasks-not-raw-executions, slug URL encoding, MultiSelectFilter) from earlier in this session. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -21,6 +21,16 @@ export function relativeTime(iso: string | null | undefined): string {
|
||||
return `${d}d ago`;
|
||||
}
|
||||
|
||||
// Truncates long slugs/names in the middle (keeping the "type:" prefix and
|
||||
// the tail visible) rather than at the end — for slugs the distinguishing
|
||||
// part is often at both ends, e.g. "investigation:nomos/dragonfly-memlock-…"
|
||||
// vs "…rlimit-type-8-in-unprivileged-lxcs".
|
||||
export function truncateMiddle(s: string, maxLen = 36): string {
|
||||
if (s.length <= maxLen) return s;
|
||||
const keep = Math.floor((maxLen - 1) / 2);
|
||||
return `${s.slice(0, keep)}…${s.slice(-keep)}`;
|
||||
}
|
||||
|
||||
// debounce wraps fn so rapid calls (e.g. keystrokes in a filter input)
|
||||
// collapse into one invocation after `wait`ms of silence.
|
||||
export function debounce<T extends (...args: never[]) => void>(fn: T, wait = 300): T {
|
||||
|
||||
Reference in New Issue
Block a user