feat: 新增设备巡检模块实现完整的巡检告警功能
新增设备巡检模块核心功能,包括: - 巡检数据存储与调度系统 - 华为/H3C交换机及Linux服务器采集器 - 设备扩展配置与告警规则管理 - 主机详情页巡检配置入口 - 产品名称自定义设置功能 - 网络设备SSH exec通道兼容处理
This commit is contained in:
@@ -3,7 +3,31 @@ import { Host, Snippet } from '../../domain/models';
|
||||
export const INITIAL_HOSTS: Host[] = [];
|
||||
|
||||
export const INITIAL_SNIPPETS: Snippet[] = [
|
||||
{ id: '1', label: 'Check Disk Space', command: 'df -h', tags: [] },
|
||||
{ id: '2', label: 'Tail System Log', command: 'tail -f /var/log/syslog', tags: [] },
|
||||
{ id: '3', label: 'Update Ubuntu', command: 'sudo apt update && sudo apt upgrade -y', tags: [] },
|
||||
// === 服务器系统 ===
|
||||
{ id: 'sys-df', label: '磁盘使用', command: 'df -h', tags: ['系统'] },
|
||||
{ id: 'sys-free', label: '内存使用', command: 'free -h', tags: ['系统'] },
|
||||
{ id: 'sys-uptime', label: '运行时长', command: 'uptime', tags: ['系统'] },
|
||||
{ id: 'sys-top', label: '进程快照', command: 'top -b -n1 | head -20', tags: ['系统'] },
|
||||
{ id: 'sys-ss', label: '端口监听', command: 'sudo ss -tulpn', tags: ['系统'] },
|
||||
{ id: 'sys-failed', label: '失败服务', command: 'sudo systemctl --failed', tags: ['系统'] },
|
||||
{ id: 'sys-journal', label: '最近日志', command: 'journalctl -n 50 --no-pager', tags: ['系统'] },
|
||||
|
||||
// === 网络诊断 ===
|
||||
{ id: 'net-ping', label: '连通性测试', command: 'ping -c 4 8.8.8.8', tags: ['网络'] },
|
||||
{ id: 'net-trace', label: '路由追踪', command: 'traceroute 8.8.8.8', tags: ['网络'] },
|
||||
{ id: 'net-dns', label: 'DNS 解析', command: 'nslookup google.com', tags: ['网络'] },
|
||||
{ id: 'net-ip', label: '网卡详情', command: 'ip addr show', tags: ['网络'] },
|
||||
{ id: 'net-fw', label: '防火墙规则', command: 'sudo iptables -L -n --line-numbers', tags: ['网络'] },
|
||||
|
||||
// === Docker ===
|
||||
{ id: 'dk-ps', label: '容器列表', command: 'docker ps -a', tags: ['Docker'] },
|
||||
{ id: 'dk-img', label: '镜像列表', command: 'docker images', tags: ['Docker'] },
|
||||
{ id: 'dk-stats', label: '资源使用', command: 'docker stats --no-stream', tags: ['Docker'] },
|
||||
{ id: 'dk-df', label: '磁盘占用', command: 'docker system df', tags: ['Docker'] },
|
||||
{ id: 'dk-prune', label: '清理无用', command: 'docker system prune -af', tags: ['Docker'] },
|
||||
|
||||
// === 更新 / 维护 ===
|
||||
{ id: 'upd-apt', label: 'Ubuntu 更新', command: 'sudo apt update && sudo apt upgrade -y', tags: ['更新'] },
|
||||
{ id: 'upd-yum', label: 'CentOS/RHEL 更新', command: 'sudo yum update -y', tags: ['更新'] },
|
||||
{ id: 'upd-tail-log', label: '实时系统日志', command: 'tail -f /var/log/syslog', tags: ['系统'] },
|
||||
];
|
||||
|
||||
@@ -3,7 +3,7 @@ export type LocaleOption = {
|
||||
label: string;
|
||||
};
|
||||
|
||||
export const DEFAULT_UI_LOCALE = 'en';
|
||||
export const DEFAULT_UI_LOCALE = 'zh-CN';
|
||||
|
||||
// Add new languages by appending to this list and providing message dictionaries.
|
||||
export const SUPPORTED_UI_LOCALES: LocaleOption[] = [
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/** User-editable product name shown in window title / about. */
|
||||
export const STORAGE_KEY_PRODUCT_NAME = 'netcatty_product_name_v1';
|
||||
|
||||
export const STORAGE_KEY_HOSTS = 'netcatty_hosts_v1';
|
||||
export const STORAGE_KEY_KEYS = 'netcatty_keys_v1';
|
||||
export const STORAGE_KEY_GROUPS = 'netcatty_groups_v1';
|
||||
|
||||
Reference in New Issue
Block a user