Merge remote-tracking branch 'origin/main' into multi-tenant
This commit is contained in:
@@ -22,15 +22,15 @@ CREATE TABLE `kpi_c_title` (
|
|||||||
|
|
||||||
INSERT INTO `kpi_c_title` VALUES (1, 'AMF', 'AMF.C.01', 'Regstration Success Rate', '(\'AMF.03\'/\'AMF.02\')*100', '%', 'Active', '', 'admin', '2024-12-12 19:27:32');
|
INSERT INTO `kpi_c_title` VALUES (1, 'AMF', 'AMF.C.01', 'Regstration Success Rate', '(\'AMF.03\'/\'AMF.02\')*100', '%', 'Active', '', 'admin', '2024-12-12 19:27:32');
|
||||||
INSERT INTO `kpi_c_title` VALUES (2, 'AMF', 'AMF.C.02', 'Paging Success Rate', '((\'AMF.15\'+\'AMF.16\')/\'AMF.17\')*100', '%', 'Active', '', 'admin', '2024-12-12 19:28:34');
|
INSERT INTO `kpi_c_title` VALUES (2, 'AMF', 'AMF.C.02', 'Paging Success Rate', '((\'AMF.15\'+\'AMF.16\')/\'AMF.17\')*100', '%', 'Active', '', 'admin', '2024-12-12 19:28:34');
|
||||||
INSERT INTO `kpi_c_title` VALUES (3, 'AMF', 'AMF.C.03', 'Service Request Success Rate', '((1-\'AMF.18\')/\'AMF.19\')*100', '%', 'Active', '', 'admin', '2024-12-12 19:31:31');
|
INSERT INTO `kpi_c_title` VALUES (3, 'AMF', 'AMF.C.03', 'Service Request Success Rate', '(1-\'AMF.18\'/\'AMF.19\')*100', '%', 'Active', '', 'admin', '2024-12-12 19:31:31');
|
||||||
INSERT INTO `kpi_c_title` VALUES (4, 'AMF', 'AMF.C.04', '5G Register Subscriber', '\'AMF.01\'', ' ', 'Active', '', 'admin', '2024-12-12 19:32:16');
|
INSERT INTO `kpi_c_title` VALUES (4, 'AMF', 'AMF.C.04', '5G Register Subscriber', '\'AMF.01\'', ' ', 'Active', '', 'admin', '2024-12-12 19:32:16');
|
||||||
INSERT INTO `kpi_c_title` VALUES (5, 'SMF', 'SMF.C.01', 'SA_MeanPduSession', '\'SMF.01\'', ' ', 'Active', '', 'admin', '2024-12-12 19:32:45');
|
INSERT INTO `kpi_c_title` VALUES (5, 'SMF', 'SMF.C.01', 'SA_MeanPduSession', '\'SMF.01\'', ' ', 'Active', '', 'admin', '2024-12-12 19:32:45');
|
||||||
INSERT INTO `kpi_c_title` VALUES (6, 'SMF', 'SMF.C.02', 'PDU Session Establishment Success Rate', '(\'SMF.02\'/\'SMF.03\')*100', '%', 'Active', '', 'admin', '2024-12-12 19:33:27');
|
INSERT INTO `kpi_c_title` VALUES (6, 'SMF', 'SMF.C.02', 'PDU Session Establishment Success Rate', '(\'SMF.02\'/\'SMF.03\')*100', '%', 'Active', '', 'admin', '2024-12-12 19:33:27');
|
||||||
INSERT INTO `kpi_c_title` VALUES (7, 'SMF', 'SMF.C.03', 'IMS Session Establishment Success Rate', '(\'SMF.04\'/\'SMF.05\')*100', '%', 'Active', '', 'admin', '2024-12-12 19:34:07');
|
INSERT INTO `kpi_c_title` VALUES (7, 'SMF', 'SMF.C.03', 'IMS Session Establishment Success Rate', '(\'SMF.04\'/\'SMF.05\')*100', '%', 'Active', '', 'admin', '2024-12-12 19:34:07');
|
||||||
INSERT INTO `kpi_c_title` VALUES (8, 'MME', 'MME.C.01', 'Attach Success Rate ', '(\'MME.A.02\'/\'MME.A.01\')*100', '%', 'Active', '', 'admin', '2024-12-12 20:26:09');
|
INSERT INTO `kpi_c_title` VALUES (8, 'MME', 'MME.C.01', 'Attach Success Rate ', '(\'MME.A.02\'/\'MME.A.01\')*100', '%', 'Active', '', 'admin', '2024-12-12 20:26:09');
|
||||||
INSERT INTO `kpi_c_title` VALUES (9, 'UPF', 'UPF.C.01', 'PFCP Establish Success Rate ', '(\'UPF.01\'/\'UPF.02\')*100', '%', 'Active', '', 'admin', '2024-12-12 20:26:40');
|
INSERT INTO `kpi_c_title` VALUES (9, 'UPF', 'UPF.C.01', 'PFCP Establish Success Rate ', '(\'UPF.01\'/\'UPF.02\')*100', '%', 'Active', '', 'admin', '2024-12-12 20:26:40');
|
||||||
INSERT INTO `kpi_c_title` VALUES (10, 'UPF', 'UPF.C.02', 'N6_Throughout', '(\'UPF.03\')*8/5/1000/1000', 'Mbps', 'Active', '', 'admin', '2024-12-12 20:27:24');
|
INSERT INTO `kpi_c_title` VALUES (10, 'UPF', 'UPF.C.02', 'N6_Uplink_Throughout', '(\'UPF.03\')*8/5/1000/1000', 'Mbps', 'Active', '', 'admin', '2025-01-20 09:26:06');
|
||||||
INSERT INTO `kpi_c_title` VALUES (11, 'UPF', 'UPF.C.03', 'N3_Throughout', '(\'UPF.06\')*8/5/1000/1000', 'Mbps', 'Active', '', 'admin', '2024-12-12 20:27:56');
|
INSERT INTO `kpi_c_title` VALUES (11, 'UPF', 'UPF.C.03', 'N3_Uplink_Throughout', '(\'UPF.06\')*8/5/1000/1000', 'Mbps', 'Active', '', 'admin', '2025-01-20 09:26:57');
|
||||||
INSERT INTO `kpi_c_title` VALUES (12, 'UDM', 'UDM.C.01', 'AMF_UECM_Success_Rate ', '(\'UDM.03\'/\'UDM.02\')*100', '%', 'Active', '', 'admin', '2024-12-12 20:28:47');
|
INSERT INTO `kpi_c_title` VALUES (12, 'UDM', 'UDM.C.01', 'AMF_UECM_Success_Rate ', '(\'UDM.03\'/\'UDM.02\')*100', '%', 'Active', '', 'admin', '2024-12-12 20:28:47');
|
||||||
INSERT INTO `kpi_c_title` VALUES (13, 'UDM', 'UDM.C.02', 'SMF_UECM_Success_Rate ', '(\'UDM.04\'/\'UDM.05\')*100', '%', 'Active', '', 'admin', '2024-12-12 20:29:06');
|
INSERT INTO `kpi_c_title` VALUES (13, 'UDM', 'UDM.C.02', 'SMF_UECM_Success_Rate ', '(\'UDM.04\'/\'UDM.05\')*100', '%', 'Active', '', 'admin', '2024-12-12 20:29:06');
|
||||||
INSERT INTO `kpi_c_title` VALUES (14, 'IMS', 'IMS.C.01', 'InitReg_Success_Rate', '(\'SCSCF.03\'/\'SCSCF.04\')*100', '%', 'Active', '', 'admin', '2024-12-12 20:29:44');
|
INSERT INTO `kpi_c_title` VALUES (14, 'IMS', 'IMS.C.01', 'InitReg_Success_Rate', '(\'SCSCF.03\'/\'SCSCF.04\')*100', '%', 'Active', '', 'admin', '2024-12-12 20:29:44');
|
||||||
@@ -39,5 +39,7 @@ INSERT INTO `kpi_c_title` VALUES (16, 'IMS', 'IMS.C.03', 'MT_Success_Rate', '(\'
|
|||||||
INSERT INTO `kpi_c_title` VALUES (17, 'IMS', 'IMS.C.04', 'Service_Success_Rate ', '((\'SCSCF.05\'+\'SCSCF.07\')/(\'SCSCF.06\'+\'SCSCF.08\'))*100', '%', 'Active', '', 'admin', '2024-12-12 20:31:41');
|
INSERT INTO `kpi_c_title` VALUES (17, 'IMS', 'IMS.C.04', 'Service_Success_Rate ', '((\'SCSCF.05\'+\'SCSCF.07\')/(\'SCSCF.06\'+\'SCSCF.08\'))*100', '%', 'Active', '', 'admin', '2024-12-12 20:31:41');
|
||||||
INSERT INTO `kpi_c_title` VALUES (18, 'SMF', 'SMF.C.06', 'IMS_DefaultBear_Success_Rate ', '(\'SMF.13\'/\'SMF.14\')*100', '%', 'Active', '', 'admin', '2024-12-13 10:49:00');
|
INSERT INTO `kpi_c_title` VALUES (18, 'SMF', 'SMF.C.06', 'IMS_DefaultBear_Success_Rate ', '(\'SMF.13\'/\'SMF.14\')*100', '%', 'Active', '', 'admin', '2024-12-13 10:49:00');
|
||||||
INSERT INTO `kpi_c_title` VALUES (19, 'SMF', 'SMF.C.07', 'Bear_Success_Rate_new', '((\'SMF.09\'+\'SMF.11\')/(\'SMF.10\'+\'SMF.12\') )*100', '%', 'Active', '', 'admin', '2024-12-13 11:16:04');
|
INSERT INTO `kpi_c_title` VALUES (19, 'SMF', 'SMF.C.07', 'Bear_Success_Rate_new', '((\'SMF.09\'+\'SMF.11\')/(\'SMF.10\'+\'SMF.12\') )*100', '%', 'Active', '', 'admin', '2024-12-13 11:16:04');
|
||||||
|
INSERT INTO `kpi_c_title` VALUES (22, 'UPF', 'UPF.C.06', 'N3_Downlink_Throughout', '(\'UPF.05\')*8/5/1000/1000', 'Mbps', 'Active', '', 'admin', '2025-01-15 02:53:32');
|
||||||
|
INSERT INTO `kpi_c_title` VALUES (23, 'UPF', 'UPF.C.07', 'N6_Downlink_Throughout', '(\'UPF.04\')*8/5/1000/1000', 'Mbps', 'Active', '', 'admin', '2025-01-15 02:53:32');
|
||||||
|
|
||||||
SET FOREIGN_KEY_CHECKS = 1;
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ INSERT INTO `sys_config` VALUES (108, 'config.sys.i18nOpen', 'sys.i18n.open', 't
|
|||||||
INSERT INTO `sys_config` VALUES (109, 'config.sys.i18nDefault', 'sys.i18n.default', 'en_US', 'Y', 'supervisor', 1700000000000, NULL, 0, 'config.sys.i18nDefaultRemark');
|
INSERT INTO `sys_config` VALUES (109, 'config.sys.i18nDefault', 'sys.i18n.default', 'en_US', 'Y', 'supervisor', 1700000000000, NULL, 0, 'config.sys.i18nDefaultRemark');
|
||||||
INSERT INTO `sys_config` VALUES (110, 'config.sys.lockTime', 'sys.lockTime', '0', 'Y', 'supervisor', 1704960008300, 'admin', 1706838764703, 'config.sys.lockTimeRemark');
|
INSERT INTO `sys_config` VALUES (110, 'config.sys.lockTime', 'sys.lockTime', '0', 'Y', 'supervisor', 1704960008300, 'admin', 1706838764703, 'config.sys.lockTimeRemark');
|
||||||
INSERT INTO `sys_config` VALUES (111, 'config.sys.homePage', 'sys.homePage', 'dashboard/overview/index', 'Y', 'supervisor', 1704960008300, 'admin', 1706838764703, 'config.sys.homePageRemark');
|
INSERT INTO `sys_config` VALUES (111, 'config.sys.homePage', 'sys.homePage', 'dashboard/overview/index', 'Y', 'supervisor', 1704960008300, 'admin', 1706838764703, 'config.sys.homePageRemark');
|
||||||
|
INSERT INTO `sys_config` VALUES (112, 'config.sys.exportTable', 'sys.exportTable', '43t6VAMQmdnt9ynWGJIR1ufeQOvr1doHDsjWUFT8JVzxTVEYgZ1Xvrk47JaPeCHMPKk9zLhJCU9MmA7JAWslQyWBLHzVOMUmA1ppIL1sVIkWGrdDiw0XuMdvXpUu/adrXHhqo42NP3hxcvwXvkWvgedezzCnUsvqfMt+Yw1Wick=', 'Y', 'supervisor', 1737355823940, 'supervisor', 1737363302083, 'config.sys.exportTableRemark');
|
||||||
|
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
|
|
||||||
|
|||||||
@@ -82,8 +82,8 @@ INSERT INTO `sys_dict_data` VALUES (1074, 1074, 'menu.trace.task', '网元跟踪
|
|||||||
INSERT INTO `sys_dict_data` VALUES (1075, 1075, 'menu.trace.analysis', '网元跟踪数据', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
INSERT INTO `sys_dict_data` VALUES (1075, 1075, 'menu.trace.analysis', '网元跟踪数据', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
INSERT INTO `sys_dict_data` VALUES (1076, 1076, 'menu.trace.pcap', '信令抓包', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
INSERT INTO `sys_dict_data` VALUES (1076, 1076, 'menu.trace.pcap', '信令抓包', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
INSERT INTO `sys_dict_data` VALUES (1077, 1077, 'menu.fault', '监控', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
INSERT INTO `sys_dict_data` VALUES (1077, 1077, 'menu.fault', '监控', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
-- INSERT INTO `sys_dict_data` VALUES (1078, 1078, 'menu.config.backupManageRemark', '备份管理菜单', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
INSERT INTO `sys_dict_data` VALUES (1078, 1078, 'config.sys.exportTable', '备份文件FTP服务', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
-- INSERT INTO `sys_dict_data` VALUES (1079, 1079, 'menu.config.softwareManageRemark', '软件管理菜单', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
INSERT INTO `sys_dict_data` VALUES (1079, 1079, 'config.sys.exportTableRemark', '请通过导出列表页面进行设置FTP信息', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
INSERT INTO `sys_dict_data` VALUES (1080, 1080, 'menu.ueUser.onlineIMSRemark', 'IMS在线用户菜单', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
INSERT INTO `sys_dict_data` VALUES (1080, 1080, 'menu.ueUser.onlineIMSRemark', 'IMS在线用户菜单', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
INSERT INTO `sys_dict_data` VALUES (1081, 1081, 'menu.ueUser.onlineUERemark', 'UE在线信息菜单', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
INSERT INTO `sys_dict_data` VALUES (1081, 1081, 'menu.ueUser.onlineUERemark', 'UE在线信息菜单', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
INSERT INTO `sys_dict_data` VALUES (1082, 1082, 'menu.ueUser.base5GRemark', '5G基站信息菜单', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
INSERT INTO `sys_dict_data` VALUES (1082, 1082, 'menu.ueUser.base5GRemark', '5G基站信息菜单', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
|
|||||||
@@ -82,8 +82,8 @@ INSERT INTO `sys_dict_data` VALUES (3074, 3074, 'menu.trace.task', 'NE Trace Tas
|
|||||||
INSERT INTO `sys_dict_data` VALUES (3075, 3075, 'menu.trace.analysis', 'NE Trace Task Data', 'i18n_en', '', '', '1', 'supervisor', 1700000000000, NULL, 0, '');
|
INSERT INTO `sys_dict_data` VALUES (3075, 3075, 'menu.trace.analysis', 'NE Trace Task Data', 'i18n_en', '', '', '1', 'supervisor', 1700000000000, NULL, 0, '');
|
||||||
INSERT INTO `sys_dict_data` VALUES (3076, 3076, 'menu.trace.pcap', 'Signaling Capture', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
INSERT INTO `sys_dict_data` VALUES (3076, 3076, 'menu.trace.pcap', 'Signaling Capture', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
INSERT INTO `sys_dict_data` VALUES (3077, 3077, 'menu.fault', 'Monitor', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
INSERT INTO `sys_dict_data` VALUES (3077, 3077, 'menu.fault', 'Monitor', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
-- INSERT INTO `sys_dict_data` VALUES (3078, 3078, 'menu.config.backupManageRemark', 'Backup Management Menu', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
INSERT INTO `sys_dict_data` VALUES (3078, 3078, 'config.sys.exportTable', 'Backup file FTP service', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
-- INSERT INTO `sys_dict_data` VALUES (3079, 3079, 'menu.config.softwareManageRemark', 'Software Management Menu', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
INSERT INTO `sys_dict_data` VALUES (3079, 3079, 'config.sys.exportTableRemark', 'Please set the FTP information through the export list page.', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
INSERT INTO `sys_dict_data` VALUES (3080, 3080, 'menu.ueUser.onlineIMSRemark', 'IMS Online User Menu', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
INSERT INTO `sys_dict_data` VALUES (3080, 3080, 'menu.ueUser.onlineIMSRemark', 'IMS Online User Menu', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
INSERT INTO `sys_dict_data` VALUES (3081, 3081, 'menu.ueUser.onlineUERemark', 'UE Online Information Menu', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
INSERT INTO `sys_dict_data` VALUES (3081, 3081, 'menu.ueUser.onlineUERemark', 'UE Online Information Menu', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
INSERT INTO `sys_dict_data` VALUES (3082, 3082, 'menu.ueUser.base5GRemark', '5G Base Station Information Menu', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
INSERT INTO `sys_dict_data` VALUES (3082, 3082, 'menu.ueUser.base5GRemark', '5G Base Station Information Menu', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
|
|||||||
@@ -21,15 +21,15 @@ CREATE TABLE IF NOT EXISTS `kpi_c_title` (
|
|||||||
|
|
||||||
REPLACE INTO `kpi_c_title` VALUES (1, 'AMF', 'AMF.C.01', 'Regstration Success Rate', '(\'AMF.03\'/\'AMF.02\')*100', '%', 'Active', '', 'admin', '2024-12-12 19:27:32');
|
REPLACE INTO `kpi_c_title` VALUES (1, 'AMF', 'AMF.C.01', 'Regstration Success Rate', '(\'AMF.03\'/\'AMF.02\')*100', '%', 'Active', '', 'admin', '2024-12-12 19:27:32');
|
||||||
REPLACE INTO `kpi_c_title` VALUES (2, 'AMF', 'AMF.C.02', 'Paging Success Rate', '((\'AMF.15\'+\'AMF.16\')/\'AMF.17\')*100', '%', 'Active', '', 'admin', '2024-12-12 19:28:34');
|
REPLACE INTO `kpi_c_title` VALUES (2, 'AMF', 'AMF.C.02', 'Paging Success Rate', '((\'AMF.15\'+\'AMF.16\')/\'AMF.17\')*100', '%', 'Active', '', 'admin', '2024-12-12 19:28:34');
|
||||||
REPLACE INTO `kpi_c_title` VALUES (3, 'AMF', 'AMF.C.03', 'Service Request Success Rate', '((1-\'AMF.18\')/\'AMF.19\')*100', '%', 'Active', '', 'admin', '2024-12-12 19:31:31');
|
REPLACE INTO `kpi_c_title` VALUES (3, 'AMF', 'AMF.C.03', 'Service Request Success Rate', '(1-\'AMF.18\'/\'AMF.19\')*100', '%', 'Active', '', 'admin', '2024-12-12 19:31:31');
|
||||||
REPLACE INTO `kpi_c_title` VALUES (4, 'AMF', 'AMF.C.04', '5G Register Subscriber', '\'AMF.01\'', ' ', 'Active', '', 'admin', '2024-12-12 19:32:16');
|
REPLACE INTO `kpi_c_title` VALUES (4, 'AMF', 'AMF.C.04', '5G Register Subscriber', '\'AMF.01\'', ' ', 'Active', '', 'admin', '2024-12-12 19:32:16');
|
||||||
REPLACE INTO `kpi_c_title` VALUES (5, 'SMF', 'SMF.C.01', 'SA_MeanPduSession', '\'SMF.01\'', ' ', 'Active', '', 'admin', '2024-12-12 19:32:45');
|
REPLACE INTO `kpi_c_title` VALUES (5, 'SMF', 'SMF.C.01', 'SA_MeanPduSession', '\'SMF.01\'', ' ', 'Active', '', 'admin', '2024-12-12 19:32:45');
|
||||||
REPLACE INTO `kpi_c_title` VALUES (6, 'SMF', 'SMF.C.02', 'PDU Session Establishment Success Rate', '(\'SMF.02\'/\'SMF.03\')*100', '%', 'Active', '', 'admin', '2024-12-12 19:33:27');
|
REPLACE INTO `kpi_c_title` VALUES (6, 'SMF', 'SMF.C.02', 'PDU Session Establishment Success Rate', '(\'SMF.02\'/\'SMF.03\')*100', '%', 'Active', '', 'admin', '2024-12-12 19:33:27');
|
||||||
REPLACE INTO `kpi_c_title` VALUES (7, 'SMF', 'SMF.C.03', 'IMS Session Establishment Success Rate', '(\'SMF.04\'/\'SMF.05\')*100', '%', 'Active', '', 'admin', '2024-12-12 19:34:07');
|
REPLACE INTO `kpi_c_title` VALUES (7, 'SMF', 'SMF.C.03', 'IMS Session Establishment Success Rate', '(\'SMF.04\'/\'SMF.05\')*100', '%', 'Active', '', 'admin', '2024-12-12 19:34:07');
|
||||||
REPLACE INTO `kpi_c_title` VALUES (8, 'MME', 'MME.C.01', 'Attach Success Rate ', '(\'MME.A.02\'/\'MME.A.01\')*100', '%', 'Active', '', 'admin', '2024-12-12 20:26:09');
|
REPLACE INTO `kpi_c_title` VALUES (8, 'MME', 'MME.C.01', 'Attach Success Rate ', '(\'MME.A.02\'/\'MME.A.01\')*100', '%', 'Active', '', 'admin', '2024-12-12 20:26:09');
|
||||||
REPLACE INTO `kpi_c_title` VALUES (9, 'UPF', 'UPF.C.01', 'PFCP Establish Success Rate ', '(\'UPF.01\'/\'UPF.02\')*100', '%', 'Active', '', 'admin', '2024-12-12 20:26:40');
|
REPLACE INTO `kpi_c_title` VALUES (9, 'UPF', 'UPF.C.01', 'PFCP Establish Success Rate ', '(\'UPF.01\'/\'UPF.02\')*100', '%', 'Active', '', 'admin', '2024-12-12 20:26:40');
|
||||||
REPLACE INTO `kpi_c_title` VALUES (10, 'UPF', 'UPF.C.02', 'N6_Throughout', '(\'UPF.03\')*8/5/1000/1000', 'Mbps', 'Active', '', 'admin', '2024-12-12 20:27:24');
|
REPLACE INTO `kpi_c_title` VALUES (10, 'UPF', 'UPF.C.02', 'N6_Uplink_Throughout', '(\'UPF.03\')*8/5/1000/1000', 'Mbps', 'Active', '', 'admin', '2025-01-20 09:26:06');
|
||||||
REPLACE INTO `kpi_c_title` VALUES (11, 'UPF', 'UPF.C.03', 'N3_Throughout', '(\'UPF.06\')*8/5/1000/1000', 'Mbps', 'Active', '', 'admin', '2024-12-12 20:27:56');
|
REPLACE INTO `kpi_c_title` VALUES (11, 'UPF', 'UPF.C.03', 'N3_Uplink_Throughout', '(\'UPF.06\')*8/5/1000/1000', 'Mbps', 'Active', '', 'admin', '2025-01-20 09:26:57');
|
||||||
REPLACE INTO `kpi_c_title` VALUES (12, 'UDM', 'UDM.C.01', 'AMF_UECM_Success_Rate ', '(\'UDM.03\'/\'UDM.02\')*100', '%', 'Active', '', 'admin', '2024-12-12 20:28:47');
|
REPLACE INTO `kpi_c_title` VALUES (12, 'UDM', 'UDM.C.01', 'AMF_UECM_Success_Rate ', '(\'UDM.03\'/\'UDM.02\')*100', '%', 'Active', '', 'admin', '2024-12-12 20:28:47');
|
||||||
REPLACE INTO `kpi_c_title` VALUES (13, 'UDM', 'UDM.C.02', 'SMF_UECM_Success_Rate ', '(\'UDM.04\'/\'UDM.05\')*100', '%', 'Active', '', 'admin', '2024-12-12 20:29:06');
|
REPLACE INTO `kpi_c_title` VALUES (13, 'UDM', 'UDM.C.02', 'SMF_UECM_Success_Rate ', '(\'UDM.04\'/\'UDM.05\')*100', '%', 'Active', '', 'admin', '2024-12-12 20:29:06');
|
||||||
REPLACE INTO `kpi_c_title` VALUES (14, 'IMS', 'IMS.C.01', 'InitReg_Success_Rate', '(\'SCSCF.03\'/\'SCSCF.04\')*100', '%', 'Active', '', 'admin', '2024-12-12 20:29:44');
|
REPLACE INTO `kpi_c_title` VALUES (14, 'IMS', 'IMS.C.01', 'InitReg_Success_Rate', '(\'SCSCF.03\'/\'SCSCF.04\')*100', '%', 'Active', '', 'admin', '2024-12-12 20:29:44');
|
||||||
@@ -38,5 +38,7 @@ REPLACE INTO `kpi_c_title` VALUES (16, 'IMS', 'IMS.C.03', 'MT_Success_Rate', '(\
|
|||||||
REPLACE INTO `kpi_c_title` VALUES (17, 'IMS', 'IMS.C.04', 'Service_Success_Rate ', '((\'SCSCF.05\'+\'SCSCF.07\')/(\'SCSCF.06\'+\'SCSCF.08\'))*100', '%', 'Active', '', 'admin', '2024-12-12 20:31:41');
|
REPLACE INTO `kpi_c_title` VALUES (17, 'IMS', 'IMS.C.04', 'Service_Success_Rate ', '((\'SCSCF.05\'+\'SCSCF.07\')/(\'SCSCF.06\'+\'SCSCF.08\'))*100', '%', 'Active', '', 'admin', '2024-12-12 20:31:41');
|
||||||
REPLACE INTO `kpi_c_title` VALUES (18, 'SMF', 'SMF.C.06', 'IMS_DefaultBear_Success_Rate ', '(\'SMF.13\'/\'SMF.14\')*100', '%', 'Active', '', 'admin', '2024-12-13 10:49:00');
|
REPLACE INTO `kpi_c_title` VALUES (18, 'SMF', 'SMF.C.06', 'IMS_DefaultBear_Success_Rate ', '(\'SMF.13\'/\'SMF.14\')*100', '%', 'Active', '', 'admin', '2024-12-13 10:49:00');
|
||||||
REPLACE INTO `kpi_c_title` VALUES (19, 'SMF', 'SMF.C.07', 'Bear_Success_Rate_new', '((\'SMF.09\'+\'SMF.11\')/(\'SMF.10\'+\'SMF.12\') )*100', '%', 'Active', '', 'admin', '2024-12-13 11:16:04');
|
REPLACE INTO `kpi_c_title` VALUES (19, 'SMF', 'SMF.C.07', 'Bear_Success_Rate_new', '((\'SMF.09\'+\'SMF.11\')/(\'SMF.10\'+\'SMF.12\') )*100', '%', 'Active', '', 'admin', '2024-12-13 11:16:04');
|
||||||
|
REPLACE INTO `kpi_c_title` VALUES (22, 'UPF', 'UPF.C.06', 'N3_Downlink_Throughout', '(\'UPF.05\')*8/5/1000/1000', 'Mbps', 'Active', '', 'admin', '2025-01-15 02:53:32');
|
||||||
|
REPLACE INTO `kpi_c_title` VALUES (23, 'UPF', 'UPF.C.07', 'N6_Downlink_Throughout', '(\'UPF.04\')*8/5/1000/1000', 'Mbps', 'Active', '', 'admin', '2025-01-15 02:53:32');
|
||||||
|
|
||||||
SET FOREIGN_KEY_CHECKS = 1;
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
|
|||||||
@@ -37,5 +37,6 @@ INSERT IGNORE INTO `sys_config` VALUES (108, 'config.sys.i18nOpen', 'sys.i18n.op
|
|||||||
INSERT IGNORE INTO `sys_config` VALUES (109, 'config.sys.i18nDefault', 'sys.i18n.default', 'en_US', 'Y', 'supervisor', 1700000000000, NULL, 0, 'config.sys.i18nDefaultRemark');
|
INSERT IGNORE INTO `sys_config` VALUES (109, 'config.sys.i18nDefault', 'sys.i18n.default', 'en_US', 'Y', 'supervisor', 1700000000000, NULL, 0, 'config.sys.i18nDefaultRemark');
|
||||||
INSERT IGNORE INTO `sys_config` VALUES (110, 'config.sys.lockTime', 'sys.lockTime', '0', 'Y', 'supervisor', 1704960008300, 'admin', 1706838764703, 'config.sys.lockTimeRemark');
|
INSERT IGNORE INTO `sys_config` VALUES (110, 'config.sys.lockTime', 'sys.lockTime', '0', 'Y', 'supervisor', 1704960008300, 'admin', 1706838764703, 'config.sys.lockTimeRemark');
|
||||||
INSERT IGNORE INTO `sys_config` VALUES (111, 'config.sys.homePage', 'sys.homePage', 'dashboard/overview/index', 'Y', 'supervisor', 1704960008300, 'admin', 1706838764703, 'config.sys.homePageRemark');
|
INSERT IGNORE INTO `sys_config` VALUES (111, 'config.sys.homePage', 'sys.homePage', 'dashboard/overview/index', 'Y', 'supervisor', 1704960008300, 'admin', 1706838764703, 'config.sys.homePageRemark');
|
||||||
|
INSERT IGNORE INTO `sys_config` VALUES (112, 'config.sys.exportTable', 'sys.exportTable', '43t6VAMQmdnt9ynWGJIR1ufeQOvr1doHDsjWUFT8JVzxTVEYgZ1Xvrk47JaPeCHMPKk9zLhJCU9MmA7JAWslQyWBLHzVOMUmA1ppIL1sVIkWGrdDiw0XuMdvXpUu/adrXHhqo42NP3hxcvwXvkWvgedezzCnUsvqfMt+Yw1Wick=', 'Y', 'supervisor', 1737355823940, 'supervisor', 1737363302083, 'config.sys.exportTableRemark');
|
||||||
|
|
||||||
SET FOREIGN_KEY_CHECKS=1;
|
SET FOREIGN_KEY_CHECKS=1;
|
||||||
@@ -95,8 +95,8 @@ REPLACE INTO `sys_dict_data` VALUES (1074, 1074, 'menu.trace.task', '网元跟
|
|||||||
REPLACE INTO `sys_dict_data` VALUES (1075, 1075, 'menu.trace.analysis', '网元跟踪数据', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
REPLACE INTO `sys_dict_data` VALUES (1075, 1075, 'menu.trace.analysis', '网元跟踪数据', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
REPLACE INTO `sys_dict_data` VALUES (1076, 1076, 'menu.trace.pcap', '信令抓包', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
REPLACE INTO `sys_dict_data` VALUES (1076, 1076, 'menu.trace.pcap', '信令抓包', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
REPLACE INTO `sys_dict_data` VALUES (1077, 1077, 'menu.fault', '监控', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
REPLACE INTO `sys_dict_data` VALUES (1077, 1077, 'menu.fault', '监控', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
-- REPLACE INTO `sys_dict_data` VALUES (1078, 1078, 'menu.config.backupManageRemark', '备份管理菜单', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
REPLACE INTO `sys_dict_data` VALUES (1078, 1078, 'config.sys.exportTable', '备份文件FTP服务', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
-- REPLACE INTO `sys_dict_data` VALUES (1079, 1079, 'menu.config.softwareManageRemark', '软件管理菜单', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
REPLACE INTO `sys_dict_data` VALUES (1079, 1079, 'config.sys.exportTableRemark', '请通过导出列表页面进行设置FTP信息', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
REPLACE INTO `sys_dict_data` VALUES (1080, 1080, 'menu.ueUser.onlineIMSRemark', 'IMS在线用户菜单', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
REPLACE INTO `sys_dict_data` VALUES (1080, 1080, 'menu.ueUser.onlineIMSRemark', 'IMS在线用户菜单', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
REPLACE INTO `sys_dict_data` VALUES (1081, 1081, 'menu.ueUser.onlineUERemark', 'UE在线信息菜单', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
REPLACE INTO `sys_dict_data` VALUES (1081, 1081, 'menu.ueUser.onlineUERemark', 'UE在线信息菜单', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
REPLACE INTO `sys_dict_data` VALUES (1082, 1082, 'menu.ueUser.base5GRemark', '5G基站信息菜单', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
REPLACE INTO `sys_dict_data` VALUES (1082, 1082, 'menu.ueUser.base5GRemark', '5G基站信息菜单', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
|
|||||||
@@ -93,8 +93,8 @@ REPLACE INTO `sys_dict_data` VALUES (3074, 3074, 'menu.trace.task', 'NE Trace Ta
|
|||||||
REPLACE INTO `sys_dict_data` VALUES (3075, 3075, 'menu.trace.analysis', 'NE Trace Task Data', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
REPLACE INTO `sys_dict_data` VALUES (3075, 3075, 'menu.trace.analysis', 'NE Trace Task Data', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
REPLACE INTO `sys_dict_data` VALUES (3076, 3076, 'menu.trace.pcap', 'Signaling Capture', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
REPLACE INTO `sys_dict_data` VALUES (3076, 3076, 'menu.trace.pcap', 'Signaling Capture', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
REPLACE INTO `sys_dict_data` VALUES (3077, 3077, 'menu.fault', 'Monitor', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
REPLACE INTO `sys_dict_data` VALUES (3077, 3077, 'menu.fault', 'Monitor', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
-- REPLACE INTO `sys_dict_data` VALUES (3078, 3078, 'menu.config.backupManageRemark', 'Backup Management Menu', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
REPLACE INTO `sys_dict_data` VALUES (3078, 3078, 'config.sys.exportTable', 'Backup file FTP service', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
-- REPLACE INTO `sys_dict_data` VALUES (3079, 3079, 'menu.config.softwareManageRemark', 'Software Management Menu', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
REPLACE INTO `sys_dict_data` VALUES (3079, 3079, 'config.sys.exportTableRemark', 'Please set the FTP information through the export list page.', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
REPLACE INTO `sys_dict_data` VALUES (3080, 3080, 'menu.ueUser.onlineIMSRemark', 'IMS Online User Menu', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
REPLACE INTO `sys_dict_data` VALUES (3080, 3080, 'menu.ueUser.onlineIMSRemark', 'IMS Online User Menu', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
REPLACE INTO `sys_dict_data` VALUES (3081, 3081, 'menu.ueUser.onlineUERemark', 'UE Online Information Menu', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
REPLACE INTO `sys_dict_data` VALUES (3081, 3081, 'menu.ueUser.onlineUERemark', 'UE Online Information Menu', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
REPLACE INTO `sys_dict_data` VALUES (3082, 3082, 'menu.ueUser.base5GRemark', '5G Base Station Information Menu', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
REPLACE INTO `sys_dict_data` VALUES (3082, 3082, 'menu.ueUser.base5GRemark', '5G Base Station Information Menu', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
|
|||||||
@@ -2,16 +2,26 @@ package file_export
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/jlaffaye/ftp"
|
||||||
|
|
||||||
"be.ems/lib/file"
|
"be.ems/lib/file"
|
||||||
"be.ems/lib/log"
|
"be.ems/lib/log"
|
||||||
"be.ems/lib/services"
|
"be.ems/lib/services"
|
||||||
|
"be.ems/src/framework/config"
|
||||||
"be.ems/src/framework/datasource"
|
"be.ems/src/framework/datasource"
|
||||||
"be.ems/src/framework/i18n"
|
"be.ems/src/framework/i18n"
|
||||||
|
"be.ems/src/framework/utils/crypto"
|
||||||
"be.ems/src/framework/utils/ctx"
|
"be.ems/src/framework/utils/ctx"
|
||||||
|
"be.ems/src/framework/utils/ssh"
|
||||||
|
"be.ems/src/framework/vo/result"
|
||||||
|
systemService "be.ems/src/modules/system/service"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -140,3 +150,189 @@ func (m *FileExport) Delete(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
c.JSON(http.StatusNoContent, nil) // 204 No Content
|
c.JSON(http.StatusNoContent, nil) // 204 No Content
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 设置FTP配置
|
||||||
|
// POST /table/ftp
|
||||||
|
func (m *SysJob) SetFTPConfig(c *gin.Context) {
|
||||||
|
language := ctx.AcceptLanguage(c)
|
||||||
|
var body struct {
|
||||||
|
Password string `json:"password" `
|
||||||
|
Username string `json:"username" binding:"required"`
|
||||||
|
ToIp string `json:"toIp" binding:"required"`
|
||||||
|
ToPort int64 `json:"toPort" binding:"required"`
|
||||||
|
Protocol string `json:"protocol" binding:"required,oneof=ssh ftp"`
|
||||||
|
Dir string `json:"dir" binding:"required"`
|
||||||
|
}
|
||||||
|
if err := c.ShouldBindBodyWithJSON(&body); err != nil {
|
||||||
|
c.JSON(400, result.CodeMsg(400, i18n.TKey(language, "app.common.err400")))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取配置
|
||||||
|
cfg := systemService.NewSysConfigImpl.SelectConfigByKey("sys.exportTable")
|
||||||
|
if cfg.ConfigID != "" {
|
||||||
|
// 加密body
|
||||||
|
appKey := config.Get("aes.appKey").(string)
|
||||||
|
byteData, err := json.Marshal(body)
|
||||||
|
if err != nil {
|
||||||
|
c.JSON(200, result.ErrMsg(err.Error()))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
bodyEn, err := crypto.AESEncryptBase64(string(byteData), appKey)
|
||||||
|
if err != nil {
|
||||||
|
c.JSON(200, result.ErrMsg(err.Error()))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 更新
|
||||||
|
cfg.ConfigValue = bodyEn
|
||||||
|
systemService.NewSysConfigImpl.UpdateConfig(cfg)
|
||||||
|
}
|
||||||
|
|
||||||
|
c.JSON(200, result.Ok(nil))
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置FTP配置
|
||||||
|
// GET /table/ftp
|
||||||
|
func (m *SysJob) GetFTPConfig(c *gin.Context) {
|
||||||
|
// 获取配置
|
||||||
|
cfg := systemService.NewSysConfigImpl.SelectConfigByKey("sys.exportTable")
|
||||||
|
if cfg.ConfigID != "" {
|
||||||
|
// 解密body
|
||||||
|
appKey := config.Get("aes.appKey").(string)
|
||||||
|
bodyDe, err := crypto.AESDecryptBase64(cfg.ConfigValue, appKey)
|
||||||
|
if err != nil {
|
||||||
|
c.JSON(200, result.ErrMsg(err.Error()))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var body struct {
|
||||||
|
Password string `json:"password" `
|
||||||
|
Username string `json:"username" binding:"required"`
|
||||||
|
ToIp string `json:"toIp" binding:"required"`
|
||||||
|
ToPort int64 `json:"toPort" binding:"required"`
|
||||||
|
Protocol string `json:"protocol" binding:"required,oneof=ssh ftp"`
|
||||||
|
Dir string `json:"dir" binding:"required"`
|
||||||
|
}
|
||||||
|
err = json.Unmarshal([]byte(bodyDe), &body)
|
||||||
|
if err != nil {
|
||||||
|
c.JSON(200, result.ErrMsg(err.Error()))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
c.JSON(200, result.OkData(body))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
c.JSON(200, result.Ok(nil))
|
||||||
|
}
|
||||||
|
|
||||||
|
// FTP发送
|
||||||
|
// PUT /table/ftp
|
||||||
|
func (m *SysJob) PutFTP(c *gin.Context) {
|
||||||
|
language := ctx.AcceptLanguage(c)
|
||||||
|
var body struct {
|
||||||
|
FilePath string `json:"filePath" binding:"required"`
|
||||||
|
FileName string `json:"fileName" binding:"required"`
|
||||||
|
}
|
||||||
|
if err := c.ShouldBindBodyWithJSON(&body); err != nil {
|
||||||
|
c.JSON(400, result.CodeMsg(400, i18n.TKey(language, "app.common.err400")))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
localFilePath := filepath.Join(body.FilePath, body.FileName)
|
||||||
|
|
||||||
|
// 判断文件是否存在
|
||||||
|
if _, err := os.Stat(localFilePath); os.IsNotExist(err) {
|
||||||
|
c.JSON(200, result.ErrMsg(err.Error()))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取配置
|
||||||
|
var cfgData struct {
|
||||||
|
Password string `json:"password" `
|
||||||
|
Username string `json:"username" binding:"required"`
|
||||||
|
ToIp string `json:"toIp" binding:"required"`
|
||||||
|
ToPort int64 `json:"toPort" binding:"required"`
|
||||||
|
Protocol string `json:"protocol" binding:"required,oneof=ssh ftp"`
|
||||||
|
Dir string `json:"dir" binding:"required"`
|
||||||
|
}
|
||||||
|
cfg := systemService.NewSysConfigImpl.SelectConfigByKey("sys.exportTable")
|
||||||
|
if cfg.ConfigID != "" {
|
||||||
|
// 解密body
|
||||||
|
appKey := config.Get("aes.appKey").(string)
|
||||||
|
bodyDe, err := crypto.AESDecryptBase64(cfg.ConfigValue, appKey)
|
||||||
|
if err != nil {
|
||||||
|
c.JSON(200, result.ErrMsg(err.Error()))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = json.Unmarshal([]byte(bodyDe), &cfgData)
|
||||||
|
if err != nil {
|
||||||
|
c.JSON(200, result.ErrMsg(err.Error()))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if cfgData.Protocol == "ssh" {
|
||||||
|
connSSH := ssh.ConnSSH{
|
||||||
|
User: cfgData.Username,
|
||||||
|
Password: cfgData.Password,
|
||||||
|
Addr: cfgData.ToIp,
|
||||||
|
Port: cfgData.ToPort,
|
||||||
|
AuthMode: "0",
|
||||||
|
}
|
||||||
|
sshClient, err := connSSH.NewClient()
|
||||||
|
if err != nil {
|
||||||
|
c.JSON(200, result.ErrMsg(err.Error()))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer sshClient.Close()
|
||||||
|
// 网元主机的SSH客户端进行文件传输
|
||||||
|
sftpClient, err := sshClient.NewClientSFTP()
|
||||||
|
if err != nil {
|
||||||
|
c.JSON(200, result.ErrMsg(err.Error()))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer sftpClient.Close()
|
||||||
|
// 远程文件
|
||||||
|
remotePath := filepath.Join(cfgData.Dir, path.Base(body.FilePath), body.FileName)
|
||||||
|
// 复制到远程
|
||||||
|
if err = sftpClient.CopyFileLocalToRemote(localFilePath, remotePath); err != nil {
|
||||||
|
c.JSON(200, result.ErrMsg("error uploading file"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
c.JSON(200, result.Ok(nil))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if cfgData.Protocol == "ftp" {
|
||||||
|
// 连接到 FTP 服务器
|
||||||
|
addr := fmt.Sprintf("%s:%d", cfgData.ToIp, cfgData.ToPort)
|
||||||
|
ftpComm, err := ftp.Dial(addr, ftp.DialWithTimeout(15*time.Second))
|
||||||
|
if err != nil {
|
||||||
|
c.JSON(200, result.ErrMsg(err.Error()))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 登录到 FTP 服务器
|
||||||
|
err = ftpComm.Login(cfgData.Username, cfgData.Password)
|
||||||
|
if err != nil {
|
||||||
|
c.JSON(200, result.ErrMsg(err.Error()))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer ftpComm.Quit()
|
||||||
|
// 打开本地文件
|
||||||
|
file, err := os.Open(localFilePath)
|
||||||
|
if err != nil {
|
||||||
|
c.JSON(200, result.ErrMsg(err.Error()))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer file.Close()
|
||||||
|
// 远程文件
|
||||||
|
remotePath := filepath.Join(cfgData.Dir, path.Base(body.FilePath), body.FileName)
|
||||||
|
// 上传文件到 FTP 服务器
|
||||||
|
err = ftpComm.Stor(remotePath, file)
|
||||||
|
if err != nil {
|
||||||
|
c.JSON(200, result.ErrMsg(err.Error()))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
c.JSON(200, result.Err(nil))
|
||||||
|
}
|
||||||
|
|||||||
@@ -15,7 +15,18 @@ func Register(r *gin.RouterGroup) {
|
|||||||
middleware.PreAuthorize(nil),
|
middleware.PreAuthorize(nil),
|
||||||
m.GetFileExportTable,
|
m.GetFileExportTable,
|
||||||
)
|
)
|
||||||
|
lmTable.POST("/ftp",
|
||||||
|
middleware.PreAuthorize(nil),
|
||||||
|
m.SetFTPConfig,
|
||||||
|
)
|
||||||
|
lmTable.GET("/ftp",
|
||||||
|
middleware.PreAuthorize(nil),
|
||||||
|
m.GetFTPConfig,
|
||||||
|
)
|
||||||
|
lmTable.PUT("/ftp",
|
||||||
|
middleware.PreAuthorize(nil),
|
||||||
|
m.PutFTP,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
lmFile := r.Group("/file")
|
lmFile := r.Group("/file")
|
||||||
{
|
{
|
||||||
|
|||||||
5
go.mod
5
go.mod
@@ -13,6 +13,7 @@ require (
|
|||||||
github.com/gorilla/mux v1.8.1
|
github.com/gorilla/mux v1.8.1
|
||||||
github.com/gorilla/websocket v1.5.3
|
github.com/gorilla/websocket v1.5.3
|
||||||
github.com/gosnmp/gosnmp v1.38.0
|
github.com/gosnmp/gosnmp v1.38.0
|
||||||
|
github.com/jlaffaye/ftp v0.2.0
|
||||||
github.com/lestrrat/go-file-rotatelogs v0.0.0-20180223000712-d3151e2a480f
|
github.com/lestrrat/go-file-rotatelogs v0.0.0-20180223000712-d3151e2a480f
|
||||||
github.com/linxGnu/gosmpp v0.3.0
|
github.com/linxGnu/gosmpp v0.3.0
|
||||||
github.com/matoous/go-nanoid/v2 v2.1.0
|
github.com/matoous/go-nanoid/v2 v2.1.0
|
||||||
@@ -45,7 +46,9 @@ require (
|
|||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
filippo.io/edwards25519 v1.1.0 // indirect; indirect // indirect
|
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||||
|
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||||
|
filippo.io/edwards25519 v1.1.0 // indirect
|
||||||
github.com/KyleBanks/depth v1.2.1 // indirect
|
github.com/KyleBanks/depth v1.2.1 // indirect
|
||||||
github.com/beorn7/perks v1.0.1 // indirect; indirect // indirect
|
github.com/beorn7/perks v1.0.1 // indirect; indirect // indirect
|
||||||
github.com/bytedance/sonic v1.12.1 // indirect; indirect // indirect
|
github.com/bytedance/sonic v1.12.1 // indirect; indirect // indirect
|
||||||
|
|||||||
7
go.sum
7
go.sum
@@ -117,6 +117,11 @@ github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/ad
|
|||||||
github.com/gosnmp/gosnmp v1.36.2-0.20231009064202-d306ed5aa998/go.mod h1:O938QjIS4vpSag1UTcnnBq9MfNmimuOGtvQsT1NbErc=
|
github.com/gosnmp/gosnmp v1.36.2-0.20231009064202-d306ed5aa998/go.mod h1:O938QjIS4vpSag1UTcnnBq9MfNmimuOGtvQsT1NbErc=
|
||||||
github.com/gosnmp/gosnmp v1.38.0 h1:I5ZOMR8kb0DXAFg/88ACurnuwGwYkXWq3eLpJPHMEYc=
|
github.com/gosnmp/gosnmp v1.38.0 h1:I5ZOMR8kb0DXAFg/88ACurnuwGwYkXWq3eLpJPHMEYc=
|
||||||
github.com/gosnmp/gosnmp v1.38.0/go.mod h1:FE+PEZvKrFz9afP9ii1W3cprXuVZ17ypCcyyfYuu5LY=
|
github.com/gosnmp/gosnmp v1.38.0/go.mod h1:FE+PEZvKrFz9afP9ii1W3cprXuVZ17ypCcyyfYuu5LY=
|
||||||
|
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||||
|
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
|
||||||
|
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||||
|
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
|
||||||
|
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
|
||||||
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
||||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||||
@@ -126,6 +131,8 @@ github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD
|
|||||||
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
|
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
|
||||||
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
|
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
|
||||||
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
|
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
|
||||||
|
github.com/jlaffaye/ftp v0.2.0 h1:lXNvW7cBu7R/68bknOX3MrRIIqZ61zELs1P2RAiA3lg=
|
||||||
|
github.com/jlaffaye/ftp v0.2.0/go.mod h1:is2Ds5qkhceAPy2xD6RLI6hmp/qysSoymZ+Z2uTnspI=
|
||||||
github.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST4RZ4=
|
github.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST4RZ4=
|
||||||
github.com/jonboulle/clockwork v0.4.0/go.mod h1:xgRqUGwRcjKCO1vbZUEtSLrqKoPSsUpK7fnezOII0kc=
|
github.com/jonboulle/clockwork v0.4.0/go.mod h1:xgRqUGwRcjKCO1vbZUEtSLrqKoPSsUpK7fnezOII0kc=
|
||||||
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
|
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
|
||||||
|
|||||||
@@ -175,6 +175,8 @@ aes:
|
|||||||
apiKey: "T9ox2DCzpLfJIPzkH9pKhsOTMOEMJcFv"
|
apiKey: "T9ox2DCzpLfJIPzkH9pKhsOTMOEMJcFv"
|
||||||
# 网元主机密钥
|
# 网元主机密钥
|
||||||
hostKey: "AGT66VfY4SMaiT97a7df0aef1704d5c5"
|
hostKey: "AGT66VfY4SMaiT97a7df0aef1704d5c5"
|
||||||
|
# 应用密钥
|
||||||
|
appKey: "E83dbfeb35BA4839232e2761b0FE5f32"
|
||||||
|
|
||||||
# 用户配置
|
# 用户配置
|
||||||
user:
|
user:
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ func FileList(sshClient *ConnSSH, path, search string) ([]FileListRow, error) {
|
|||||||
|
|
||||||
// 是否远程客户端读取
|
// 是否远程客户端读取
|
||||||
if sshClient == nil {
|
if sshClient == nil {
|
||||||
resultStr, err := cmd.Execf(cmdStr)
|
resultStr, err := cmd.Exec(cmdStr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Errorf("Ne FileList Path: %s, Search: %s, Error:%s", path, search, err.Error())
|
logger.Errorf("Ne FileList Path: %s, Search: %s, Error:%s", path, search, err.Error())
|
||||||
return rows, err
|
return rows, err
|
||||||
|
|||||||
@@ -135,10 +135,10 @@ func (s *SSHClientSFTP) CopyFileLocalToRemote(localPath, remotePath string) erro
|
|||||||
defer localFile.Close()
|
defer localFile.Close()
|
||||||
|
|
||||||
// 创建远程目录
|
// 创建远程目录
|
||||||
// if err := s.Client.MkdirAll(filepath.Dir(remotePath)); err != nil {
|
if err := s.Client.MkdirAll(filepath.Dir(remotePath)); err != nil {
|
||||||
// logger.Errorf("CopyFileLocalToRemote failed to creating remote directory %s: => %s", remotePath, err.Error())
|
logger.Errorf("CopyFileLocalToRemote failed to creating remote directory %s: => %s", remotePath, err.Error())
|
||||||
// return err
|
return err
|
||||||
// }
|
}
|
||||||
|
|
||||||
// 创建远程文件
|
// 创建远程文件
|
||||||
remoteFile, err := s.Client.Create(remotePath)
|
remoteFile, err := s.Client.Create(remotePath)
|
||||||
|
|||||||
@@ -6,11 +6,19 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"path"
|
||||||
|
"path/filepath"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"be.ems/lib/dborm"
|
"be.ems/lib/dborm"
|
||||||
"be.ems/lib/log"
|
"be.ems/lib/log"
|
||||||
|
"be.ems/src/framework/config"
|
||||||
"be.ems/src/framework/cron"
|
"be.ems/src/framework/cron"
|
||||||
|
"be.ems/src/framework/logger"
|
||||||
|
"be.ems/src/framework/utils/crypto"
|
||||||
|
"be.ems/src/framework/utils/ssh"
|
||||||
|
systemService "be.ems/src/modules/system/service"
|
||||||
|
"github.com/jlaffaye/ftp"
|
||||||
)
|
)
|
||||||
|
|
||||||
var NewProcessor = &BarProcessor{
|
var NewProcessor = &BarProcessor{
|
||||||
@@ -94,6 +102,9 @@ func (s *BarProcessor) Execute(data any) (any, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// put ftp
|
||||||
|
s.putFTP(params.FilePath, filepath.Base(filePath))
|
||||||
|
|
||||||
// 返回结果,用于记录执行结果
|
// 返回结果,用于记录执行结果
|
||||||
return map[string]any{
|
return map[string]any{
|
||||||
"msg": "sucess",
|
"msg": "sucess",
|
||||||
@@ -158,3 +169,94 @@ func (s *BarProcessor) exportData(query, filePath string) (int64, error) {
|
|||||||
|
|
||||||
return affected, nil
|
return affected, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s BarProcessor) putFTP(filePath, fileName string) {
|
||||||
|
// 获取配置
|
||||||
|
var cfgData struct {
|
||||||
|
Password string `json:"password" `
|
||||||
|
Username string `json:"username" binding:"required"`
|
||||||
|
ToIp string `json:"toIp" binding:"required"`
|
||||||
|
ToPort int64 `json:"toPort" binding:"required"`
|
||||||
|
Protocol string `json:"protocol" binding:"required,oneof=ssh ftp"`
|
||||||
|
Dir string `json:"dir" binding:"required"`
|
||||||
|
}
|
||||||
|
cfg := systemService.NewSysConfigImpl.SelectConfigByKey("sys.exportTable")
|
||||||
|
if cfg.ConfigID != "" {
|
||||||
|
// 解密body
|
||||||
|
appKey := config.Get("aes.appKey").(string)
|
||||||
|
bodyDe, err := crypto.AESDecryptBase64(cfg.ConfigValue, appKey)
|
||||||
|
if err != nil {
|
||||||
|
logger.Errorf("putFTP decrypt error: %v", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = json.Unmarshal([]byte(bodyDe), &cfgData)
|
||||||
|
if err != nil {
|
||||||
|
logger.Errorf("putFTP unmarshal error: %v", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
localFilePath := filepath.Join(filePath, fileName)
|
||||||
|
|
||||||
|
if cfgData.Protocol == "ssh" {
|
||||||
|
connSSH := ssh.ConnSSH{
|
||||||
|
User: cfgData.Username,
|
||||||
|
Password: cfgData.Password,
|
||||||
|
Addr: cfgData.ToIp,
|
||||||
|
Port: cfgData.ToPort,
|
||||||
|
AuthMode: "0",
|
||||||
|
}
|
||||||
|
sshClient, err := connSSH.NewClient()
|
||||||
|
if err != nil {
|
||||||
|
logger.Errorf("putFTP ssh error: %v", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer sshClient.Close()
|
||||||
|
// 网元主机的SSH客户端进行文件传输
|
||||||
|
sftpClient, err := sshClient.NewClientSFTP()
|
||||||
|
if err != nil {
|
||||||
|
logger.Errorf("putFTP sftp error: %v", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer sftpClient.Close()
|
||||||
|
// 远程文件
|
||||||
|
remotePath := filepath.Join(cfgData.Dir, path.Base(filePath), fileName)
|
||||||
|
// 复制到远程
|
||||||
|
if err = sftpClient.CopyFileLocalToRemote(localFilePath, remotePath); err != nil {
|
||||||
|
logger.Errorf("putFTP uploading error: %v", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if cfgData.Protocol == "ftp" {
|
||||||
|
// 连接到 FTP 服务器
|
||||||
|
addr := fmt.Sprintf("%s:%d", cfgData.ToIp, cfgData.ToPort)
|
||||||
|
ftpComm, err := ftp.Dial(addr, ftp.DialWithTimeout(15*time.Second))
|
||||||
|
if err != nil {
|
||||||
|
logger.Errorf("putFTP ftp error: %v", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 登录到 FTP 服务器
|
||||||
|
err = ftpComm.Login(cfgData.Username, cfgData.Password)
|
||||||
|
if err != nil {
|
||||||
|
logger.Errorf("putFTP login error: %v", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer ftpComm.Quit()
|
||||||
|
// 打开本地文件
|
||||||
|
file, err := os.Open(localFilePath)
|
||||||
|
if err != nil {
|
||||||
|
logger.Errorf("putFTP open error: %v", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer file.Close()
|
||||||
|
// 远程文件
|
||||||
|
remotePath := filepath.Join(cfgData.Dir, path.Base(filePath), fileName)
|
||||||
|
// 上传文件到 FTP 服务器
|
||||||
|
err = ftpComm.Stor(remotePath, file)
|
||||||
|
if err != nil {
|
||||||
|
logger.Errorf("putFTP uploading error: %v", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import (
|
|||||||
"be.ems/src/framework/logger"
|
"be.ems/src/framework/logger"
|
||||||
"be.ems/src/framework/redis"
|
"be.ems/src/framework/redis"
|
||||||
"be.ems/src/framework/telnet"
|
"be.ems/src/framework/telnet"
|
||||||
|
"be.ems/src/framework/utils/generate"
|
||||||
"be.ems/src/framework/utils/parse"
|
"be.ems/src/framework/utils/parse"
|
||||||
"be.ems/src/framework/utils/ssh"
|
"be.ems/src/framework/utils/ssh"
|
||||||
neFetchlink "be.ems/src/modules/network_element/fetch_link"
|
neFetchlink "be.ems/src/modules/network_element/fetch_link"
|
||||||
@@ -243,9 +244,10 @@ func (r *NeInfo) SelectById(infoId string, bandHost bool) model.NeInfo {
|
|||||||
func (r *NeInfo) Insert(neInfo model.NeInfo) string {
|
func (r *NeInfo) Insert(neInfo model.NeInfo) string {
|
||||||
// 主机信息新增
|
// 主机信息新增
|
||||||
if neInfo.Hosts != nil {
|
if neInfo.Hosts != nil {
|
||||||
|
uuid := generate.Code(4)
|
||||||
var hostIDs []string
|
var hostIDs []string
|
||||||
for _, host := range neInfo.Hosts {
|
for _, host := range neInfo.Hosts {
|
||||||
host.Title = fmt.Sprintf("%s_%s_%d", strings.ToUpper(neInfo.NeType), neInfo.NeId, host.Port)
|
host.Title = neInfo.NeName + "_" + uuid
|
||||||
host.GroupID = "1"
|
host.GroupID = "1"
|
||||||
host.CreateBy = neInfo.CreateBy
|
host.CreateBy = neInfo.CreateBy
|
||||||
hostId := NewNeHost.Insert(host)
|
hostId := NewNeHost.Insert(host)
|
||||||
@@ -268,9 +270,10 @@ func (r *NeInfo) Insert(neInfo model.NeInfo) string {
|
|||||||
func (r *NeInfo) Update(neInfo model.NeInfo) int64 {
|
func (r *NeInfo) Update(neInfo model.NeInfo) int64 {
|
||||||
// 主机信息更新
|
// 主机信息更新
|
||||||
if neInfo.Hosts != nil {
|
if neInfo.Hosts != nil {
|
||||||
|
uuid := generate.Code(4)
|
||||||
for _, host := range neInfo.Hosts {
|
for _, host := range neInfo.Hosts {
|
||||||
if host.HostID != "" {
|
if host.HostID != "" {
|
||||||
host.Title = fmt.Sprintf("%s_%s_%d", strings.ToUpper(neInfo.NeType), neInfo.NeId, host.Port)
|
host.Title = neInfo.NeName + "_" + uuid
|
||||||
host.GroupID = "1"
|
host.GroupID = "1"
|
||||||
host.UpdateBy = neInfo.UpdateBy
|
host.UpdateBy = neInfo.UpdateBy
|
||||||
NewNeHost.Update(host)
|
NewNeHost.Update(host)
|
||||||
|
|||||||
Reference in New Issue
Block a user