feat: 新增设备巡检模块实现完整的巡检告警功能
新增设备巡检模块核心功能,包括: - 巡检数据存储与调度系统 - 华为/H3C交换机及Linux服务器采集器 - 设备扩展配置与告警规则管理 - 主机详情页巡检配置入口 - 产品名称自定义设置功能 - 网络设备SSH exec通道兼容处理
This commit is contained in:
@@ -6,6 +6,9 @@ const {
|
||||
verifyAppLockPassword,
|
||||
} = require("./appLockSettingsStore.cjs");
|
||||
|
||||
// 默认产品名称(可通过环境变量 NETCATTY_PRODUCT_NAME 覆盖)
|
||||
const DEFAULT_PRODUCT_NAME = process.env.NETCATTY_PRODUCT_NAME || "NetMesh";
|
||||
|
||||
function normalizeReason(reason) {
|
||||
return typeof reason === "string" && reason.trim() !== "" ? reason : null;
|
||||
}
|
||||
@@ -319,11 +322,12 @@ function createAppLockController({
|
||||
try {
|
||||
if (typeof win.getTitle === "function") {
|
||||
const currentTitle = win.getTitle();
|
||||
if (currentTitle && currentTitle !== "NetMesh") {
|
||||
lockedWindowTitles.set(win, currentTitle);
|
||||
if (currentTitle && currentTitle !== DEFAULT_PRODUCT_NAME) {
|
||||
// 保留用户设置的自定义标题
|
||||
return;
|
||||
}
|
||||
}
|
||||
win.setTitle?.("NetMesh");
|
||||
win.setTitle?.(DEFAULT_PRODUCT_NAME);
|
||||
if (win.webContents?.isDevToolsOpened?.()) {
|
||||
win.webContents.closeDevTools?.();
|
||||
}
|
||||
@@ -366,11 +370,11 @@ function createAppLockController({
|
||||
|
||||
function setWindowTitle(win, title) {
|
||||
if (!win || win.isDestroyed?.()) return false;
|
||||
const nextTitle = typeof title === "string" && title.trim() ? title.trim() : "NetMesh";
|
||||
const nextTitle = typeof title === "string" && title.trim() ? title.trim() : DEFAULT_PRODUCT_NAME;
|
||||
try {
|
||||
if (getRuntimeState()?.locked === true) {
|
||||
lockedWindowTitles.set(win, nextTitle);
|
||||
win.setTitle?.("NetMesh");
|
||||
win.setTitle?.(DEFAULT_PRODUCT_NAME);
|
||||
return false;
|
||||
}
|
||||
win.setTitle?.(nextTitle);
|
||||
@@ -388,8 +392,8 @@ function createAppLockController({
|
||||
|
||||
for (const [win, title] of lockedWindowTitles) {
|
||||
try {
|
||||
if (!win.isDestroyed?.() && win.getTitle?.() === "Netcatty") {
|
||||
win.setTitle?.(title || "Netcatty");
|
||||
if (!win.isDestroyed?.() && win.getTitle?.() === DEFAULT_PRODUCT_NAME) {
|
||||
win.setTitle?.(title || DEFAULT_PRODUCT_NAME);
|
||||
}
|
||||
} catch {
|
||||
// ignore disposed windows during unlock
|
||||
|
||||
Reference in New Issue
Block a user