diff --git a/config/mml/omc/omc_mml_config.yaml b/config/mml/omc/omc_mml_config.yaml index 238061be..fb89a6ae 100644 --- a/config/mml/omc/omc_mml_config.yaml +++ b/config/mml/omc/omc_mml_config.yaml @@ -1060,4 +1060,20 @@ omc: apostr: "true" filter: "" display: "Log time(<=)" - comment: "" \ No newline at end of file + comment: "" + systemCommand: + display: "Linux System Command" + mml: + - operation: "run" + object: "shell" + display: "Run Shell Command" + params: + - name: "cmd" + alias: "cmd" + type: "string" + optional: "false" + apostr: "true" + loc: "false" + filter: "" + display: "Shell command" + comment: "" \ No newline at end of file diff --git a/config/mml_map/http_mml_map.json b/config/mml_map/http_mml_map.json index 4882ddb4..d4c11caa 100644 --- a/config/mml_map/http_mml_map.json +++ b/config/mml_map/http_mml_map.json @@ -972,4 +972,10 @@ { "bodyFmt": "PutDB", "bodyKey": "ne_license" +} + +{ + "bodyFmt": "PutDB", + "bodyKey": "shell", + "callFunc": "RunShellCommand" } \ No newline at end of file diff --git a/database/upgrade/menu.sql b/database/upgrade/menu.sql index 77ddcc78..d8ab9f5e 100644 --- a/database/upgrade/menu.sql +++ b/database/upgrade/menu.sql @@ -11,7 +11,7 @@ Target Server Version : 100338 (10.3.38-MariaDB) File Encoding : 65001 - Date: 16/08/2023 11:43:39 + Date: 18/08/2023 10:39:42 */ SET NAMES utf8mb4; @@ -29,7 +29,7 @@ CREATE TABLE `menu` ( `lang_tag` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, `menu_json` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 59 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; +) ENGINE = InnoDB AUTO_INCREMENT = 61 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of menu @@ -67,13 +67,15 @@ INSERT INTO `menu` VALUES (47, 'test', 'traceManagement', 6, 'cn', '{\r\n \"id\" INSERT INTO `menu` VALUES (48, 'test', 'logManagement', 7, 'cn', '{\r\n \"id\": 1,\r\n \"href\": null,\r\n \"icon\": \"fa fa-newspaper-o\",\r\n \"child\": [{\r\n \"id\": 2,\r\n \"href\": \"page/log/operLogList.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"操作日志\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }, {\r\n \"id\": 8,\r\n \"href\": \"page/log/nbiOperLogList.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"北向操作日志\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }, {\r\n \"id\": 0,\r\n \"href\": \"page/log/mmlOperLogList.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"mml操作日志\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }, {\r\n \"id\": 4,\r\n \"href\": \"page/log/alarmLogList.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"告警日志\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n },{\r\n \"id\": 6,\r\n \"href\": \"page/log/securityLogList.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"安全日志\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n },{\r\n \"id\": 7,\r\n \"href\": \"page/log/forwardingLog.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"告警前转日志\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n },{\r\n \"id\": 8,\r\n \"href\": \"page/log/nbiAlarmLog.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"北向告警日志\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }, {\r\n \"id\": 5,\r\n \"href\": \"page/log/logSet.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"日志通用管理\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }],\r\n \"title\": \"日志管理\",\r\n \"target\": null,\r\n \"parentId\": 0\r\n\r\n}'); INSERT INTO `menu` VALUES (49, 'test', 'securityManagement', 8, 'cn', '{\r\n \"id\": 1,\r\n \"href\": null,\r\n \"icon\": \"fa fa-users\",\r\n \"child\": [\r\n {\r\n \"id\": 2,\r\n \"href\": \"page/user/list.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"用户管理\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n },{\r\n \"id\": 3,\r\n \"href\": \"page/user/online.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"在线状态\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n },{\r\n \"id\": 4,\r\n \"href\": \"page/group/list.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"用户组管理\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }\r\n ],\r\n \"title\": \"安全管理\",\r\n \"target\": null,\r\n \"parentId\": 0\r\n}'); INSERT INTO `menu` VALUES (50, 'omc', 'topologyManagement', 1, 'cn', '{\r\n \"id\": 1,\r\n \"href\": null,\r\n \"icon\": \"fa fa-home\",\r\n \"child\": [\r\n {\r\n \"id\": 3,\r\n \"href\": \"page/main/main.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"网元状态\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n },\r\n {\r\n \"id\": 4,\r\n \"href\": \"page/system/performanceCount.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"运行统计\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }\r\n ],\r\n \"title\": \"系统状态\",\r\n \"target\": null,\r\n \"parentId\": 0\r\n}'); -INSERT INTO `menu` VALUES (51, 'omc', 'faultManagement', 2, 'cn', '{\r\n \"id\": 1,\r\n \"href\": \"\",\r\n \"icon\": \"fa fa-wrench\",\r\n \"child\": [{\r\n \"id\": 2,\r\n \"href\": \"page/alarm/alarmListDown.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"活动告警\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }, {\r\n \"id\": 3,\r\n \"href\": \"page/alarm/AlarmListHistory.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"历史告警\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }, {\r\n \"id\": 4,\r\n \"href\": \"page/alarm/alarmInfoConfig.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"告警设置\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n } ,{\r\n \"id\": 6,\r\n \"href\": \"page/alarm/synchronous.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"定时同步设置\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n },{\r\n \"id\": 5,\r\n \"href\": \"page/alarm/alarmForwarding.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"告警前转\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }],\r\n \"title\": \"故障管理\",\r\n \"target\": null,\r\n \"parentId\": 0\r\n}'); +INSERT INTO `menu` VALUES (51, 'omc', 'faultManagement', 2, 'cn', '{\r\n \"id\": 1,\r\n \"href\": \"\",\r\n \"icon\": \"fa fa-wrench\",\r\n \"child\": [{\r\n \"id\": 2,\r\n \"href\": \"page/alarm/alarmListDown.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"活动告警\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }, {\r\n \"id\": 3,\r\n \"href\": \"page/alarm/AlarmListHistory.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"历史告警\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }, {\r\n \"id\": 4,\r\n \"href\": \"page/alarm/alarmInfoConfig.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"故障通用设置\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n } ,{\r\n \"id\": 6,\r\n \"href\": \"page/alarm/synchronous.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"定时同步设置\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n },{\r\n \"id\": 7,\r\n \"href\": \"page/alarm/healthCheck.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"健康状态检查\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n },{\r\n \"id\": 5,\r\n \"href\": \"page/alarm/alarmForwarding.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"告警前转\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }],\r\n \"title\": \"故障管理\",\r\n \"target\": null,\r\n \"parentId\": 0\r\n}'); INSERT INTO `menu` VALUES (52, 'omc', 'systemManagement', 3, 'cn', '{\r\n \"id\": 1,\r\n \"href\": null,\r\n \"icon\": \"fa fa-pencil-square-o\",\r\n \"child\": [{\r\n \"id\": 2,\r\n \"href\": \"page/nfManage/list.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"网元管理\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }, {\r\n \"id\": 3,\r\n \"href\": \"page/configParam/list.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"参数配置\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }, {\r\n \"id\": 4,\r\n \"href\": \"page/softwareManage/softwareManage.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"软件管理\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }, {\r\n \"id\": 5,\r\n \"href\": \"page/softwareManage/backupManage.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"备份管理\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }],\r\n \"title\": \"配置管理\",\r\n \"target\": null,\r\n \"parentId\": 0\r\n}'); -INSERT INTO `menu` VALUES (53, 'omc', 'performanceManagement', 4, 'cn', '{\r\n \"id\": 1,\r\n \"href\": null,\r\n \"icon\": \"fa fa-line-chart\",\r\n \"child\": [{\r\n \"id\": 1,\r\n \"href\": \"page/task/list.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"任务管理\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }, {\r\n \"id\": 2,\r\n \"href\": \"page/repair/list.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"性能数据\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }, {\r\n \"id\": 5,\r\n \"href\": \"page/task/perfReport.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"性能报表\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n },\r\n {\r\n \"id\": 4,\r\n \"href\": \"page/task/threshold.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"性能门限\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n },{\r\n \"id\": 6,\r\n \"href\": \"page/gold/list.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"黄金指标\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n },{\r\n \"id\": 7,\r\n \"href\": \"page/task/perfReportSet.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"性能通用设置\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n },{\r\n \"id\": 8,\r\n \"href\": \"page/indicators/list.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"自定义指标\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }\r\n ],\r\n \"title\": \"性能管理\",\r\n \"target\": null,\r\n \"parentId\": 0\r\n}'); -INSERT INTO `menu` VALUES (54, 'omc', 'operationMaintenance', 5, 'cn', '{\r\n \"id\": 1,\r\n \"title\": \"操作维护\",\r\n \"icon\": \"fa fa-gear\",\r\n \"href\": null,\r\n \"target\": null,\r\n \"parentId\": 0,\r\n \"child\": [\r\n{\r\n \"id\": 4,\r\n \"title\": \"操作维护MML\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"href\": \"page/mml/omcList.html\",\r\n \"target\": null,\r\n \"parentId\": 1,\r\n \"child\": null\r\n },\r\n \r\n {\r\n \"id\": 2,\r\n \"title\": \"网元操作MML\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"href\": \"page/mml/list.html\",\r\n \"target\": null,\r\n \"parentId\": 1,\r\n \"child\": null\r\n },\r\n {\r\n \"id\": 3,\r\n \"title\": \"用户数据MML\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"href\": \"page/mml/udmList.html\",\r\n \"target\": null,\r\n \"parentId\": 1,\r\n \"child\": null\r\n }\r\n ]\r\n}'); +INSERT INTO `menu` VALUES (53, 'omc', 'performanceManagement', 4, 'cn', '{\r\n \"id\": 1,\r\n \"href\": null,\r\n \"icon\": \"fa fa-line-chart\",\r\n \"child\": [{\r\n \"id\": 1,\r\n \"href\": \"page/task/list.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"任务管理\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }, {\r\n \"id\": 2,\r\n \"href\": \"page/repair/list.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"性能数据\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }, {\r\n \"id\": 5,\r\n \"href\": \"page/task/perfReport.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"性能报表\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n },\r\n {\r\n \"id\": 4,\r\n \"href\": \"page/task/threshold.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"性能门限\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n },{\r\n \"id\": 6,\r\n \"href\": \"page/gold/list.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"黄金指标\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n },{\r\n \"id\": 7,\r\n \"href\": \"page/task/perfReportSet.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"性能通用设置\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n },{\r\n \"id\": 8,\r\n \"href\": \"page/indicators/list.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"自定义指标\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n },{\r\n \"id\": 9,\r\n \"href\": \"page/objectTemplate/list.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"对象模板\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }\r\n ],\r\n \"title\": \"性能管理\",\r\n \"target\": null,\r\n \"parentId\": 0\r\n}'); +INSERT INTO `menu` VALUES (54, 'omc', 'operationMaintenance', 5, 'cn', '{\r\n \"id\": 1,\r\n \"title\": \"操作维护\",\r\n \"icon\": \"fa fa-gear\",\r\n \"href\": null,\r\n \"target\": null,\r\n \"parentId\": 0,\r\n \"child\": [\r\n{\r\n \"id\": 4,\r\n \"title\": \"操作维护MML\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"href\": \"page/mml/omcList.html\",\r\n \"target\": null,\r\n \"parentId\": 1,\r\n \"child\": null\r\n },\r\n \r\n {\r\n \"id\": 2,\r\n \"title\": \"网元操作MML\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"href\": \"page/mml/list.html\",\r\n \"target\": null,\r\n \"parentId\": 1,\r\n \"child\": null\r\n },\r\n {\r\n \"id\": 3,\r\n \"title\": \"用户数据MML\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"href\": \"page/mml/udmList.html\",\r\n \"target\": null,\r\n \"parentId\": 1,\r\n \"child\": null\r\n },\r\n {\r\n \"id\": 4,\r\n \"title\": \"操作维护设置\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"href\": \"page/mml/mmlSet.html\",\r\n \"target\": null,\r\n \"parentId\": 1,\r\n \"child\": null\r\n }\r\n ]\r\n}'); INSERT INTO `menu` VALUES (55, 'omc', 'traceManagement', 6, 'cn', '{\r\n \"id\": 1,\r\n \"title\": \"跟踪管理\",\r\n \"icon\": \"fa fa-home\",\r\n \"href\": null,\r\n \"target\": null,\r\n \"parentId\": 0,\r\n \"child\": [{\r\n \"id\": 2,\r\n \"title\": \"跟踪任务\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"href\": \"page/trace/taskList.html\",\r\n \"target\": null,\r\n \"parentId\": 1,\r\n \"child\": null\r\n },\r\n {\r\n \"id\": 3,\r\n \"title\": \"信令分析\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"href\": \"page/trace/traceShow.html\",\r\n \"target\": null,\r\n \"parentId\": 1,\r\n \"child\": null\r\n }\r\n ]\r\n}'); -INSERT INTO `menu` VALUES (56, 'omc', 'logManagement', 7, 'cn', '{\r\n \"id\": 1,\r\n \"href\": null,\r\n \"icon\": \"fa fa-newspaper-o\",\r\n \"child\": [{\r\n \"id\": 2,\r\n \"href\": \"page/log/operLogList.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"操作日志\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }, {\r\n \"id\": 8,\r\n \"href\": \"page/log/nbiOperLogList.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"北向操作日志\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }, {\r\n \"id\": 0,\r\n \"href\": \"page/log/mmlOperLogList.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"mml操作日志\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }, {\r\n \"id\": 4,\r\n \"href\": \"page/log/alarmLogList.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"告警日志\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n },{\r\n \"id\": 6,\r\n \"href\": \"page/log/securityLogList.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"安全日志\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n },{\r\n \"id\": 7,\r\n \"href\": \"page/log/forwardingLog.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"告警前转日志\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n },{\r\n \"id\": 8,\r\n \"href\": \"page/log/nbiAlarmLog.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"北向告警日志\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }, {\r\n \"id\": 5,\r\n \"href\": \"page/log/logSet.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"日志通用管理\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }],\r\n \"title\": \"日志管理\",\r\n \"target\": null,\r\n \"parentId\": 0\r\n\r\n}'); +INSERT INTO `menu` VALUES (56, 'omc', 'logManagement', 7, 'cn', '{\r\n \"id\": 1,\r\n \"href\": null,\r\n \"icon\": \"fa fa-newspaper-o\",\r\n \"child\": [{\r\n \"id\": 2,\r\n \"href\": \"page/log/operLogList.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"操作日志\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }, {\r\n \"id\": 0,\r\n \"href\": \"page/log/mmlOperLogList.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"mml操作日志\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }, {\r\n \"id\": 4,\r\n \"href\": \"page/log/alarmLogList.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"告警日志\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n },{\r\n \"id\": 6,\r\n \"href\": \"page/log/securityLogList.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"安全日志\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n },{\r\n \"id\": 7,\r\n \"href\": \"page/log/forwardingLog.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"告警前转日志\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }, {\r\n \"id\": 5,\r\n \"href\": \"page/log/logSet.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"日志通用管理\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }],\r\n \"title\": \"日志管理\",\r\n \"target\": null,\r\n \"parentId\": 0\r\n\r\n}'); INSERT INTO `menu` VALUES (57, 'omc', 'securityManagement', 8, 'cn', '{\r\n \"id\": 1,\r\n \"href\": null,\r\n \"icon\": \"fa fa-users\",\r\n \"child\": [\r\n {\r\n \"id\": 2,\r\n \"href\": \"page/user/list.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"用户管理\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n },{\r\n \"id\": 3,\r\n \"href\": \"page/user/online.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"在线状态\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n },{\r\n \"id\": 4,\r\n \"href\": \"page/group/list.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"用户组管理\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }\r\n ],\r\n \"title\": \"安全管理\",\r\n \"target\": null,\r\n \"parentId\": 0\r\n}'); INSERT INTO `menu` VALUES (58, 'udm', 'operationMaintenance', 1, 'cn', '{\r\n \"id\": 1,\r\n \"title\": \"操作维护\",\r\n \"icon\": \"fa fa-gear\",\r\n \"href\": null,\r\n \"target\": null,\r\n \"parentId\": 0,\r\n \"child\": [\r\n{\r\n \"id\": 4,\r\n \"title\": \"操作维护MML\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"href\": \"page/mml/omcList.html\",\r\n \"target\": null,\r\n \"parentId\": 1,\r\n \"child\": null\r\n },\r\n \r\n {\r\n \"id\": 2,\r\n \"title\": \"网元操作MML\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"href\": \"page/mml/list.html\",\r\n \"target\": null,\r\n \"parentId\": 1,\r\n \"child\": null\r\n },\r\n {\r\n \"id\": 3,\r\n \"title\": \"用户数据MML\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"href\": \"page/mml/udmList.html\",\r\n \"target\": null,\r\n \"parentId\": 1,\r\n \"child\": null\r\n }\r\n ]\r\n}'); +INSERT INTO `menu` VALUES (59, 'omc', 'nbiManagement', 9, 'cn', '{\r\n \"id\": 1,\r\n \"href\": null,\r\n \"icon\": \"fa fa-newspaper-o\",\r\n \"child\": [ {\r\n \"id\": 1,\r\n \"href\": \"page/log/nbiOperLogList.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"北向操作日志\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n },{\r\n \"id\": 2,\r\n \"href\": \"page/log/nbiAlarmLog.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"北向告警日志\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }, {\r\n \"id\": 3,\r\n \"href\": \"page/log/nbiSet.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"北向通用设置\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }],\r\n \"title\": \"北向管理\",\r\n \"target\": null,\r\n \"parentId\": 0\r\n\r\n}\r\n\r\n\r\n\r\n'); +INSERT INTO `menu` VALUES (60, 'omc', 'systemManage', 10, 'cn', '{\r\n \"id\": 1,\r\n \"href\": null,\r\n \"icon\": \"fa fa-newspaper-o\",\r\n \"child\": [ {\r\n \"id\": 1,\r\n \"href\": \"page/systemManage/systemOperation.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"系统维护\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n },{\r\n \"id\": 2,\r\n \"href\": \"page/systemManage/stabilityEvents.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"稳定性事件列表\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n },{\r\n \"id\": 2,\r\n \"href\": \"page/systemManage/stabilityReports.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"稳定性统计报告\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n },{\r\n \"id\": 3,\r\n \"href\": \"page/systemManage/systemBackup.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"系统备份\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n },{\r\n \"id\": 3,\r\n \"href\": \"page/systemManage/systemExtended.html\",\r\n \"icon\": \"fa fa-caret-right\",\r\n \"child\": null,\r\n \"title\": \"系统可扩展\",\r\n \"target\": null,\r\n \"parentId\": 1\r\n }],\r\n \"title\": \"系统管理\",\r\n \"target\": null,\r\n \"parentId\": 0\r\n\r\n}'); SET FOREIGN_KEY_CHECKS = 1; diff --git a/database/upgrade/ne_check.sql b/database/upgrade/ne_check.sql new file mode 100644 index 00000000..f1cb5158 --- /dev/null +++ b/database/upgrade/ne_check.sql @@ -0,0 +1,38 @@ +/* + Navicat Premium Data Transfer + + Source Server : local_mariadb + Source Server Type : MariaDB + Source Server Version : 100338 (10.3.38-MariaDB) + Source Host : localhost:33066 + Source Schema : omc_db + + Target Server Type : MariaDB + Target Server Version : 100338 (10.3.38-MariaDB) + File Encoding : 65001 + + Date: 18/08/2023 10:13:05 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for ne_check +-- ---------------------------- +DROP TABLE IF EXISTS `ne_check`; +CREATE TABLE `ne_check` ( + `id` int(10) NOT NULL, + `status` tinyint(4) NULL DEFAULT NULL COMMENT '//0-不健康 1-健康', + `result` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `create_time` datetime NULL DEFAULT NULL, + `ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of ne_check +-- ---------------------------- +INSERT INTO `ne_check` VALUES (1, 1, '\"很健康\"', '2023-08-17 21:32:34', NULL); + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/database/upgrade/ne_license.sql b/database/upgrade/ne_license.sql new file mode 100644 index 00000000..849bf4bc --- /dev/null +++ b/database/upgrade/ne_license.sql @@ -0,0 +1,50 @@ +/* + Navicat Premium Data Transfer + + Source Server : local_mariadb + Source Server Type : MariaDB + Source Server Version : 100338 (10.3.38-MariaDB) + Source Host : localhost:33066 + Source Schema : omc_db + + Target Server Type : MariaDB + Target Server Version : 100338 (10.3.38-MariaDB) + File Encoding : 65001 + + Date: 18/08/2023 09:56:17 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for ne_license +-- ---------------------------- +DROP TABLE IF EXISTS `ne_license`; +CREATE TABLE `ne_license` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `ne_type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `ne_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '', + `serial_no` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `capcity` int(11) NULL DEFAULT NULL, + `used` int(11) NULL DEFAULT NULL, + `feature_enabled` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `expiration_date` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `status` enum('ACTIVE','INACTIVE','PENDING') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `created_at` datetime NULL DEFAULT current_timestamp() ON UPDATE CURRENT_TIMESTAMP, + `updated_at` datetime NULL DEFAULT NULL, + `deleted_at` datetime NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 17 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of ne_license +-- ---------------------------- +INSERT INTO `ne_license` VALUES (1, 'AMF', 'SZ_01', '13750350', 50000, 2, '[N1 N2 N8 N11 N12 N14 N15]', '2023-10-31', 'ACTIVE', '2023-08-18 09:56:06', '2023-08-17 23:38:53', NULL); +INSERT INTO `ne_license` VALUES (2, 'SMF', 'SZ_01', '13750350', 50000, 2, '[N4 N7 N10 N11]', '2023-10-31', 'ACTIVE', '2023-08-18 09:56:06', NULL, NULL); +INSERT INTO `ne_license` VALUES (3, 'AUSF', 'SZ_01', '13750350', 50000, 2, '[N12]', '2023-10-31', 'ACTIVE', '2023-08-18 09:56:06', NULL, NULL); +INSERT INTO `ne_license` VALUES (4, 'UDM', 'SZ_01', '13750350', 50000, 2, '[N8 N10 N13]', '2023-10-31', 'ACTIVE', '2023-08-18 09:56:06', '2023-08-17 23:38:53', NULL); +INSERT INTO `ne_license` VALUES (5, 'UPF', 'SZ_01', '13750350', 50000, 2, '[N3 N4 N6 N9]', '2023-10-31', 'ACTIVE', '2023-08-18 09:56:06', NULL, NULL); +INSERT INTO `ne_license` VALUES (6, 'AMF', 'SZ_02', '13750350', 50000, 2, '[N1 N2 N8 N11 N12 N14 N15]', '2023-10-31', 'ACTIVE', '2023-08-18 09:56:06', NULL, NULL); + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/lib/mmlp/parse.go b/lib/mmlp/parse.go index b9f18d3e..9626cefd 100644 --- a/lib/mmlp/parse.go +++ b/lib/mmlp/parse.go @@ -7,6 +7,7 @@ import ( "fmt" "math" "net/http" + "os/exec" "regexp" "strconv" "strings" @@ -425,6 +426,32 @@ func InstallLicense(mml *MmlCommand, omcMmlVar *MmlVar, outputJson *dborm.MmlOut return &output } +func RunShellCommand(mml *MmlCommand, omcMmlVar *MmlVar, outputJson *dborm.MmlOutput) *[]byte { + var output []byte + log.Debug("mml:", mml) + var command string + for _, Param := range mml.Params { + switch Param.Name { + case "netype": + command = Param.Value + default: + } + } + cmd := exec.Command("/bin/bash", "-c", command) + out, err := cmd.CombinedOutput() + log.Tracef("Exec output: %v", string(out)) + if err != nil { + log.Error("exe cmd error: ", err) + output = *ParseErrorOutput(err) + return &output + } else { + str := fmt.Sprintf("Run shell command: %s output:\n\n%v", command, string(out)) + output = []byte(str) + } + + return &output +} + func TransMml2HttpReq(omcMmlVar *MmlVar, mml *MmlCommand) (*[]byte, error) { log.Info("TransMml2HttpReq processing ...") log.Debug("mml: ", mml) @@ -510,6 +537,9 @@ func TransMml2HttpReq(omcMmlVar *MmlVar, mml *MmlCommand) (*[]byte, error) { case "InstallLicense": output = InstallLicense(mml, omcMmlVar, outputJson) return output, nil + case "RunShellCommand": + output = RunShellCommand(mml, omcMmlVar, outputJson) + return output, nil default: } diff --git a/tools/misc/tables_s.lst b/tools/misc/tables_s.lst index fc4f2ad7..3a8a7b7c 100644 --- a/tools/misc/tables_s.lst +++ b/tools/misc/tables_s.lst @@ -44,4 +44,5 @@ sys_perf_data sys_extended sys_backup pm_template -monitor_warn \ No newline at end of file +monitor_warn +ne_check \ No newline at end of file