feat: 新增设备巡检模块实现完整的巡检告警功能
新增设备巡检模块核心功能,包括: - 巡检数据存储与调度系统 - 华为/H3C交换机及Linux服务器采集器 - 设备扩展配置与告警规则管理 - 主机详情页巡检配置入口 - 产品名称自定义设置功能 - 网络设备SSH exec通道兼容处理
This commit is contained in:
@@ -1490,9 +1490,19 @@ export const useVaultState = () => {
|
||||
const savedNoteGroups = localStorageAdapter.read<string[]>(STORAGE_KEY_NOTE_GROUPS);
|
||||
|
||||
if (savedSnippets) {
|
||||
const orderedSnippets = normalizeVaultOrder(savedSnippets);
|
||||
snippetsRef.current = orderedSnippets;
|
||||
setSnippets(orderedSnippets);
|
||||
// Merge any INITIAL_SNIPPETS entries the user doesn't have yet.
|
||||
// This lets pre-built script catalogs reach existing installations
|
||||
// without requiring users to clear storage.
|
||||
const existingIds = new Set(savedSnippets.map((s) => s.id));
|
||||
const missing = INITIAL_SNIPPETS.filter((s) => !existingIds.has(s.id));
|
||||
const merged = missing.length > 0
|
||||
? normalizeVaultOrder([...savedSnippets, ...missing])
|
||||
: normalizeVaultOrder(savedSnippets);
|
||||
if (missing.length > 0) {
|
||||
localStorageAdapter.write(STORAGE_KEY_SNIPPETS, merged);
|
||||
}
|
||||
snippetsRef.current = merged;
|
||||
setSnippets(merged);
|
||||
// Persist order backfill only when fields changed. Never rewrite the
|
||||
// pre-lock snapshot unlocked: another renderer can delete under the
|
||||
// vault lock after this read and before this write, resurrecting
|
||||
|
||||
Reference in New Issue
Block a user