diff --git a/docs/功能测试-监控设置.md b/docs/功能测试-监控设置.md new file mode 100644 index 00000000..5f855637 --- /dev/null +++ b/docs/功能测试-监控设置.md @@ -0,0 +1,15 @@ +# 功能测试任务列表 - 监控设置 + +> 路由:`/system_settings/system_monitoring/setting` + +| 序号 | 测试项 | 操作步骤 | 预期结果 | 结果 | +|---|---|---|---|---| +| 1 | 页面入口 | 从菜单进入“监控设置”,或直接访问路由 | 页面正常打开,表格展示监控编码、名称、IP、端口、版本和预警阈值字段 | ☐ | +| 2 | 条件查询 | 输入监控编码或监控名称后点击“查询” | 列表按条件刷新,分页回到第一页 | ☐ | +| 3 | 重置查询 | 输入查询条件后点击“重置” | 查询条件清空,列表恢复默认数据 | ☐ | +| 4 | 新增必填校验 | 点击“新增”,不填写编码、名称、IP 或端口直接确认 | 表单提示对应必填校验,不提交请求 | ☐ | +| 5 | 新增监控配置 | 填写编码、名称、IP、端口、刷新间隔、CPU/磁盘/内存阈值和 Python 版本后确认 | 弹窗关闭,提示操作成功,列表出现新增记录 | ☐ | +| 6 | 编辑监控配置 | 点击某条记录“编辑”,修改名称或阈值后确认 | 弹窗回显旧值,保存后列表展示新值 | ☐ | +| 7 | 删除取消 | 点击“删除”后在确认框选择取消 | 数据不删除,列表保持不变 | ☐ | +| 8 | 删除确认 | 点击“删除”后确认 | 提示操作成功,记录从列表移除,分页数量正确刷新 | ☐ | +| 9 | 权限按钮 | 使用无新增/编辑/删除权限的账号进入页面 | 对应按钮不显示或不可操作 | ☐ | diff --git a/src/api/system-administration/monitoring-configuration.js b/src/api/system-administration/monitoring-configuration.js new file mode 100644 index 00000000..1f7643b9 --- /dev/null +++ b/src/api/system-administration/monitoring-configuration.js @@ -0,0 +1,43 @@ +import { request } from '@/api/_service' + +const BASE = 'system_settings/system_monitor/setting/' + +function apiParams (method, data = {}) { + return { + method: `system_settings_system_monitoring_setting_${method}`, + platform: 'background', + ...data + } +} + +export function getMonitoringConfigurationList (data) { + return request({ + url: BASE + 'list', + method: 'get', + params: apiParams('list', data) + }) +} + +export function createMonitoringConfiguration (data) { + return request({ + url: BASE + 'create', + method: 'post', + data: apiParams('create', data) + }) +} + +export function editMonitoringConfiguration (data) { + return request({ + url: BASE + 'edit', + method: 'post', + data: apiParams('edit', data) + }) +} + +export function deleteMonitoringConfiguration (data) { + return request({ + url: BASE + 'delete', + method: 'post', + data: apiParams('delete', data) + }) +} diff --git a/src/locales/en.json b/src/locales/en.json index be8473b2..9c98fd4c 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -2151,6 +2151,47 @@ "please_select": "Please select" } }, + "system_monitoring": { + "monitoring_configuration": { + "search": "Search", + "reset": "Reset", + "add": "Add", + "edit": "Edit", + "delete": "Delete", + "confirm": "Confirm", + "cancel": "Cancel", + "prompt": "Notice", + "operation": "Operation", + "operation_success": "Operation successful", + "confirm_operation": "Are you sure you want to perform this operation?", + "serial_number": "No.", + "monitor_code": "Monitor Code", + "monitor_name": "Monitor Name", + "ip_address": "IP Address", + "port": "Port", + "python_version": "Python Version", + "refresh_interval": "Refresh Interval", + "cpu_warning": "CPU Warning", + "disk_warning": "Disk Warning", + "memory_swap_warning": "Memory/Swap Warning", + "enter_monitor_code": "Please enter monitor code", + "enter_monitor_name": "Please enter monitor name", + "enter_ip_address": "Please enter IP address", + "enter_port": "Please enter port", + "enter_refresh_interval": "Please enter refresh interval", + "enter_disk_warning": "Please enter disk warning", + "enter_cpu_warning": "Please enter CPU warning", + "enter_memory_swap_warning": "Please enter memory/swap warning", + "enter_python_version": "Please enter Python version", + "please_enter_monitor_code": "Please enter monitor code", + "please_enter_monitor_name": "Please enter monitor name", + "please_enter_ip_address": "Please enter IP address", + "please_enter_port": "Please enter port", + "length_1_to_100": "Length must be 1-100 characters", + "add_monitor_config": "Add Monitoring Configuration", + "edit_monitor_config": "Edit Monitoring Configuration" + } + }, "system_utilities": { "api_logs": { "id": "ID", diff --git a/src/locales/zh-chs.json b/src/locales/zh-chs.json index 89f4395a..12864cef 100644 --- a/src/locales/zh-chs.json +++ b/src/locales/zh-chs.json @@ -2151,6 +2151,47 @@ "please_select": "请选择" } }, + "system_monitoring": { + "monitoring_configuration": { + "search": "查询", + "reset": "重置", + "add": "新增", + "edit": "编辑", + "delete": "删除", + "confirm": "确定", + "cancel": "取消", + "prompt": "提示", + "operation": "操作", + "operation_success": "操作成功", + "confirm_operation": "确定要执行该操作吗?", + "serial_number": "序号", + "monitor_code": "监控编码", + "monitor_name": "监控名称", + "ip_address": "IP地址", + "port": "端口", + "python_version": "Python版本", + "refresh_interval": "刷新间隔", + "cpu_warning": "CPU预警值", + "disk_warning": "磁盘预警值", + "memory_swap_warning": "内存/交换区预警值", + "enter_monitor_code": "请输入监控编码", + "enter_monitor_name": "请输入监控名称", + "enter_ip_address": "请输入IP地址", + "enter_port": "请输入端口", + "enter_refresh_interval": "请输入刷新间隔", + "enter_disk_warning": "请输入磁盘预警值", + "enter_cpu_warning": "请输入CPU预警值", + "enter_memory_swap_warning": "请输入内存/交换区预警值", + "enter_python_version": "请输入Python版本", + "please_enter_monitor_code": "请输入监控编码", + "please_enter_monitor_name": "请输入监控名称", + "please_enter_ip_address": "请输入IP地址", + "please_enter_port": "请输入端口", + "length_1_to_100": "长度在 1 到 100 个字符", + "add_monitor_config": "新增监控配置", + "edit_monitor_config": "编辑监控配置" + } + }, "system_utilities": { "api_logs": { "id": "ID", diff --git a/src/router/modules/system-administration.js b/src/router/modules/system-administration.js index c52ed664..c8206ffa 100644 --- a/src/router/modules/system-administration.js +++ b/src/router/modules/system-administration.js @@ -49,6 +49,12 @@ export default { name: `${pre}system_assistant-problem_help`, meta: { ...meta, cache: true, title: '问题帮助' }, component: _import('system-administration/system-utilities/problem-help') + }, + { + path: 'system_monitoring/setting', + name: `${pre}system_monitoring-setting`, + meta: { ...meta, cache: true, title: '监控设置' }, + component: _import('system-administration/system-monitoring/monitoring-configuration') } ])('system_settings-') } diff --git a/src/views/system-administration/system-monitoring/monitoring-configuration/index.vue b/src/views/system-administration/system-monitoring/monitoring-configuration/index.vue new file mode 100644 index 00000000..23881d08 --- /dev/null +++ b/src/views/system-administration/system-monitoring/monitoring-configuration/index.vue @@ -0,0 +1,194 @@ + + + + +