libf 2 سال پیش
والد
کامیت
d580a8b009
100فایلهای تغییر یافته به همراه3220 افزوده شده و 5645 حذف شده
  1. 159 74
      cncc_serverjs/script/cncc/API/drsp/perf.js
  2. 14 1
      cncc_serverjs/script/cncc/API/drsp/test_perf.js
  3. 0 36
      cncc_serverjs/script/cncc/API/sample1.js
  4. 0 15
      cncc_serverjs/script/cncc/API/sample2.js
  5. 1 1
      cncc_serverjs/script/cncc/CMDB/edges/trace.log
  6. 46 21
      cncc_serverjs/script/cncc/CMDB/x86.js
  7. 16 2
      cncc_serverjs/script/cncc/CMDB/业务.js
  8. 18 3
      cncc_serverjs/script/cncc/CMDB/分区.js
  9. 115 0
      cncc_serverjs/script/cncc/CMDB/分区_serverNode.js
  10. 64 26
      cncc_serverjs/script/cncc/CMDB/小型机.js
  11. 60 36
      cncc_serverjs/script/cncc/CMDB/应用.js
  12. 16 1
      cncc_serverjs/script/cncc/CMDB/应用类别.js
  13. 16 6
      cncc_serverjs/script/cncc/CMDB/数据中心.js
  14. 48 7
      cncc_serverjs/script/cncc/CMDB/机房.js
  15. 47 9
      cncc_serverjs/script/cncc/CMDB/机柜.js
  16. 0 29
      cncc_serverjs/script/cncc/DIEP/test.js
  17. 0 23
      cncc_serverjs/script/cncc/DIEP/test_csv.js
  18. 0 593
      cncc_serverjs/script/cncc/DIEP/报告参数_POSTMAN.js
  19. 0 45
      cncc_serverjs/script/cncc/DIEP/报告参数_文本.js
  20. 0 307
      cncc_serverjs/script/cncc/DIEP/接入报告.js
  21. 176 139
      cncc_serverjs/script/cncc/ITIL/事件单.js
  22. 482 393
      cncc_serverjs/script/cncc/ITIL/变更单.js
  23. 284 245
      cncc_serverjs/script/cncc/ITIL/应急演练.js
  24. 158 67
      cncc_serverjs/script/cncc/ITIL/报备.js
  25. 242 243
      cncc_serverjs/script/cncc/ITIL/数据获取.js
  26. 200 178
      cncc_serverjs/script/cncc/ITIL/设备上下电.js
  27. 215 214
      cncc_serverjs/script/cncc/ITIL/问题单.js
  28. 83 82
      cncc_serverjs/script/cncc/ITIL/项目实施或巡检.js
  29. 34 0
      cncc_serverjs/script/cncc/test/test.js
  30. 34 0
      cncc_serverjs/script/cncc/test/test_data.js
  31. 46 0
      cncc_serverjs/script/cncc/test/test_gen_insert_template.js
  32. 13 0
      cncc_serverjs/script/cncc/test/test_https.js
  33. 18 0
      cncc_serverjs/script/cncc/test/test_job.js
  34. 1 0
      cncc_serverjs/script/cncc/test/test_user.js
  35. 2 0
      cncc_serverjs/script/cncc/test/user.js
  36. 32 0
      cncc_serverjs/script/cncc/test/ww.js
  37. 29 0
      cncc_serverjs/script/cncc/test/应用系统业务领域特征.js
  38. 53 0
      cncc_serverjs/script/cncc/test/应用系统开发语言.js
  39. 86 0
      cncc_serverjs/script/cncc/国产监控/告警/事件列表.js
  40. 8 0
      cncc_serverjs/script/cncc/国产监控/告警/数据结构.js
  41. 29 0
      cncc_serverjs/script/cncc/应用/meta-capacitya/hostpoolList.js
  42. 1 0
      cncc_serverjs/script/cncc/应用/meta-capacitya/log.json
  43. 20 6
      cncc_serverjs/script/cncc/应用/meta-capacitya/performanceByHost.js
  44. 21 9
      cncc_serverjs/script/cncc/应用/meta-capacitya/performanceByVm.js
  45. 16 0
      cncc_serverjs/script/cncc/应用/meta-capacitya/searchByTerm.js
  46. 55 36
      cncc_serverjs/script/cncc/应用/meta-capacitya/summary.js
  47. 87 23
      cncc_serverjs/script/cncc/应用/meta-capacitya/summaryByDc.js
  48. 18 3
      cncc_serverjs/script/cncc/应用/meta-capacitya/template/menus.js
  49. 0 2
      cncc_serverjs/script/cncc/应用/meta-capacitya/test.js
  50. 40 12
      cncc_serverjs/script/cncc/应用/meta-capacitya/vmListByHost.js
  51. 25 0
      cncc_serverjs/script/cncc/应用/meta-capacitya/更新物理机配置缓存.js
  52. 0 0
      cncc_serverjs/script/cncc/应用/meta-faulta/attachment/8500809039221148163/基线告警 (2).docx
  53. 0 0
      cncc_serverjs/script/cncc/应用/meta-faulta/attachment/8500809039221148163/运维文档 (4)
  54. 0 884
      cncc_serverjs/script/cncc/应用/meta-faulta/attachment/app:demoapp3/z000000000006EJ48jwebtQR/gui-config.json
  55. BIN
      cncc_serverjs/script/cncc/应用/meta-faulta/attachment/biz:开发测试/z000000000005N7R3YeeSISU/rule (1).png
  56. BIN
      cncc_serverjs/script/cncc/应用/meta-faulta/attachment/biz:开发测试/z000000000005N7R3YeeSISU/rule (2).png
  57. BIN
      cncc_serverjs/script/cncc/应用/meta-faulta/attachment/biz:开发测试/z000000000005N7R3YeeSISU/rule (3).png
  58. 0 184
      cncc_serverjs/script/cncc/应用/meta-faulta/attachment/biz:数字国网/z0000000000050znkhAEhdgY1mIFEJNw5utmO/ai-message.vue
  59. BIN
      cncc_serverjs/script/cncc/应用/meta-faulta/attachment/linux:172.26.38.248/17368221814077026651/Export_2021-06-19 17_29_52.xlsx
  60. BIN
      cncc_serverjs/script/cncc/应用/meta-faulta/attachment/linux:node3/alert:10.216.202.66-cpuutilization-5/rule.png
  61. 0 0
      cncc_serverjs/script/cncc/应用/meta-faulta/attachment/pod:tomcat-pod3/alert:100.83.165.231_pot-down_5/基线告警 (2).docx
  62. 0 38
      cncc_serverjs/script/cncc/应用/meta-faulta/attachment/pod:tomcat-pod3/z0000000000060znkhAEhdgY1mHVcfDjVnMLE/eif.20210602.log
  63. BIN
      cncc_serverjs/script/cncc/应用/meta-faulta/attachment/pod:web-demo-j6qxj/z0000000000060znkhAEhdgY1mFhr1U6hW2f3/展示系统接口说明_20180926.docx
  64. 0 5
      cncc_serverjs/script/cncc/应用/meta-faulta/attachment/pod:web-demo-j6qxj/z0000000000060znkhAEhdgY1mTXRj2goMqcu/ETCD_eventbus_2021_3_24下午3_07_02.json
  65. BIN
      cncc_serverjs/script/cncc/应用/meta-faulta/attachment/pod:web-demo-j6qxj/z0000000000060znkhAEhdgY1mTXRj2goMqcu/pexels-juan-733475 (4).jpg
  66. BIN
      cncc_serverjs/script/cncc/应用/meta-faulta/attachment/pod:web-demo-j6qxj/z0000000000060znkhAEhdgY1mTXRj2goMqcu/pexels-juan-733475.jpg
  67. 29 13
      cncc_serverjs/script/cncc/应用/meta-faulta/bdos/init.js
  68. 1 1
      cncc_serverjs/script/cncc/应用/meta-faulta/bdos/交易吞吐量排名.js
  69. 1 1
      cncc_serverjs/script/cncc/应用/meta-faulta/bdos/处理时长排名.js
  70. 61 35
      cncc_serverjs/script/cncc/应用/meta-faulta/bdos/报文检索.js
  71. 0 49
      cncc_serverjs/script/cncc/应用/meta-faulta/contextmenu/action.js
  72. 0 147
      cncc_serverjs/script/cncc/应用/meta-faulta/contextmenu/context-menu.json
  73. 0 13
      cncc_serverjs/script/cncc/应用/meta-faulta/contextmenu/getContextMenu.js
  74. 0 145
      cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/attributeRel.js
  75. 0 12
      cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/bitlog/getBitlogList.js
  76. 0 38
      cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/bitlog/getBucketByEntity.js
  77. 0 28
      cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/bitlog/searchBitlogByTerm.js
  78. 0 19
      cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/bitlog/searchEntityByClass.js
  79. 0 137
      cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/eventListBySmartGroup.js
  80. 0 12
      cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/getBitlogList.js
  81. 0 148
      cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/history.js
  82. 0 16
      cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/journal.js
  83. 0 27
      cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/searchBitlogByTerm.js
  84. 0 19
      cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/searchEntityByClass.js
  85. 0 89
      cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/smartGroup.js
  86. 0 4
      cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/test.js
  87. 0 39
      cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/tsdb/getBucketByEntity.js
  88. 0 11
      cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/tsdb/getClassNameById.js
  89. 0 65
      cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/tsdb/getClassNumberStringKeysByClassName.js
  90. 0 12
      cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/tsdb/getTsdbList.js
  91. 0 19
      cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/tsdb/searchEntityByClass.js
  92. 0 42
      cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/tsdb/searchPerformanceByTerm.js
  93. 0 303
      cncc_serverjs/script/cncc/应用/meta-faulta/event_list.js
  94. 0 3
      cncc_serverjs/script/cncc/应用/meta-faulta/graph/config.json
  95. 0 15
      cncc_serverjs/script/cncc/应用/meta-faulta/job/deleteEvent.js
  96. 0 88
      cncc_serverjs/script/cncc/应用/meta-faulta/job/job_list.js
  97. 0 14
      cncc_serverjs/script/cncc/应用/meta-faulta/message/getMessage.js
  98. 0 3
      cncc_serverjs/script/cncc/应用/meta-faulta/notify/config.json
  99. 0 80
      cncc_serverjs/script/cncc/应用/meta-faulta/notify/getLogList.js
  100. 0 0
      cncc_serverjs/script/cncc/应用/meta-faulta/notify/getRuleList.js

+ 159 - 74
cncc_serverjs/script/cncc/API/drsp/perf.js

@@ -1,117 +1,203 @@
-
 // 输入输出参数格式化
 input = INPUT;
 output = {};
-try {
-    input = decodeURIComponent(input);
-} catch (e) { }
-try {
+
+try{
+    input = decodeURIComponent( input );
+} catch(e){}
+try{
     input = base64.decode(input);
-} catch (e) { }
-try {
+} catch(e){}
+try{
     input = JSON.parse(input);
     input = JSON.parse(input); // 解析可能存在的重复编码
-} catch (e) { }
+}catch(e){}
+
+// 环境配置参数,配置定义在etcd:/matrix/data/api/cfg.json
+cfg = {}
+try{
+    cfg.env = "prod";//JSON.parse(etcd.get("/api/cfg.json"));
+}catch(e){}
+
+/*
+{"kpi_key":"kpi.IBPS.101.sendnode-recvnode-ratio","timestamp":1669087620,"value":0.9967}    网银应答率
+{"kpi_key":"kpi.IBPS.SuccPer","timestamp":1669087680,"value":1}                             网银成功率 
+{"kpi_key":"kpi.IBPS.TransCount","timestamp":1669087680,"value":55981}                      网银交易量
+{"kpi_key":"kpi.IBPS.MachinAvgDealTime","timestamp":1669087680,"value":381.6986}            网银处理时间
+{"kpi_key":"kpi.IBPS.FailCount","timestamp":1669087680,"value":0}                           网银失败笔数
+
+
+{"kpi_key":"kpi.FXCC.SuccPer","timestamp":1669087680,"value":1}                             外币成功率
+{"kpi_key":"kpi.FXCC.TransCount","timestamp":1669087680,"value":36}                         外币交易量
+{"kpi_key":"kpi.FXCC.MachinAvgDealTime","timestamp":1669087680,"value":2739.0278}   		外币处理时间
+{"kpi_key":"kpi.FXCC.FailCount","timestamp":1669087680,"value":0}                           外币失败笔数
 
-// 环境配置参数,配置定义在 etcd:/matrix/data/api/cfg.json
-cfg = {};
-try {
-    cfg = JSON.parse(etcd.get("/api/cfg.json"));
-} catch (e) { }
+
+{"kpi_key":"kpi.BEPS.SuccPer","timestamp":1669087680,"value":1}                             小额成功率
+{"kpi_key":"kpi.BEPS.TransCount","timestamp":1669087680,"value":8998}                       小额交易量
+{"kpi_key":"kpi.BEPS.MachinAvgDealTime","timestamp":1669087680,"value":877.3821}            小额处理时间
+{"kpi_key":"kpi.BEPS.FailCount","timestamp":1669087680,"value":0}                           小额失败笔数
+
+{"kpi_key":"kpi.HVPS.SuccPer","timestamp":1669087680,"value":1}                             大额成功率
+{"kpi_key":"kpi.HVPS.TransCount","timestamp":1669087680,"value":2613}                       大额交易量
+{"kpi_key":"kpi.HVPS.MachinAvgDealTime","timestamp":1669087680,"value":1645.3793}           大额处理时间
+{"kpi_key":"kpi.HVPS.FailCount","timestamp":1669087680,"value":0}                           大额失败笔数
+
+*/ 
+function getDataFromOmdb(type,tms,tme){
+    
+    var data = [];
+    var kpiDef = [
+            {"kpi_key":"kpi.IBPS.101.sendnode-recvnode-ratio", title: "网银应答率", "name": "RR" },
+            {"kpi_key":"kpi.IBPS.SuccPer", "title":"网银成功率", "name":"RS"}, 
+            {"kpi_key":"kpi.IBPS.TransCount", "title":"网银交易量", "name":"RV"},
+            {"kpi_key":"kpi.IBPS.MachinAvgDealTime", "title":"网银处理时间", "name":"RD"},
+            {"kpi_key":"kpi.IBPS.FailCount", "title":"网银失败笔数", "name":"FV"},
+            
+            {"kpi_key":"kpi.FXCC.SuccPer", "title":"外币成功率", "name":"RS"},
+            {"kpi_key":"kpi.FXCC.TransCount", "title":"外币交易量", "name":"RV"},
+            {"kpi_key":"kpi.FXCC.MachinAvgDealTime", "title":"外币处理时间", "name":"RD"},
+            {"kpi_key":"kpi.FXCC.FailCount", "title":"外币失败笔数", "name":"FV"},
+            
+            {"kpi_key":"kpi.BEPS.SuccPer", "title":"小额成功率", "name":"RS"},
+            {"kpi_key":"kpi.BEPS.TransCount", "title":"小额交易量", "name":"RV"},
+            {"kpi_key":"kpi.BEPS.MachinAvgDealTime", "title":"小额处理时间", "name":"RD"},
+            {"kpi_key":"kpi.BEPS.FailCount", "title":"小额失败笔数", "name":"FV"},
+            
+            {"kpi_key":"kpi.HVPS.SuccPer", "title":"大额成功率", "name":"RS"},
+            {"kpi_key":"kpi.HVPS.TransCount", "title":"大额交易量", "name":"RV"},
+            {"kpi_key":"kpi.HVPS.MachinAvgDealTime", "title":"大额处理时间", "name":"RD"},
+            {"kpi_key":"kpi.HVPS.FailCount", "title":"大额失败笔数", "name":"FV"}];
+    var kpiGroup = _.groupBy(kpiDef,function(v){ return v.kpi_key.split(".")[1]; });
+    
+    if(!kpiGroup[type]) return [];
+    
+    var kpiObj = {"RR":100, "RS":100, "RV":0, "RD":0, "FV":0};
+    
+    kpiGroup[type].forEach(function(v){
+        
+        var comp = _.template("select id,stats.find(name='<%= name %>').time('<%=tms %>','<%= tme%>') from /cncc/entity/biz where name='<%=bizname%>'");
+        
+        var mql = comp({
+            name: v.kpi_key,
+            tms:  new Date(tms - 3600*8*1000).toLocaleString(),
+            tme:  new Date(tme - 3600*8*1000 + 60000).toLocaleString(),
+            bizname: type
+        })
+        webcontext.admin(true);
+        var res = odb.mql(mql).data[0].stats;
+        
+        if(_.isEmpty(res)) return;
+        
+        var o = {};
+        o[v.name] = res[0][2];
+        
+        _.extend(kpiObj, o);
+    })
+    
+    data.push(_.extend({
+                type: type,
+                time : new Date(tms)},kpiObj)
+            );
+    return data;
+}
 
 // 函数定义
-// 从 ODB 获取数据
-function getData(type, tms, tme) {
+// 从ODB获取数据
+function getData(type, tms, tme){
     var data = [];
-    // TODO:从 ODB 获取数据
-    if (cfg.env == "test") {
-        // 测试生成假数据
-        for (var t = tms; t <= tme; t += 60 * 1000) {
+    // TODO: 从ODB获取数据
+    if( cfg.env == "test"){
+        // 从测试模拟数据
+        for (var t = tms; t <= tme; t += 60 * 1000){
             data.push({
                 type: type,
-                time: new Date(t),
-                RV: parseInt(Math.random() * 500 + 1000), // 交易量 
-                RS: Math.random() * 5 + 95,               // 系统成功率 
-                RD: parseInt(Math.random() * 500 + 100),  // 平均响应时间 
-                RR: Math.random() * 5 + 95,               // 交易响应率 
-                FV: parseInt(Math.random() * 10),         // 失败笔数 
+                time : new Date(t),
+                RV: parseInt(Math.random() * 500 + 1000), // 交易量
+                RS: Math.random() * 5 + 95, // 系统成功率
+                RD: parseInt(Math.random() * 500 + 100), // 平均响应时间
+                RR: Math.random() * 5 + 95, // 交易响应率
+                FV: parseInt(Math.random() * 10) // 失败笔数
             });
         }
+    }else{
+        data = getDataFromOmdb(type, tms, tme);
     }
+    OUTPUT = data;
     return data;
-}
+};
+
 
 // 格式化数据
-function formatData(data) {
-    if (data.length == 0) {
-        // 无数据返回 {}
-        return {};
-    }
-    for (var i = 0; i < data.length; i++) {
-        data[i].time = data[i].time.toJSON().replace(/[TZ]/mg, " ").substring(0, 16); // 时间格式:yyyy-MM-dd HH:mm
-        data[i].RV = "" + parseInt(data[i].RV);             // 交易量,1分钟统计周期内,总交易笔数
-        data[i].RS = "" + parseInt(data[i].RS * 100) / 100; // 系统成功率,四舍五入保留2位小数,系统成功率<=100
-        data[i].RD = "" + parseInt(data[i].RD);             // 平均响应时间,单位ms,四舍五入取整数
-        data[i].RR = "" + parseInt(data[i].RR * 100) / 100; // 交易响应率,四舍五入保留2位小数,交易响应率<=100
-        data[i].FV = "" + parseInt(data[i].FV);             // 失败笔数,1分钟统计周期内,失败交易笔数
-    }
-    if (data.length == 1) {
-        // 单条数据直接返回对象
-        data = data[0];
-    }
-    return data
+function formatData(data){
+	if(data.length == 0){
+		// 无数据返回 {}
+		return  {};
+	}
+	for(var i = 0; i < data.length; i++){
+	    data[i].time = data[i].time.toJSON().replace(/[TZ]/mg," ").substring(0,16); // 时间格式: yyyy-MM-dd HH:mm
+		data[i].RV = "" + parseInt(data[i].RV);//parseInt(data[i].RV);  // 交易量
+		data[i].RS = "" + parseInt(data[i].RS * 10000) / 100;//parseInt(data[i].RS * 100) / 100; // 系统成功率,四舍五入保留2位小数,系统成功率 <= 100
+		data[i].RD = "" + parseInt(data[i].RD);//parseInt(data[i].RD); // 平均响应时间,单位ms, 四舍五入取整
+		data[i].RR = "" + parseInt(data[i].RR * 10000) / 100;//parseInt(data[i].RR); // 交易响应率,四舍五入保留2位小数,系统成功率 <= 100
+		data[i].FV = "" + parseInt(data[i].FV);//parseInt(data[i].FV); // 失败笔数, 1分钟统计周期内,失败交易笔数
+	}
+	if(data.length == 1){
+		// 单条数据直接返回对象
+		data = data[0];
+	}
+	return data;
 }
 
-// 解析时间字符串 格式为 yyyyMMddHHmm
-function parseTime(ymdhm) {
-    try {
-        if (!/^\d{12}$/.test(ymdhm)) {
-            throw ("format error");
+// 解析时间字符串,格式为:yyyyMMddHHmm
+function parseTime(ymdhm){
+    try{
+        if(!/^\d{12}$/.test(ymdhm) ){
+            throw ("format error")
         }
-        var d = new Date(
-            parseInt(ymdhm.substring(0, 4)),
-            parseInt(ymdhm.substring(4, 6)) - 1,
-            parseInt(ymdhm.substring(6, 8)),
-            parseInt(ymdhm.substring(8, 10)),
-            parseInt(ymdhm.substring(10, 12))
-        );
+        
+        var d = new Date( parseInt(ymdhm.substring(0,4)), parseInt(ymdhm.substring(4,6)) - 1, parseInt(ymdhm.substring(6,8)), parseInt(ymdhm.substring(8,10)), parseInt(ymdhm.substring(10,12)) );
         d.setMinutes(d.getMinutes() - d.getTimezoneOffset());
         return d;
-    } catch (e) {
-        throw ("时间格式错误,正确格式是 yyyyMMddHHmm");
+    }
+    catch(e){
+        throw ("时间格式错误,正确格式是yyyyMMddHHmm");
     }
 }
 
 // 主执行阶段
-try {
+try{
     // 参数检查
     var type = input.type;
-    if (!type) {
-        throw ("必须指定参数 type,如:HVPS,BEPS,IBPS,FXPS");
+    if(!type){
+        throw("必须指定参数 type, 如:HVPS,BEPS,IBPS,FXPS");
     }
     var starttime = input.time;
-    if (!starttime) {
-        throw ("必须指定参数 time,格式为 yyyyMMddHHmm");
+    if(!starttime){
+        throw ("必须指定参数time,格式为:yyyyMMddHHmm");
     }
     var endtime = input.endtime; // 可选参数,指定结束时间,可以获取一段时间的数据
-    if (!endtime) {
-        endtime = input.time;
+    if(!endtime){
+        endtime = input.time; 
     }
     // 参数解析
-    var tms = parseTime("" + starttime).getTime();
-    var tme = parseTime("" + endtime).getTime();
+    var tms = parseTime("" +starttime).getTime();
+    var tme = parseTime("" +endtime).getTime();
+    
     // 数据获取
     var data = getData(type, tms, tme);
+    
     // 数据格式化
     data = formatData(data);
     // 数据输出
     output.data = data;
-} catch (e) {
-    // 错误信息输出处理,抛出 ok 表示正常结束    
-    if (e != "ok") {
-        if (typeof (e) == "object") {
+}
+catch(e){
+    // 错误信息输出处理,抛出ok表示正常结束
+    if(e != "ok"){
+        if( typeof (e)  == "object"){
             output.error = e;
-        } else if (typeof (e) == "string") {
+        } else if( typeof (e) == "string"){
             output.error = "错误:" + e;
         } else {
             output.error = JSON.stringify(e);
@@ -120,6 +206,5 @@ try {
         STATUS = "error";
     }
 }
-
 // 返回输出信息
-OUTPUT = output;
+OUTPUT = output;

+ 14 - 1
cncc_serverjs/script/cncc/API/drsp/test_perf.js

@@ -1 +1,14 @@
-null
+// do: Http request
+// params: method<string>, url<string>, header<object>, body<string>, successfunc<function>, errfunc<function>
+// return: none
+//var auth = base64.encode('meta.admin:Ywxtb@1qaz');
+//webcontext.admin(true);
+var auth = base64.encode('meta.drsp01:Ywxtb@1qaz');
+
+var input = encodeURIComponent(JSON.stringify({"type":"IBPS", "time":"202211240911"}));
+
+http.do("POST", "http://11.248.37.122:8080/script/exec/js?issys=true&filepath=/cncc/API/drsp/perf.js&rawdata=true&input="+input, {"Authorization": "Basic " + auth}, null, function(res){
+    OUTPUT = res.data;
+}, function(err){
+    OUTPUT = err.data;
+},3600)

+ 0 - 36
cncc_serverjs/script/cncc/API/sample1.js

@@ -1,36 +0,0 @@
-// 输入输出参数格式化
-input = INPUT;
-output = {};
-try {
-    input = decodeURIComponent(input);
-} catch (e) { }
-try {
-    input = base64.decode(input);
-} catch (e) { }
-try {
-    input = JSON.parse(input);
-    input = JSON.parse(input); // 解析可能存在的重复编码
-} catch (e) { }
-// 主执行阶段
-try {
-    // 示例处理过程,返回输入信息
-    output.sampledata = {
-        input: input,
-    };
-} catch (e) {
-    // 错误信息输出处理,抛出 ok 表示正常结束    
-    if (e != "ok") {
-        if (typeof (e) == "object") {
-            output.error = e;
-        } else if (typeof (e) == "string") {
-            output.error = "错误:" + e;
-        } else {
-            output.error = JSON.stringify(e);
-        }
-        log.error(output.error);
-        STATUS = "error";
-    }
-}
-// 返回输出信息
-OUTPUT = output;
-

+ 0 - 15
cncc_serverjs/script/cncc/API/sample2.js

@@ -1,15 +0,0 @@
-
-eval(dfs.read('/script/matrix/wframe/init.js'));
-
-function main(input) {
-    try {
-        x = "test3";
-        function a(){ return x; }
-        return {
-            input: input,
-            info: a(),
-        };
-    } catch(e) {
-        throw(e);
-    }
-}

+ 1 - 1
cncc_serverjs/script/cncc/CMDB/edges/trace.log

@@ -1 +1 @@
-1663520403771
+1669309204192

+ 46 - 21
cncc_serverjs/script/cncc/CMDB/x86.js

@@ -1,30 +1,45 @@
-// 日志输出
-var trace = function(name, value, ext){
-  try{
-      dfs.write("/script/cncc/CMDB/trace/" + name + "." + ext, value);
-  }  catch(err){
-      log.error(err);
-  }
-};
+var token = (function(){
+    var rtn = null;
+    var bodyContent = "loginCode="+encodeURIComponent("uinnova|meta@cfid.cn")+"&password="+encodeURIComponent("ZPqmtkriy+gf9kP6NfdnUg==");
+    http.do("POST","http://17.194.0.81/vmdb-sso/user/oauth/login?"+bodyContent, null,null, function(res){
+        // success func
+        OUTPUT=res.data.data.token;
+       rtn = res.data.data.token;
+    }, function(err){
+        // error func
+        log.error(err.data);
+    })
+    return rtn;
+})();
 
-// do: Http request
-// params: method<string>, url<string>, header<object>, body<string>, successfunc<function>, errfunc<function>
-// return: none
-http.do("POST", "http://17.194.0.81/cmdb/dataSet/execute", {"Content-Type":"application/json"}, '{"password": "bW9uaXRvcipZd3h0YkA2Ng==","pageSize": 1000,"ciClass": "x86主机","type": 2,"pageNum": 1,"username": "monitor"}', function(message){
+var x86s = (function(){
+    var rtn = null;
+    try{
+        var mql = "select id from x86 limit -1";
+        rtn = _.map(odb.mql(mql).data,'id');
+    }catch(err){
+        log.error(err);
+    }
+    return rtn;
+})();
+
+http.do("POST", "http://17.194.0.81/cmdb/dataSet/execute", {"Content-Type":"application/json", "tk": token}, '{"pageSize": 1000,"ciClass": "rackServer","type": 2,"pageNum": 1}', function(message){
     // success func
     OUTPUT = message.data;
-    var traceArr = [];
+    
     _.forEach(message.data.data.data,function(v){
        
         var comp = _.template("insert into /cncc/entity/x86 (id,name,autofindtime,cpu,cpufreq,cpukernel,cpumodel,datasource,disk,hostid,hytype,manageip,memory,smvid,storage) values ('<%=id %>','<%=name %>','<%=autofindtime %>',<%=cpu %>,<%=cpufreq %>,'<%=cpukernel %>','<%=cpumodel %>','<%=datasource %>',<%=disk %>,<%=hostid %>,'<%=hytype %>','<%=manageip %>',<%=memory %>,'<%=smvid %>',<%=storage %>)");
         var attrs = v.attrs;
+        var x86Id = "x86:"+attrs['主机名称'];
+        var rack = attrs['INSTALLATIONPOSITION_BELONGCABINET'];
         
         var mql = comp({
-            id: "x86:"+attrs['主机名称'],
+            id: x86Id,
             name:attrs['主机名称'],
             datasource:attrs['数据来源'],
         	autofindtime:attrs['自动发现更新时间'],
-        	cpu:  attrs['CPU个数']?attrs['CPU个数']:0,
+        	cpu:  attrs['CPU核数']?attrs['CPU核数']:0,
         	cpufreq: attrs['CPU频率']?attrs['CPU频率']:0,
         	cpukernel:  attrs['CPU核数']?attrs['CPU核数']:0,
         	cpumodel: attrs['CPU型号'],
@@ -32,17 +47,27 @@ http.do("POST", "http://17.194.0.81/cmdb/dataSet/execute", {"Content-Type":"appl
         	disk: attrs['磁盘大小']?attrs['磁盘大小']:0,
         	hostid: attrs['主机ID']?attrs['主机ID']:0,
         	hytype:attrs['服务器支持的HY类型'],
-        	manageip:attrs['管理IP'],
+        	manageip:attrs['MANAGEMENTIP'],
         	memory: attrs['内存大小']?attrs['内存大小']:0,
-        	smvid:attrs['SMVID'],
+        	smvid:attrs['030200002020101200113A'],
         	storage: attrs['存储容量']?attrs['存储容量']:0
         })
-        traceArr.push(mql);
+        // log.debug(mql)
         odb.mql(mql);
+        
+        // 创建x86和机柜关系
+        var rackId = "rack:"+rack;
+        if( x86s.indexOf(x86Id) > -1 && !_.isEmpty(rackId)){
+            var mqlP = "create('"+x86Id+"') - [:connect] -> ('"+rackId+"')";
+            log.info(mqlP)
+            odb.mql(mqlP);
+        }else{
+            return;
+        }
     });
     
-    trace("x86主机",traceArr.join(";\n"),"txt");
+    
 }, function(message){
     // error func
-    log.info(message.data);
-})
+    log.error(message.data);
+},7200)

+ 16 - 2
cncc_serverjs/script/cncc/CMDB/业务.js

@@ -1,7 +1,21 @@
+var token = (function(){
+    var rtn = null;
+    var bodyContent = "loginCode="+encodeURIComponent("uinnova|meta@cfid.cn")+"&password="+encodeURIComponent("ZPqmtkriy+gf9kP6NfdnUg==");
+    http.do("POST","http://17.194.0.81/vmdb-sso/user/oauth/login?"+bodyContent, null,null, function(res){
+        // success func
+        OUTPUT=res.data.data.token;
+       rtn = res.data.data.token;
+    }, function(err){
+        // error func
+        log.error(err.data);
+    })
+    return rtn;
+})();
+
 // do: Http request
 // params: method<string>, url<string>, header<object>, body<string>, successfunc<function>, errfunc<function>
 // return: none
-http.do("POST", "http://17.194.0.81/cmdb/dataSet/execute", {"Content-Type":"application/json"}, '{"password": "bW9uaXRvcipZd3h0YkA2Ng==","pageSize": 1000,"ciClass": "应用系统","type": 2,"pageNum": 1,"username": "monitor"}', function(message){
+http.do("POST", "http://17.194.0.81/cmdb/dataSet/execute", {"Content-Type":"application/json", "tk": token}, '{"pageSize": 1000,"ciClass": "应用系统","type": 2,"pageNum": 1}', function(message){
     // success func
    OUTPUT = message.data;
     _.forEach(message.data.data.data,function(v){
@@ -33,4 +47,4 @@ http.do("POST", "http://17.194.0.81/cmdb/dataSet/execute", {"Content-Type":"appl
 }, function(message){
     // error func
     log.info(message.data);
-})
+},3600)

+ 18 - 3
cncc_serverjs/script/cncc/CMDB/分区.js

@@ -1,7 +1,22 @@
+var token = (function(){
+    var rtn = null;
+    var bodyContent = "loginCode="+encodeURIComponent("uinnova|meta@cfid.cn")+"&password="+encodeURIComponent("ZPqmtkriy+gf9kP6NfdnUg==");
+    http.do("POST","http://17.194.0.81/vmdb-sso/user/oauth/login?"+bodyContent, null,null, function(res){
+        // success func
+        OUTPUT=res.data.data.token;
+       rtn = res.data.data.token;
+    }, function(err){
+        // error func
+        log.error(err.data);
+    })
+    return rtn;
+})();
+
+
 // do: Http request
 // params: method<string>, url<string>, header<object>, body<string>, successfunc<function>, errfunc<function>
 // return: none
-http.do("POST", "http://17.194.0.81/cmdb/dataSet/execute", {"Content-Type":"application/json"}, '{"password": "bW9uaXRvcipZd3h0YkA2Ng==","pageSize": 5000,"ciClass": "分区","type": 2,"pageNum": 1,"username": "monitor"}', function(message){
+http.do("POST", "http://17.194.0.81/cmdb/dataSet/execute", {"Content-Type":"application/json", "tk": token}, '{"pageSize": 5000,"ciClass": "分区","type": 2,"pageNum": 1}', function(message){
     // success func
    OUTPUT = message.data;
    
@@ -41,10 +56,10 @@ http.do("POST", "http://17.194.0.81/cmdb/dataSet/execute", {"Content-Type":"appl
         	smvis:attrs['SMVID'],
         	title:attrs['应用系统']
         })
-        log.info(mql)
+        //log.info(mql)
        odb.mql(mql);
     });
 }, function(message){
     // error func
     log.info(message.data);
-})
+},3000)

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 115 - 0
cncc_serverjs/script/cncc/CMDB/分区_serverNode.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 64 - 26
cncc_serverjs/script/cncc/CMDB/小型机.js


+ 60 - 36
cncc_serverjs/script/cncc/CMDB/应用.js

@@ -1,36 +1,60 @@
-// do: Http request
-// params: method<string>, url<string>, header<object>, body<string>, successfunc<function>, errfunc<function>
-// return: none
-http.do("POST", "http://17.194.0.81/cmdb/dataSet/execute", {"Content-Type":"application/json"}, '{"password": "bW9uaXRvcipZd3h0YkA2Ng==","pageSize": 2000,"ciClass": "应用系统","type": 2,"pageNum": 1,"username": "monitor"}', function(message){
-    // success func
-   OUTPUT = message.data;
-   _.forEach(message.data.data.data,function(v){
-       
-        var comp = _.template("insert into /cncc/entity/app (id,name,appstatus, catalog, company, datasource, department, detail, number, org, smvid, title) values ('<%=id %>','<%=name %>','<%=appstatus %>','<%=catalog %>','<%=company %>','<%=datasource %>','<%=department %>','<%=detail %>',<%=number %>,'<%=org %>','<%=smvid %>','<%=title %>')");
-        var attrs = v.attrs;
-       
-        //应用定义
-        if(attrs['组织机构'] === '支付系统' || attrs['应用系统类别'] === '交易类') return;
-         
-        var mql = comp({
-            id: "app:"+attrs['软件名称'],
-            name:attrs['软件名称'],
-            appstatus:attrs['STATUS'],
-        	catalog:attrs['应用系统类别'],
-        	company:  attrs['承建单位'],
-        	datasource: attrs['CPU频率'],
-        	department:  attrs['所属部门'],
-        	detail: attrs['应用简介'],
-        	datasource:attrs['数据来源'],
-        	number: attrs['显示顺序'],
-        	org: attrs['组织机构'],
-        	smvid:attrs['SMVID'],
-        	title:attrs['应用系统名称']
-        })
-        log.info(mql)
-        odb.mql(mql);
-    });
-}, function(message){
-    // error func
-    log.info(message.data);
-})
+var token = (function(){
+    var rtn = null;
+    var bodyContent = "loginCode="+encodeURIComponent("uinnova|meta@cfid.cn")+"&password="+encodeURIComponent("ZPqmtkriy+gf9kP6NfdnUg==");
+    http.do("POST","http://17.194.0.81/vmdb-sso/user/oauth/login?"+bodyContent, null,null, function(res){
+        // success func
+        OUTPUT=res.data.data.token;
+       rtn = res.data.data.token;
+    }, function(err){
+        // error func
+        log.error(err.data);
+    })
+    return rtn;
+})();
+
+var main = function(){
+    // do: Http request
+    // params: method<string>, url<string>, header<object>, body<string>, successfunc<function>, errfunc<function>
+    // return: none
+    http.do("POST", "http://17.194.0.81/cmdb/dataSet/execute", {"Content-Type":"application/json", "tk": token}, '{"pageSize": 2000,"ciClass": "应用系统","type": 2,"pageNum": 1}', function(message){
+        // success func
+       OUTPUT = message.data.data.data;
+       _.forEach(message.data.data.data,function(v){
+           
+            var comp = _.template("insert into /cncc/entity/app (id,name,appstatus, catalog, company, datasource, department, detail, number, org, smvid, title) values ('<%=id %>','<%=name %>','<%=appstatus %>','<%=catalog %>','<%=company %>','<%=datasource %>','<%=department %>','<%=detail %>',<%=number %>,'<%=org %>','<%=smvid %>','<%=title %>')");
+            var attrs = v.attrs;
+           
+            //应用定义
+            // if( attrs.hasOwnProperty('组织机构') ){
+            //     if( attrs['组织机构'] === '支付系统' ) return;       
+            // }
+            
+            // if( attrs.hasOwnProperty('应用系统类别') ){
+            //     if( attrs['应用系统类别'] === '交易类' ) return;       
+            // }
+            
+            var mql = comp({
+                id: "app:"+attrs['软件名称'],
+                name:attrs['软件名称'],
+                appstatus:attrs['STATUS'],
+            	catalog:attrs['应用系统类别'],
+            	company:  attrs['承建单位'],
+            	datasource: attrs['CPU频率'],
+            	department:  attrs['所属部门'],
+            	detail: attrs['应用简介'],
+            	datasource:attrs['数据来源'],
+            	number: attrs['显示顺序'],
+            	org: attrs['组织机构'],
+            	smvid:attrs['SMVID'],
+            	title:attrs['应用系统名称']
+            })
+            log.info(mql)
+            odb.mql(mql);
+        });
+    }, function(message){
+        // error func
+        log.info(message.data);
+    })
+};
+
+main();

+ 16 - 1
cncc_serverjs/script/cncc/CMDB/应用类别.js

@@ -1,7 +1,22 @@
+var token = (function(){
+    var rtn = null;
+    var bodyContent = "loginCode="+encodeURIComponent("uinnova|meta@cfid.cn")+"&password="+encodeURIComponent("ZPqmtkriy+gf9kP6NfdnUg==");
+    http.do("POST","http://17.194.0.81/vmdb-sso/user/oauth/login?"+bodyContent, null,null, function(res){
+        // success func
+        OUTPUT=res.data.data.token;
+       rtn = res.data.data.token;
+    }, function(err){
+        // error func
+        log.error(err.data);
+    })
+    return rtn;
+})();
+
+
 // do: Http request
 // params: method<string>, url<string>, header<object>, body<string>, successfunc<function>, errfunc<function>
 // return: none
-http.do("POST", "http://17.194.0.81/cmdb/dataSet/execute", {"Content-Type":"application/json"}, '{"password": "bW9uaXRvcipZd3h0YkA2Ng==","pageSize": 1000,"ciClass": "应用系统类别","type": 2,"pageNum": 1,"username": "monitor"}', function(message){
+http.do("POST", "http://17.194.0.81/cmdb/dataSet/execute", {"Content-Type":"application/json", "tk": token}, '{"pageSize": 1000,"ciClass": "应用系统类别","type": 2,"pageNum": 1}', function(message){
     // success func
    OUTPUT = message.data;
 }, function(message){

+ 16 - 6
cncc_serverjs/script/cncc/CMDB/数据中心.js

@@ -1,8 +1,18 @@
-// do: Http request
-// params: method<string>, url<string>, header<object>, body<string>, successfunc<function>, errfunc<function>
-// return: none
+var token = (function(){
+    var rtn = null;
+    var bodyContent = "loginCode="+encodeURIComponent("uinnova|meta@cfid.cn")+"&password="+encodeURIComponent("ZPqmtkriy+gf9kP6NfdnUg==");
+    http.do("POST","http://17.194.0.81/vmdb-sso/user/oauth/login?"+bodyContent, null,null, function(res){
+        // success func
+        OUTPUT=res.data.data.token;
+       rtn = res.data.data.token;
+    }, function(err){
+        // error func
+        log.error(err.data);
+    })
+    return rtn;
+})();
 
-http.do("POST", "http://17.194.0.81/cmdb/dataSet/execute", {"Content-Type":"application/json"}, '{"password": "bW9uaXRvcipZd3h0YkA2Ng==","pageSize": 1000,"ciClass": "数据中心","type": 2,"pageNum": 1,"username": "monitor"}', function(message){
+http.do("POST", "http://17.194.0.81/cmdb/dataSet/execute", {"Content-Type":"application/json", "tk": token}, '{"pageSize": 1000,"ciClass": "数据中心","type": 2,"pageNum": 1}', function(message){
     // success func
    
   _.forEach(message.data.data.data,function(v){
@@ -11,8 +21,8 @@ http.do("POST", "http://17.194.0.81/cmdb/dataSet/execute", {"Content-Type":"appl
     var attrs = v.attrs;
     
     var mql = comp({
-        id: "dc:"+attrs['IDUNIQUE'],
-        name:attrs['名称'],
+        id: "datacenter:" + attrs['名称'],
+        name: attrs['名称'],
         datasource:attrs['数据来源'],
         dcstatus:attrs['STATUS'],
         org:attrs['组织机构'],

+ 48 - 7
cncc_serverjs/script/cncc/CMDB/机房.js

@@ -1,16 +1,48 @@
-// do: Http request
-// params: method<string>, url<string>, header<object>, body<string>, successfunc<function>, errfunc<function>
-// return: none
-http.do("POST", "http://17.194.0.81/cmdb/dataSet/execute", {"Content-Type":"application/json"}, '{"password": "bW9uaXRvcipZd3h0YkA2Ng==","pageSize": 1000,"ciClass": "机房","type": 2,"pageNum": 1,"username": "monitor"}', function(message){
+var token = (function(){
+    var rtn = null;
+    var bodyContent = "loginCode="+encodeURIComponent("uinnova|meta@cfid.cn")+"&password="+encodeURIComponent("ZPqmtkriy+gf9kP6NfdnUg==");
+    http.do("POST","http://17.194.0.81/vmdb-sso/user/oauth/login?"+bodyContent, null,null, function(res){
+        // success func
+        OUTPUT=res.data.data.token;
+       rtn = res.data.data.token;
+    }, function(err){
+        // error func
+        log.error(err.data);
+    })
+    return rtn;
+})();
+
+var rooms = (function(){
+    var rtn = null;   
+    try{
+        rtn = _.values(_.map(odb.mql("select id from room limit -1").data,'id'));
+    }catch(err){
+        log.error(err);
+    }
+    return rtn;
+})();
+
+var dcs = (function(){
+    var rtn = null;   
+    try{
+        rtn = _.values(_.map(odb.mql("select id from datacenter limit -1").data,'id'));
+    }catch(err){
+        log.error(err);
+    }
+    return rtn;
+})();
+
+http.do("POST", "http://17.194.0.81/cmdb/dataSet/execute", {"Content-Type":"application/json", "tk": token}, '{"pageSize": 1000,"ciClass": "机房","type": 2,"pageNum": 1}', function(message){
     // success func
    OUTPUT = message.data.data.data;
     _.forEach(message.data.data.data,function(v){
     
     var comp = _.template("INSERT INTO /cncc/entity/room (id,name,building, datacenter, floor,smvid,title)  values ('<%=id %>','<%=name %>','<%=building %>','<%=datacenter %>','<%=floor %>','<%=smvid %>','<%=title %>')");
     var attrs = v.attrs;
+    var id = "room:"+attrs['机房编号'];
     
     var mql = comp({
-        id: "room:"+attrs['机房编号'],
+        id: id,
         name:attrs['机房编号'],
         building:attrs['楼栋'], 
         datacenter:attrs['数据中心'], 
@@ -18,10 +50,19 @@ http.do("POST", "http://17.194.0.81/cmdb/dataSet/execute", {"Content-Type":"appl
         smvid:attrs['SMVID'], 
         title:attrs['机房名称']
     })
-     log.info(mql)
+    
+    log.info(mql)
     odb.mql(mql);
+    
+    // 创建机房与数据中心的连接关系
+    var dcId = "datacenter:" + attrs['数据中心'];
+    if( dcs.indexOf(dcId) > -1 && rooms.indexOf(id) > -1){
+        var edge2 = "create('"+ id +"') - [:connect] -> ('"+ dcId +"')";
+        log.debug(edge2)
+        odb.mql(edge2);
+    }
  })
 }, function(message){
     // error func
     log.info(message.data);
-})
+},3600)

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 47 - 9
cncc_serverjs/script/cncc/CMDB/机柜.js


+ 0 - 29
cncc_serverjs/script/cncc/DIEP/test.js

@@ -1,29 +0,0 @@
- var param = JSON.stringify({"apikey":"API_META_LARGE_MONTH_TYPICAL_SUMMIT_DAY","param":{"extparam":{"settdate":"20181017"}}});
-          
-var token = (function(){
-    var rtn = null;
-    var bodyContent = JSON.stringify({
-        "username":"meta",
-        "password":"meta"
-    });
-    http.do("POST", "http://111.1.12.155:9086/bdosservice/login", {"Authorization": "Basic cGJjczpwYmNz","Content-Type": "application/json"}, bodyContent, function(message){
-        // success func
-        //OUTPUT = message.data;
-        //log.debug(message.data.data)
-        rtn = message.data.data.token;
-    }, function(message){
-        // error func
-        log.error(message.data);
-    })
-    return rtn;
-})();
- 
- http.do("POST", "http://111.1.12.155:9086/bdosservice/query/list", {"X-Token": token,"Content-Type": "application/json"}, param, function(message){
-    // success func
-    OUTPUT =  message.data;
-    //dfs.write(file, message.data);
-}, function(message){
-    // error func
-    log.error(message.data);
-    return;
-},300)  

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 23
cncc_serverjs/script/cncc/DIEP/test_csv.js


+ 0 - 593
cncc_serverjs/script/cncc/DIEP/报告参数_POSTMAN.js

@@ -1,593 +0,0 @@
-var postman = {
-	"info": {
-		"_postman_id": "aa3caf6a-6204-4b70-84c0-6b98ae0b596f",
-		"name": "生产对外",
-		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
-	},
-	"item": [
-		{
-			"name": "网银热点账户统计",
-			"item": [
-				{
-					"name": "每日网银热点账户截图示例-网银分时",
-					"request": {
-						"method": "POST",
-						"header": [
-							{
-								"key": "Content-Type",
-								"name": "Content-Type",
-								"type": "text",
-								"value": "application/json"
-							},
-							{
-								"key": "X-Token",
-								"value": "tokens408c5b07-7026-42a5-9f94-8f449230ea01",
-								"type": "text"
-							}
-						],
-						"body": {
-							"mode": "raw",
-							"raw": "{\n\t\"apikey\":\"API_META_EBANK_TIME_SHARING\",\n\t\"param\":{\n\t\t\"extparam\":{\n\t\t\t\"recvdate\":\"20221021\",\n\t\t\t\"nodecode\":\"011523017044\"\n\t\t}\n\t}\n}"
-						},
-						"url": {
-							"raw": "111.1.12.155:9086/bdosservice/query/list",
-							"host": [
-								"111",
-								"1",
-								"12",
-								"155"
-							],
-							"port": "9086",
-							"path": [
-								"bdosservice",
-								"query",
-								"list"
-							]
-						}
-					},
-					"response": []
-				},
-				{
-					"name": "网银热点账户业务量示例",
-					"request": {
-						"method": "POST",
-						"header": [
-							{
-								"key": "Content-Type",
-								"name": "Content-Type",
-								"value": "application/json",
-								"type": "text"
-							},
-							{
-								"key": "X-Token",
-								"value": "tokens9896d396-6278-410f-b297-d1e8b32d238c",
-								"type": "text"
-							}
-						],
-						"body": {
-							"mode": "raw",
-							"raw": "{\n\t\"apikey\":\"API_META_EBANK_ACCOUNT\",\n\t\"param\":{\n\t\t\"extparam\":{\n\t\t\t\"netdate\":\"20160506\"\n\t\t}\n\t}\n}"
-						},
-						"url": {
-							"raw": "111.1.12.155:9086/bdosservice/query/list",
-							"host": [
-								"111",
-								"1",
-								"12",
-								"155"
-							],
-							"port": "9086",
-							"path": [
-								"bdosservice",
-								"query",
-								"list"
-							]
-						}
-					},
-					"response": []
-				},
-				{
-					"name": "每日网银热点账户截图示例-网银累计",
-					"request": {
-						"method": "POST",
-						"header": [
-							{
-								"key": "Content-Type",
-								"name": "Content-Type",
-								"type": "text",
-								"value": "application/json"
-							},
-							{
-								"key": "X-Token",
-								"value": "tokens408c5b07-7026-42a5-9f94-8f449230ea01",
-								"type": "text"
-							}
-						],
-						"body": {
-							"mode": "raw",
-							"raw": "{\n\t\"apikey\":\"API_META_EBANK_CUMULATIVE\",\n\t\"param\":{\n\t\t\"extparam\":{\n\t\t\t\"recvdate\":\"20221021\",\n\t\t\t\"nodecode\":\"011523017044\"\n\t\t}\n\t}\n}"
-						},
-						"url": {
-							"raw": "111.1.12.155:9086/bdosservice/query/list",
-							"host": [
-								"111",
-								"1",
-								"12",
-								"155"
-							],
-							"port": "9086",
-							"path": [
-								"bdosservice",
-								"query",
-								"list"
-							]
-						}
-					},
-					"response": []
-				}
-			]
-		},
-		{
-			"name": "业务系统高峰时段业务量统计",
-			"item": [
-				{
-					"name": "大额",
-					"request": {
-						"method": "POST",
-						"header": [
-							{
-								"key": "Content-Type",
-								"name": "Content-Type",
-								"type": "text",
-								"value": "application/json"
-							},
-							{
-								"key": "X-Token",
-								"value": "tokens9209c082-9d46-4d23-a24d-1d969555b79b",
-								"type": "text"
-							}
-						],
-						"body": {
-							"mode": "raw",
-							"raw": "{\n\t\"apikey\":\"API_META_LARGE_PEAK_STATEMENT\",\n\t\"param\":{\n\t\t\"extparam\":{\n\t\t\t\"settdate\":\"20181017\",\n\t\t\t\"timeid\":\"32\"\n\t\t}\n\t}\n}"
-						},
-						"url": {
-							"raw": "111.1.12.155:9086/bdosservice/query/list",
-							"host": [
-								"111",
-								"1",
-								"12",
-								"155"
-							],
-							"port": "9086",
-							"path": [
-								"bdosservice",
-								"query",
-								"list"
-							]
-						}
-					},
-					"response": []
-				},
-				{
-					"name": "小额",
-					"request": {
-						"method": "POST",
-						"header": [
-							{
-								"key": "Content-Type",
-								"name": "Content-Type",
-								"value": "application/json",
-								"type": "text"
-							},
-							{
-								"key": "X-Token",
-								"value": "tokens9209c082-9d46-4d23-a24d-1d969555b79b",
-								"type": "text"
-							}
-						],
-						"body": {
-							"mode": "raw",
-							"raw": "{\n\t\"apikey\":\"API_META_SMALL_PEAK_STATEMENT\",\n\t\"param\":{\n\t\t\"extparam\":{\n\t\t\t\"netdate\":\"20220501\",\n\t\t\t\"timeid\":\"32\"\n\t\t}\n\t}\n}"
-						},
-						"url": {
-							"raw": "111.1.12.155:9086/bdosservice/query/list",
-							"host": [
-								"111",
-								"1",
-								"12",
-								"155"
-							],
-							"port": "9086",
-							"path": [
-								"bdosservice",
-								"query",
-								"list"
-							]
-						}
-					},
-					"response": []
-				},
-				{
-					"name": "网银",
-					"request": {
-						"method": "POST",
-						"header": [
-							{
-								"key": "Content-Type",
-								"name": "Content-Type",
-								"value": "application/json",
-								"type": "text"
-							},
-							{
-								"key": "X-Token",
-								"value": "tokens9209c082-9d46-4d23-a24d-1d969555b79b",
-								"type": "text"
-							}
-						],
-						"body": {
-							"mode": "raw",
-							"raw": "{\n\t\"apikey\":\"API_META_EBANK_PEAK_STATEMENT\",\n\t\"param\":{\n\t\t\"extparam\":{\n\t\t\t\"netdate\":\"20160506\",\n\t\t\t\"timeid\":\"32\"\n\t\t}\n\t}\n}"
-						},
-						"url": {
-							"raw": "111.1.12.155:9086/bdosservice/query/list",
-							"host": [
-								"111",
-								"1",
-								"12",
-								"155"
-							],
-							"port": "9086",
-							"path": [
-								"bdosservice",
-								"query",
-								"list"
-							]
-						}
-					},
-					"response": []
-				}
-			]
-		},
-		{
-			"name": "大额、小额、网银系统典型日期分时业务量数据",
-			"item": [
-				{
-					"name": "大额",
-					"request": {
-						"method": "POST",
-						"header": [
-							{
-								"key": "Content-Type",
-								"name": "Content-Type",
-								"value": "application/json",
-								"type": "text"
-							},
-							{
-								"key": "X-Token",
-								"value": "tokens597631f0-9ea7-4eef-9ac6-6afc34bb2a2a",
-								"type": "text"
-							}
-						],
-						"body": {
-							"mode": "raw",
-							"raw": "{\n\t\"apikey\":\"API_META_LARGE_MONTH_TYPICAL_SUMMIT_DAY\",\n\t\"param\":{\n\t\t\"extparam\":{\n\t\t\t\"settdate\":\"20181017\"\n\t\t}\n\t}\n}"
-						},
-						"url": {
-							"raw": "111.1.12.155:9086/bdosservice/query/list",
-							"host": [
-								"111",
-								"1",
-								"12",
-								"155"
-							],
-							"port": "9086",
-							"path": [
-								"bdosservice",
-								"query",
-								"list"
-							]
-						}
-					},
-					"response": []
-				},
-				{
-					"name": "小额",
-					"request": {
-						"method": "POST",
-						"header": [
-							{
-								"key": "Content-Type",
-								"name": "Content-Type",
-								"value": "application/json",
-								"type": "text"
-							},
-							{
-								"key": "X-Token",
-								"value": "tokens597631f0-9ea7-4eef-9ac6-6afc34bb2a2a",
-								"type": "text"
-							}
-						],
-						"body": {
-							"mode": "raw",
-							"raw": "{\n\t\"apikey\":\"API_META_SMALL_MONTH_TYPICAL_SUMMIT_DAY\",\n\t\"param\":{\n\t\t\"extparam\":{\n\t\t\t\"netdate\":\"20220526\"\n\t\t}\n\t}\n}"
-						},
-						"url": {
-							"raw": "111.1.12.155:9086/bdosservice/query/list",
-							"host": [
-								"111",
-								"1",
-								"12",
-								"155"
-							],
-							"port": "9086",
-							"path": [
-								"bdosservice",
-								"query",
-								"list"
-							]
-						}
-					},
-					"response": []
-				},
-				{
-					"name": "网银",
-					"request": {
-						"method": "POST",
-						"header": [
-							{
-								"key": "Content-Type",
-								"name": "Content-Type",
-								"value": "application/json",
-								"type": "text"
-							},
-							{
-								"key": "X-Token",
-								"value": "tokens597631f0-9ea7-4eef-9ac6-6afc34bb2a2a",
-								"type": "text"
-							}
-						],
-						"body": {
-							"mode": "raw",
-							"raw": "{\n\t\"apikey\":\"API_META_EBANK_MONTH_TYPICAL_SUMMIT_DAY\",\n\t\"param\":{\n\t\t\"extparam\":{\n\t\t\t\"netdate\":\"20160506\"\n\t\t}\n\t}\n}"
-						},
-						"url": {
-							"raw": "111.1.12.155:9086/bdosservice/query/list",
-							"host": [
-								"111",
-								"1",
-								"12",
-								"155"
-							],
-							"port": "9086",
-							"path": [
-								"bdosservice",
-								"query",
-								"list"
-							]
-						}
-					},
-					"response": []
-				}
-			]
-		},
-		{
-			"name": "企业信息联网核查日报",
-			"request": {
-				"method": "POST",
-				"header": [
-					{
-						"key": "Content-Type",
-						"name": "Content-Type",
-						"value": "application/json",
-						"type": "text"
-					},
-					{
-						"key": "X-Token",
-						"value": "tokens0b966e52-dc44-4ad1-80ce-a8746f2d56f1",
-						"type": "text"
-					}
-				],
-				"body": {
-					"mode": "raw",
-					"raw": "{\n  \"apikey\":\"API_META_BDPSAS_REPORT\",\n  \"param\": {\n  \t\"starttime\":\"20211201\",\n  \t\"endtime\":\"20220730\",\n    \"tpname\":\"MIVS日报(系统一部)\"\n  }\n}"
-				},
-				"url": {
-					"raw": "111.1.12.155:9086/bdosservice/query/streamdata",
-					"host": [
-						"111",
-						"1",
-						"12",
-						"155"
-					],
-					"port": "9086",
-					"path": [
-						"bdosservice",
-						"query",
-						"streamdata"
-					]
-				}
-			},
-			"response": []
-		},
-		{
-			"name": "系统运行质量日报",
-			"request": {
-				"method": "POST",
-				"header": [
-					{
-						"key": "Content-Type",
-						"name": "Content-Type",
-						"type": "text",
-						"value": "application/json"
-					},
-					{
-						"key": "X-Token",
-						"type": "text",
-						"value": "tokens9896d396-6278-410f-b297-d1e8b32d238c"
-					}
-				],
-				"body": {
-					"mode": "raw",
-					"raw": "{\n  \"apikey\":\"API_META_BDPSAS_REPORT\",\n  \"param\": {\n  \t\"starttime\":\"20211201\",\n  \t\"endtime\":\"20220730\",\n    \"tpname\":\"MIVS日报(系统一部)\"\n  }\n}"
-				},
-				"url": {
-					"raw": "111.1.12.155:9086/bdosservice/query/streamdata",
-					"host": [
-						"111",
-						"1",
-						"12",
-						"155"
-					],
-					"port": "9086",
-					"path": [
-						"bdosservice",
-						"query",
-						"streamdata"
-					]
-				}
-			},
-			"response": []
-		},
-		{
-			"name": "七大行每日发起峰值统计",
-			"request": {
-				"method": "POST",
-				"header": [
-					{
-						"key": "Content-Type",
-						"name": "Content-Type",
-						"type": "text",
-						"value": "application/json"
-					},
-					{
-						"key": "X-Token",
-						"type": "text",
-						"value": "tokens408c5b07-7026-42a5-9f94-8f449230ea01"
-					}
-				],
-				"body": {
-					"mode": "raw",
-					"raw": "{\n\t\"apikey\":\"API_META_SEVEN_DAILY_APEX\",\n\t\"param\":{\n\t\t\"extparam\":{\n\t\t\t\"syscode\":\"IBPS\",\n\t\t\t\"nodecode\":\"0000\",\n\t\t\t\"caldate\":\"20221021\"\n\t\t}\n\t}\n}"
-				},
-				"url": {
-					"raw": "111.1.12.155:9086/bdosservice/query/list",
-					"host": [
-						"111",
-						"1",
-						"12",
-						"155"
-					],
-					"port": "9086",
-					"path": [
-						"bdosservice",
-						"query",
-						"list"
-					]
-				}
-			},
-			"response": []
-		},
-		{
-			"name": "业务月报数据获取",
-			"request": {
-				"method": "POST",
-				"header": [
-					{
-						"key": "Content-Type",
-						"name": "Content-Type",
-						"type": "text",
-						"value": "application/json"
-					},
-					{
-						"key": "X-Token",
-						"value": "tokens14f0121e-d476-418b-bd98-eee12850a254",
-						"type": "text"
-					}
-				],
-				"body": {
-					"mode": "raw",
-					"raw": "{\n  \"apikey\":\"API_META_BDPSAS_REPORT\",\n  \"param\": {\n  \t\"starttime\":\"20211201\",\n  \t\"endtime\":\"20220730\",\n    \"tpname\":\"MIVS日报(系统一部)\"\n  }\n}"
-				},
-				"url": {
-					"raw": "111.1.12.155:9086/bdosservice/query/streamdata",
-					"host": [
-						"111",
-						"1",
-						"12",
-						"155"
-					],
-					"port": "9086",
-					"path": [
-						"bdosservice",
-						"query",
-						"streamdata"
-					]
-				}
-			},
-			"response": []
-		},
-		{
-			"name": "票据获取",
-			"request": {
-				"method": "POST",
-				"header": [
-					{
-						"key": "Content-Type",
-						"name": "Content-Type",
-						"value": "application/json",
-						"type": "text"
-					}
-				],
-				"body": {
-					"mode": "raw",
-					"raw": "{\n\t\"username\":\"meta\",\n\t\"password\":\"meta\"\n}"
-				},
-				"url": {
-					"raw": "111.1.12.155:9086/bdosservice/login",
-					"host": [
-						"111",
-						"1",
-						"12",
-						"155"
-					],
-					"port": "9086",
-					"path": [
-						"bdosservice",
-						"login"
-					]
-				}
-			},
-			"response": []
-		}
-	]
-};
-
-OUTPUT = _.map(postman.item,function(v){
-    var item = {};
-    item['name'] = v.name || null;
-    item['items'] = v.item ? _.map(v.item,function(val){
-        var o = {};
-        
-        o['name'] = val.name;
-        o['type'] = val.request.url.raw.indexOf('streamdata') != -1 ? 'docx' : 'csv'
-        o['method'] = val.request.method;
-        
-        var params = JSON.parse(val.request.body.raw);
-        o['param'] = params;
-        o['url'] = val.request.url.raw;
-        return o;
-    }) : _.map([v.request],function(val){
-        var o = {};
-        
-        o['name'] = val.name || null;
-        o['type'] = val.url.raw.indexOf('streamdata') != -1 ? 'docx' : 'csv'
-        o['method'] = val.method;
-        
-        var params = JSON.parse(val.body.raw);
-        o['param'] = params;
-        o['url'] = val.url.raw;
-        return o;
-    })
-    return item;
-})

+ 0 - 45
cncc_serverjs/script/cncc/DIEP/报告参数_文本.js

@@ -1,45 +0,0 @@
-OUTPUT = ["支付系统业务数据统计报告","系统运行质量日报_大额平行(北京)",
-    "系统运行质量日报_SCPS(北京)",
-    "系统运行质量日报_PMTS(无锡)",
-    "系统运行质量日报_PMTS(北京)",
-    "系统运行质量日报_PMTS(上海)",
-    "系统运行质量日报_MIVS(北京)",
-    "系统运行质量日报_FXCC(上海)",
-    "系统运行质量日报_IBPS_Power实例(无锡)",
-    "系统运行质量日报_SCPS(上海)",
-    "系统运行质量日报_PN2N(无锡)",
-    "系统运行质量日报_IMGS(北京)",
-    "系统运行质量日报_IMGS(上海)",
-    "系统运行质量日报_FXCC(北京)",
-    "系统运行质量日报_CIPSGW(无锡)",
-    "系统运行质量日报_CIPS(上海)",
-    "系统运行质量日报_MAPS(上海)",
-    "系统运行质量日报_MAPS(北京)",
-    "系统运行质量日报_PN2N(上海)",
-    "系统运行质量日报_PN2N(北京)",
-    "系统运行质量日报_HVPS(上海)",
-    "系统运行质量日报_HVPS(北京)",
-    "系统运行质量日报_BEPS(上海)",
-    "系统运行质量日报_BEPS(北京)",
-    "系统运行质量日报_IBPS_Power实例(上海)",
-    "系统运行质量日报_IBPS_Power实例(北京)",
-    "系统运行质量日报_IBPS主机实例(上海)",
-    "系统运行质量日报_IBPS主机实例(北京)",
-    "系统运行质量日报_NETS(上海)",
-    "系统运行质量日报_NETS(北京)",
-    "系统运行质量日报_SAPS(上海)",
-    "系统运行质量日报_SAPS(北京)",
-    "系统运行质量日报_CIPS(无锡)",
-    "系统运行质量日报_CIPSGW(上海)",
-    "系统运行质量日报_ELCS(上海)",
-    "系统运行质量日报_ELCS(北京)",
-    "系统运行质量日报_MIVS(上海)"].map(function(v){
-        return {
-                "apikey":"API_META_BDPSAS_REPORT",
-                "param":{
-                    "starttime":"20211201",
-                    "endtime":"20221025",
-                    "tpname": v
-                }
-        }
-    })

+ 0 - 307
cncc_serverjs/script/cncc/DIEP/接入报告.js

@@ -1,307 +0,0 @@
-var ipport = "27.192.140.126:9082"
-var input =  [
-    {
-      "items": [
-        {
-          "method": "POST",
-          "name": "每日网银热点账户截图示例-网银分时",
-          "param": {
-            "apikey": "API_META_EBANK_TIME_SHARING",
-            "param": {
-              "extparam": {
-                "nodecode": "308584000013",
-                "recvdate": "20221201"
-              }
-            }
-          },
-          "type": "csv",
-          "url": ipport+"/bdosservice/query/list"
-        },
-        {
-          "method": "POST",
-          "name": "网银热点账户业务量示例",
-          "param": {
-            "apikey": "API_META_EBANK_ACCOUNT",
-            "param": {
-              "extparam": {
-                "netdate": "20160506"
-              }
-            }
-          },
-          "type": "csv",
-          "url": ipport+"/bdosservice/query/list"
-        },
-        {
-          "method": "POST",
-          "name": "每日网银热点账户截图示例-网银累计",
-          "param": {
-            "apikey": "API_META_EBANK_CUMULATIVE",
-            "param": {
-              "extparam": {
-                "nodecode": "308584000013",
-                "recvdate": "20221201"
-              }
-            }
-          },
-          "type": "csv",
-          "url": ipport+"/bdosservice/query/list"
-        }
-      ],
-      "name": "网银热点账户统计"
-    },
-    {
-      "items": [
-        {
-          "method": "POST",
-          "name": "大额",
-          "param": {
-            "apikey": "API_META_LARGE_PEAK_STATEMENT",
-            "param": {
-              "extparam": {
-                "settdate": "20181017",
-                "timeid": "32"
-              }
-            }
-          },
-          "type": "csv",
-          "url": ipport+"/bdosservice/query/list"
-        },
-        {
-          "method": "POST",
-          "name": "小额",
-          "param": {
-            "apikey": "API_META_SMALL_PEAK_STATEMENT",
-            "param": {
-              "extparam": {
-                "netdate": "20220501",
-                "timeid": "32"
-              }
-            }
-          },
-          "type": "csv",
-          "url": ipport+"/bdosservice/query/list"
-        },
-        {
-          "method": "POST",
-          "name": "网银",
-          "param": {
-            "apikey": "API_META_EBANK_PEAK_STATEMENT",
-            "param": {
-              "extparam": {
-                "netdate": "20160506",
-                "timeid": "32"
-              }
-            }
-          },
-          "type": "csv",
-          "url": ipport+"/bdosservice/query/list"
-        }
-      ],
-      "name": "业务系统高峰时段业务量统计"
-    },
-    {
-      "items": [
-        {
-          "method": "POST",
-          "name": "大额",
-          "param": {
-            "apikey": "API_META_LARGE_MONTH_TYPICAL_SUMMIT_DAY",
-            "param": {
-              "extparam": {
-                "settdate": "20181017"
-              }
-            }
-          },
-          "type": "csv",
-          "url": ipport+"/bdosservice/query/list"
-        },
-        {
-          "method": "POST",
-          "name": "小额",
-          "param": {
-            "apikey": "API_META_SMALL_MONTH_TYPICAL_SUMMIT_DAY",
-            "param": {
-              "extparam": {
-                "netdate": "20220526"
-              }
-            }
-          },
-          "type": "csv",
-          "url": ipport+"/bdosservice/query/list"
-        },
-        {
-          "method": "POST",
-          "name": "网银",
-          "param": {
-            "apikey": "API_META_EBANK_MONTH_TYPICAL_SUMMIT_DAY",
-            "param": {
-              "extparam": {
-                "netdate": "20160506"
-              }
-            }
-          },
-          "type": "csv",
-          "url": ipport+"/bdosservice/query/list"
-        }
-      ],
-      "name": "大额、小额、网银系统典型日期分时业务量数据"
-    },
-    {
-      "items": [
-        {
-          "method": "POST",
-          "name": null,
-          "param": {
-            "apikey": "API_META_BDPSAS_REPORT",
-            "param": {
-              "endtime": "20220730",
-              "starttime": "20211201",
-              "tpname": "MIVS日报(系统一部)"
-            }
-          },
-          "type": "docx",
-          "url": ipport+"/bdosservice/query/streamdata"
-        }
-      ],
-      "name": "企业信息联网核查日报"
-    },
-    {
-      "items": [
-        {
-          "method": "POST",
-          "name": null,
-          "param": {
-            "apikey": "API_META_BDPSAS_REPORT",
-            "param": {
-              "endtime": "20220730",
-              "starttime": "20211201",
-              "tpname": "MIVS日报(系统一部)"
-            }
-          },
-          "type": "docx",
-          "url": ipport+"/bdosservice/query/streamdata"
-        }
-      ],
-      "name": "系统运行质量日报"
-    },
-    {
-      "items": [
-        {
-          "method": "POST",
-          "name": null,
-          "param": {
-            "apikey": "API_META_SEVEN_DAILY_APEX",
-            "param": {
-              "extparam": {
-                "caldate": "20221201",
-                "nodecode": "308584000013",
-                "syscode": "IBPS"
-              }
-            }
-          },
-          "type": "csv",
-          "url": ipport+"/bdosservice/query/list"
-        }
-      ],
-      "name": "七大行每日发起峰值统计"
-    },
-    {
-      "items": [
-        {
-          "method": "POST",
-          "name": null,
-          "param": {
-            "apikey": "API_META_BDPSAS_REPORT",
-            "param": {
-              "endtime": "20220730",
-              "starttime": "20211201",
-              "tpname": "MIVS日报(系统一部)"
-            }
-          },
-          "type": "docx",
-          "url": ipport+"/bdosservice/query/streamdata"
-        }
-      ],
-      "name": "业务月报数据获取"
-    }
-  ];
-
-var DFS_PATH = "/opt/knowledge/DIEP";
-
-// JSON to CSV Converter
-function ConvertToCSV(objArray) {
-    var array = typeof objArray != 'object' ? JSON.parse(objArray) : objArray;
-    var str = '';
-
-    for (var i = 0; i < array.length; i++) {
-        var line = '';
-        for (var index in array[i]) {
-            if (line != '') line += ','
-
-            line += array[i][index];
-        }
-
-        str += line + '\r\n';
-    }
-
-    return str;
-};
-
-var token = (function(){
-    var rtn = null;
-    var bodyContent = JSON.stringify({
-        "username":"meta",
-        "password":"meta"
-    });
-    http.do("POST", "http://"+ipport+"/bdosservice/login", {"Authorization": "Basic cGJjczpwYmNz","Content-Type": "application/json"}, bodyContent, function(message){
-        // success func
-        //OUTPUT = message.data;
-        //log.debug(message.data.data)
-        rtn = message.data.data.token;
-    }, function(message){
-        // error func
-        log.error(message.data);
-    })
-    return rtn;
-})();
-
-var main = function(){
-    
-    _.forEach(input,function(re){
-        
-        var curDay = new Date().toJSON().substring(0,10)
-        _.forEach(re.items,function(subFile){
-            if(subFile.type === 'docx') {
-                var fileName = subFile.param.param.tpname + "_" + subFile.param.param.starttime + "-" + subFile.param.param.endtime + ".docx";
-                var file = [DFS_PATH, curDay, re.name, fileName].join("/");
-                log.debug(111, file, subFile.method, subFile.url, JSON.stringify(subFile.param))
-                http.do(subFile.method, "http://"+subFile.url, {"X-Token": token,"Content-Type": "application/json"}, JSON.stringify(subFile.param), function(message){
-                    // success func
-                    //OUTPUT = file;
-                    dfs.write(file, message.data);
-                }, function(message){
-                    // error func
-                    log.error(message.data);
-                },300)  
-            } else{
-                var fileName = (subFile.name || re.name) + ".csv";
-                var file = [DFS_PATH, curDay, re.name, fileName].join("/");
-                var param = subFile.param ? JSON.stringify(subFile.param) : null;
-                log.debug(222,  "http://"+subFile.url, file, param)
-                http.do(subFile.method, "http://"+subFile.url, {"X-Token": token,"Content-Type": "application/json"}, param, function(message){
-                    // success func
-                    OUTPUT =  message.data;
-                    dfs.write(file, message.data ? JSON.stringify(message.data) : "");
-                }, function(message){
-                    // error func
-                    log.error(message.data);
-                    return;
-                },300)  
-            }
-        })
-    })
-    
-}
-
-
-main();

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 176 - 139
cncc_serverjs/script/cncc/ITIL/事件单.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 482 - 393
cncc_serverjs/script/cncc/ITIL/变更单.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 284 - 245
cncc_serverjs/script/cncc/ITIL/应急演练.js


+ 158 - 67
cncc_serverjs/script/cncc/ITIL/报备.js

@@ -1,30 +1,25 @@
 // /cncc/action/report JSON数据导入程序
-// 2022-10-24 23:02:38.444 由 JsonImportGen.js 自动生成,请勿手动修改
-
+// 2022-09-29T07:53:58.254Z 由 JsonImportGen.js 自动生成,请勿手动修改
+    
 // 输入输出参数格式化
 input = INPUT;
 try {
     input = decodeURIComponent(input);
-} catch (e) { }
+} catch(e) {}
 try {
     input = base64.decode(input);
-} catch (e) { }
+} catch(e) {}
 try {
     input = JSON.parse(input);
     input = JSON.parse(input);
-} catch (e) { }
+} catch(e) {}
 output = {};
 
-testcfg = {};
-try {
-    testcfg = JSON.parse(etcd.get("/api/test.json"));
-} catch (e) { }
-function teststoredfs() {
+istesting = false;
+function teststore() {
     // 输入JSON临时存入DFS
     dir = "/opt/cncc/action/report";
-    d = new Date();
-    d.setMinutes(d.getMinutes() - d.getTimezoneOffset());
-    dtm = d.toJSON().replace(/[\-\:\.TZ ]/mg, "");
+    dtm = new Date().toJSON().replace(/[\-\:\.TZ ]/mg, "");
     fn = dir + "/" + dtm;
     if (input.id) {
         fn += "." + input.id;
@@ -37,81 +32,177 @@ function teststoredfs() {
     // 刪除旧交件
     files = dfs.readdir(dir);
     dt = Date.now() - 1000 * 3600 * 24 * 10;
-    for (var i = files.length - 1; i >= 0; i--) {
+    for (i = 0; i < files.length; i++) {
         if (files[i].mtime < dt) {
             dfs.remove(files[i].fullname);
-            files.splice(i, 1);
         }
     }
     // 留最后10个
-    files.sort(function (a, b) { return a.mtime - b.mtime; });
-    for (var i = 0; i < files.length - 10; i++) {
+    files.sort(function(a,b){ return a.mtime-b.mtime; });
+    for (i = 0; i < files.length-10; i++) {
         dfs.remove(files[i].fullname);
     }
 }
 // 主执行阶段
 try {
-    if (!input["--testing--"]) {
-        if (testcfg.storedfs) {
-            teststoredfs();
-        }
-        if (testcfg.checkfields) {
-            eval(dfs.read("/script/matrix/utils/ajs/checkfields.js"));
-            var newkeys = checkfields(input, {"changeSummary":"j_change_summary","id":"jid","idUnique":"j_id_unique","name":"j_name"});
-            if (newkeys) {
-                eval(dfs.read("/script/matrix/utils/ajs/JsonImporterFuncs.js"));
-                var result = runServerJS("/matrix/utils/ajs/InitJsonImporter.js", { classname: "/cncc/action/report" });
-                for (var k in result) {
-                    output[k] = result[k];
-                }
-                output.newkeys = newkeys;
-                throw ("ok");
-            }
-        }
+    if (istesting) {
+        teststore();
     }
     // 数据合法性检查
-    if (!input.id) {
-        throw ("输入参数必须为对象,且指定属性id");
-    }
-    if (!input.idUnique) {
-        throw ("输入参数必须为对象,且指定属性idUnique");
+    if (!input.id) {
+        throw ("输入参数必须为对象,且指定属性id");
+    }
+    if (!input.idUnique) {
+        throw ("输入参数必须为对象,且指定属性idUnique");
     }
     // mql定义
-    mql = `insert into /cncc/action/report (
-j_change_summary,
-j_id_unique,
-j_name,
-jid
-) values (
-?,
-?,
-?,
-?
+    mql = `insert into /cncc/action/report (
+j_accept_group_dep_id,
+j_accept_group_dep_name,
+j_accept_user_dep_id,
+j_accept_user_dep_name,
+j_accept_user_group,
+j_accept_user_group_id,
+j_accept_user_id,
+j_accept_user_real_name,
+j_close_time,
+j_countersign_dep_id_list,
+j_countersign_dep_name_list,
+j_countersign_role_id_list,
+j_countersign_role_name_list,
+j_create_time,
+j_create_user_dep_id,
+j_create_user_dep_name,
+j_create_user_id,
+j_create_user_real_name,
+j_current_process_user_id,
+j_current_process_user_real_name,
+j_data_center_id_list,
+j_data_center_name_list,
+j_expected_end_time,
+j_expected_start_time,
+j_id_unique,
+j_is_countersign,
+j_is_valid,
+j_participator_report_content_handle,
+j_process_current_user_list,
+j_process_definition_key,
+j_process_instance_id,
+j_process_status_name_list,
+j_regulation_type,
+j_report_content,
+j_report_source,
+j_report_status,
+j_report_summary,
+j_report_type,
+j_report_user_contact,
+j_reportcol,
+j_update_time,
+jid
+) values (
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?
 )`;
     // 执行mql
-    ret = odb.mql(mql, 
-        input.changeSummary?input.changeSummary:'', // test from itil 报备
-        input.idUnique?input.idUnique:'', // test20221024113142
-        input.name?input.name:'', // test from itil 报备
-        input.id // 20221024113141
+    ret = odb.mql(mql, 
+        JSON.stringify(input.acceptGroupDepId, " ", 4), // null
+        JSON.stringify(input.acceptGroupDepName, " ", 4), // null
+        JSON.stringify(input.acceptUserDepId, " ", 4), // null
+        ""+input.acceptUserDepName, // 支付系统事业部>运维系统部
+        JSON.stringify(input.acceptUserGroup, " ", 4), // null
+        JSON.stringify(input.acceptUserGroupId, " ", 4), // null
+        input.acceptUserId, // 605
+        ""+input.acceptUserRealName, // 杨春雷
+        input.closeTime, // null
+        JSON.stringify(input.countersignDepIdList, " ", 4), // null
+        JSON.stringify(input.countersignDepNameList, " ", 4), // null
+        ""+input.countersignRoleIdList, // 
+        ""+input.countersignRoleNameList, // 
+        input.createTime, // 2022-09-27 09:00:43
+        input.createUserDepId, // 92
+        ""+input.createUserDepName, // 支付系统事业部>运维系统部
+        input.createUserId, // 605
+        ""+input.createUserRealName, // 杨春雷
+        JSON.stringify(input.currentProcessUserId, " ", 4), // null
+        JSON.stringify(input.currentProcessUserRealName, " ", 4), // null
+        ""+input.dataCenterIdList, // 261
+        ""+input.dataCenterNameList, // 北京NPC
+        input.expectedEndTime, // 2022-09-28 00:00:00
+        input.expectedStartTime, // 2022-09-27 00:00:00
+        ""+input.idUnique, // RX1000007047
+        input.isCountersign, // 0
+        input.isValid, // 1
+        JSON.stringify(input.participatorReportContentHandle, " ", 4), // null
+        ""+input.processCurrentUserList, // 杨春雷
+        JSON.stringify(input.processDefinitionKey, " ", 4), // null
+        ""+input.processInstanceId, // 1539041
+        ""+input.processStatusNameList, // 创建人提出报备
+        ""+input.regulationType, // 支付系统
+        ""+input.reportContent, // 报备内容
+        JSON.stringify(input.reportSource, " ", 4), // null
+        ""+input.reportStatus, // 
+        ""+input.reportSummary, // 报备摘要
+        ""+input.reportType, // 参与者
+        JSON.stringify(input.reportUserContact, " ", 4), // null
+        JSON.stringify(input.reportcol, " ", 4), // null
+        input.updateTime, // 2022-09-27 09:01:28
+        input.id // 1000007047
     );
     // 打印完成信息
-    output.info = {
-        id: input.id,
-        idUnique: input.idUnique
+    output.info={
+        id: input.id,
+        idUnique: input.idUnique
     };
     log.info(output.info);
-} catch (e) {
-    if (e != "ok") {
-        if (typeof (e) == "object") {
-            output.error = e;
-        } else if (typeof (e) == "string") {
-            output.error = "插库错误:" + e;
-        } else {
-            output.error = JSON.stringify(e);
-        }
-        log.error(output.error);
+} catch(e) {
+    if (typeof(e) == "object") {
+        output.error = e;
+    } else if (typeof(e) == "string") {
+        output.error = "插库错误:" + e;
+    } else {
+        output.error = JSON.stringify(e);
     }
+    log.error(output.error);
 }
 
 // 返回输出信息

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 242 - 243
cncc_serverjs/script/cncc/ITIL/数据获取.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 200 - 178
cncc_serverjs/script/cncc/ITIL/设备上下电.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 215 - 214
cncc_serverjs/script/cncc/ITIL/问题单.js


+ 83 - 82
cncc_serverjs/script/cncc/ITIL/项目实施或巡检.js

@@ -1,30 +1,25 @@
 // /cncc/action/implement JSON数据导入程序
-// 2022-10-24 23:02:42.692 由 JsonImportGen.js 自动生成,请勿手动修改
-
+// 2022-09-29T07:58:13.381Z 由 JsonImportGen.js 自动生成,请勿手动修改
+    
 // 输入输出参数格式化
 input = INPUT;
 try {
     input = decodeURIComponent(input);
-} catch (e) { }
+} catch(e) {}
 try {
     input = base64.decode(input);
-} catch (e) { }
+} catch(e) {}
 try {
     input = JSON.parse(input);
     input = JSON.parse(input);
-} catch (e) { }
+} catch(e) {}
 output = {};
 
-testcfg = {};
-try {
-    testcfg = JSON.parse(etcd.get("/api/test.json"));
-} catch (e) { }
-function teststoredfs() {
+istesting = false;
+function teststore() {
     // 输入JSON临时存入DFS
     dir = "/opt/cncc/action/implement";
-    d = new Date();
-    d.setMinutes(d.getMinutes() - d.getTimezoneOffset());
-    dtm = d.toJSON().replace(/[\-\:\.TZ ]/mg, "");
+    dtm = new Date().toJSON().replace(/[\-\:\.TZ ]/mg, "");
     fn = dir + "/" + dtm;
     if (input.id) {
         fn += "." + input.id;
@@ -37,96 +32,102 @@ function teststoredfs() {
     // 刪除旧交件
     files = dfs.readdir(dir);
     dt = Date.now() - 1000 * 3600 * 24 * 10;
-    for (var i = files.length - 1; i >= 0; i--) {
+    for (i = 0; i < files.length; i++) {
         if (files[i].mtime < dt) {
             dfs.remove(files[i].fullname);
-            files.splice(i, 1);
         }
     }
     // 留最后10个
-    files.sort(function (a, b) { return a.mtime - b.mtime; });
-    for (var i = 0; i < files.length - 10; i++) {
+    files.sort(function(a,b){ return a.mtime-b.mtime; });
+    for (i = 0; i < files.length-10; i++) {
         dfs.remove(files[i].fullname);
     }
 }
 // 主执行阶段
 try {
-    if (!input["--testing--"]) {
-        if (testcfg.storedfs) {
-            teststoredfs();
-        }
-        if (testcfg.checkfields) {
-            eval(dfs.read("/script/matrix/utils/ajs/checkfields.js"));
-            var newkeys = checkfields(input, {"changeSummary":"j_change_summary","createTime":"j_create_time","createUserId":"j_create_user_id","createUserRealName":"j_create_user_real_name","id":"jid","idUnique":"j_id_unique","isValid":"j_is_valid","name":"j_name","updateTime":"j_update_time"});
-            if (newkeys) {
-                eval(dfs.read("/script/matrix/utils/ajs/JsonImporterFuncs.js"));
-                var result = runServerJS("/matrix/utils/ajs/InitJsonImporter.js", { classname: "/cncc/action/implement" });
-                for (var k in result) {
-                    output[k] = result[k];
-                }
-                output.newkeys = newkeys;
-                throw ("ok");
-            }
-        }
+    if (istesting) {
+        teststore();
     }
     // 数据合法性检查
-    if (!input.id) {
-        throw ("输入参数必须为对象,且指定属性id");
-    }
-    if (!input.idUnique) {
-        throw ("输入参数必须为对象,且指定属性idUnique");
+    if (!input.id) {
+        throw ("输入参数必须为对象,且指定属性id");
+    }
+    if (!input.idUnique) {
+        throw ("输入参数必须为对象,且指定属性idUnique");
     }
     // mql定义
-    mql = `insert into /cncc/action/implement (
-j_change_summary,
-j_create_time,
-j_create_user_id,
-j_create_user_real_name,
-j_id_unique,
-j_is_valid,
-j_name,
-j_update_time,
-jid
-) values (
-?,
-?,
-?,
-?,
-?,
-?,
-?,
-?,
-?
+    mql = `insert into /cncc/action/implement (
+j_base_role_id,
+j_base_role_name,
+j_charge_user_id,
+j_charge_user_real_name,
+j_create_time,
+j_create_user_id,
+j_create_user_real_name,
+j_end_day,
+j_id_unique,
+j_implement_content,
+j_implement_name,
+j_implement_type,
+j_is_valid,
+j_park_name,
+j_start_day,
+j_update_time,
+jid
+) values (
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?,
+?
 )`;
     // 执行mql
-    ret = odb.mql(mql, 
-        input.changeSummary?input.changeSummary:'', // test from itil 项目实施或巡检
-        input.createTime, // 2020-04-03 23:12:25
-        input.createUserId, // 2
-        input.createUserRealName?input.createUserRealName:'', // 周杰
-        input.idUnique?input.idUnique:'', // test20221024113143
-        input.isValid, // 0
-        input.name?input.name:'', // test from itil 项目实施或巡检
-        input.updateTime, // 2020-04-03 23:12:25
-        input.id // 299
+    ret = odb.mql(mql, 
+        ""+input.baseRoleId, // 500
+        ""+input.baseRoleName, // 支付系统事业部>运维系统部
+        ""+input.chargeUserId, // 605
+        ""+input.chargeUserRealName, // 杨春雷
+        input.createTime, // null
+        JSON.stringify(input.createUserId, " ", 4), // null
+        JSON.stringify(input.createUserRealName, " ", 4), // null
+        ""+input.endDay, // 2022-09-27
+        ""+input.idUnique, // IX000002264
+        ""+input.implementContent, // 推送数据-巡检
+        ""+input.implementName, // 推送数据-巡检
+        ""+input.implementType, // 厂商巡检
+        input.isValid, // 1
+        ""+input.parkName, // 北京中心
+        ""+input.startDay, // 2022-09-26
+        input.updateTime, // 2022-09-26 16:54:10
+        input.id // 2264
     );
     // 打印完成信息
-    output.info = {
-        id: input.id,
-        idUnique: input.idUnique
+    output.info={
+        id: input.id,
+        idUnique: input.idUnique
     };
     log.info(output.info);
-} catch (e) {
-    if (e != "ok") {
-        if (typeof (e) == "object") {
-            output.error = e;
-        } else if (typeof (e) == "string") {
-            output.error = "插库错误:" + e;
-        } else {
-            output.error = JSON.stringify(e);
-        }
-        log.error(output.error);
+} catch(e) {
+    if (typeof(e) == "object") {
+        output.error = e;
+    } else if (typeof(e) == "string") {
+        output.error = "插库错误:" + e;
+    } else {
+        output.error = JSON.stringify(e);
     }
+    log.error(output.error);
 }
 
 // 返回输出信息

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 34 - 0
cncc_serverjs/script/cncc/test/test.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 34 - 0
cncc_serverjs/script/cncc/test/test_data.js


+ 46 - 0
cncc_serverjs/script/cncc/test/test_gen_insert_template.js

@@ -0,0 +1,46 @@
+var genInsertMql = function(value){
+    try{
+        var fields = odb.classfields(value);
+        var mql = [];
+        var excludes = ['tags','vtime','day','class'];
+        // ['set','int','double','text','list','boolean','blob','smallint','bigint','varchar','map','timestamp','date','float']
+        var double_quotation_marks = ['set','list','map','text','varchar','date','timestamp'];
+        
+        
+        // prefix
+        mql.push('insert into');
+        mql.push('/cncc/entity/biz');
+        mql.push('(');
+        
+        // keys
+        var keys = _.compact(_.map(fields,function(v){
+            if(_.includes(excludes,v.name) || v['rtype']==0) return;
+            return v.name;
+        })).join(", ");
+        mql.push(keys);
+        
+        // midfix
+        mql.push(") values (");
+        
+        // values
+        var values = _.compact(_.map(fields,function(v){
+            if(_.includes(excludes,v.name) || v['rtype']==0) return;
+            if(_.includes(double_quotation_marks,v.ftype)){
+                return "'<%="+v.name +" %>'";
+            } else{
+                return "<%="+v.name +" %>";
+            }
+        })).join(", ");
+        mql.push(values);
+        
+        // suffix
+        mql.push(')');
+        
+        return mql.join(" ");
+        
+    }catch(err){
+        return err;
+    }
+};
+
+OUTPUT = genInsertMql("/cncc/action/tb_alert");

+ 13 - 0
cncc_serverjs/script/cncc/test/test_https.js

@@ -0,0 +1,13 @@
+null
+// do: Http request
+// params: method<string>, url<string>, header<object>, body<string>, successfunc<function>, errfunc<function>
+// return: none
+http.do("POST", "https://www.baifubao.com/callback?cmd=1059&callback=phone&phone=13808888888", {"Data-Type":"json"}, '', function(message){
+    // success func
+    var rtn = (message.data).replace(/\/\*fgg_again\*\/phone\(/,"").replace(/\)/,"");
+    OUTPUT = JSON.parse(rtn)
+}, function(message){
+    // error func
+    log.info(message.data);
+})
+

+ 18 - 0
cncc_serverjs/script/cncc/test/test_job.js

@@ -0,0 +1,18 @@
+
+
+var jobs = '';
+
+for(var i=0; i < 50; i++){
+    jobs =  `--cron = 32 * * * * * *
+--ignore = false
+--log_level = debug
+--run_host = BM3META1, BM3META2, BM3META3, BM3META4, BM3META5
+
+batch_start = `+ i +`
+batch_end = `+ (i+1) +`
+worker = `+ (i*2 + 1) +`
+
+omni.include("/matrix/rules/cncc/bdos/atrt/common")` + "\n"
+}
+
+log.debug(jobs)

+ 1 - 0
cncc_serverjs/script/cncc/test/test_user.js

@@ -0,0 +1 @@
+OUTPUT=odb.mql("select * from alerts_status limit 1")

+ 2 - 0
cncc_serverjs/script/cncc/test/user.js

@@ -0,0 +1,2 @@
+OUTPUT = webcontext.user()
+

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 32 - 0
cncc_serverjs/script/cncc/test/ww.js


+ 29 - 0
cncc_serverjs/script/cncc/test/应用系统业务领域特征.js

@@ -0,0 +1,29 @@
+OUTPUT = [
+{"枚举值编号":"00","领域特征":"信贷","对应系统举例说明":"房改金融贷款系统、银团贷款系统、个贷系统、对公贷款系统、担保承诺系统等"},
+{"枚举值编号":"01","领域特征":"托管","对应系统举例说明":"托管系统、保管箱系统、养老金业务系统、房改金融存款系统等"},
+{"枚举值编号":"02","领域特征":"代理","对应系统举例说明":"代理银行系统、代理收付系统、代理社保系统、代理国债系统、代理信托系统、代销基金系统、代理保险系统、代理中央财政集中收付系统、委托贷款系统、代理银证期系统等"},
+{"枚举值编号":"03","领域特征":"支付结算","对应系统举例说明":"本汇票系统、汇兑系统、跨境支付系统、国际结算系统等"},
+{"枚举值编号":"04","领域特征":"金融市场","对应系统举例说明":"对客资金交易系统、信贷资产转让系统、投资组合与资金交易系统、商业汇票转帖/再贴系统等"},
+{"枚举值编号":"05","领域特征":"客户资产管理","对应系统举例说明":"个人资产管理系统、现金管理系统等"},
+{"枚举值编号":"06","领域特征":"存款","对应系统举例说明":"借记卡系统、存款系统等"},
+{"枚举值编号":"07","领域特征":"信用卡","对应系统举例说明":"发卡系统、收单系统等"},
+{"枚举值编号":"08","领域特征":"投行","对应系统举例说明":"资产证券化系统、顾问咨询系统、债券承分销系统等"},
+{"枚举值编号":"09","领域特征":"投资理财","对应系统举例说明":"理财产品系统、实物贵金属系统、个人资金交易系统、理财资产管理系统等"},
+{"枚举值编号":"10","领域特征":"贸易融资","对应系统举例说明":"保理系统、贸易融资系统、商业汇票贴现系统等"},
+{"枚举值编号":"11","领域特征":"人工渠道","对应系统举例说明":"邮件处理中心系统、前端系统等"},
+{"枚举值编号":"12","领域特征":"自助渠道","对应系统举例说明":"ATM、POS、自助终端等"},
+{"枚举值编号":"13","领域特征":"电子银行渠道","对应系统举例说明":"网上银行系统、手机银行系统、微信银行系统、电话银行系统、短信银行系统等"},
+{"枚举值编号":"14","领域特征":"第三方渠道","对应系统举例说明":"第三方客户系统、法人客户系统等"},
+{"枚举值编号":"15","领域特征":"客户管理","对应系统举例说明":"客户关系管理系统、客户统一视图系统等。"},
+{"枚举值编号":"16","领域特征":"产品管理","对应系统举例说明":"产品工厂系统、产品目录树系统等。"},
+{"枚举值编号":"17","领域特征":"财务管理","对应系统举例说明":"总账系统等。"},
+{"枚举值编号":"18","领域特征":"数据支撑","对应系统举例说明":"数据仓库系统、ODS系统、大数据平台、数据中台、数据湖平台、管理驾驶舱系统、统一报表平台等。"},
+{"枚举值编号":"19","领域特征":"资产负债管理","对应系统举例说明":"流动性管理系统、资本管理系统、定价管理系统、内部转移价格管理系统等。"},
+{"枚举值编号":"20","领域特征":"产品支持","对应系统举例说明":"合约管理系统、授信管理系统、头寸管理系统、商户管理系统、机构管理系统、黑名单管理系统等。"},
+{"枚举值编号":"21","领域特征":"管理支持","对应系统举例说明":"战略管理系统、数据管理系统、案件管理系统、采购管理系统、办公管理系统、资产管理系统等"},
+{"枚举值编号":"22","领域特征":"IT支持","对应系统举例说明":"IT管理系统"},
+{"枚举值编号":"23","领域特征":"运营支持","对应系统举例说明":"清算系统、集中运营服务系统、运营配送管理系统等。"},
+{"枚举值编号":"24","领域特征":"风险管理","对应系统举例说明":"反欺诈系统、信用风险管理系统、操作风险管理系统、风险监控与评价系统等。"},
+{"枚举值编号":"25","领域特征":"内部合规","对应系统举例说明":"监管合规系统、稽核检测系统等。"},
+{"枚举值编号":"99","领域特征":"其他","对应系统举例说明":""}
+]

+ 53 - 0
cncc_serverjs/script/cncc/test/应用系统开发语言.js

@@ -0,0 +1,53 @@
+OUTPUT=[
+{"枚举值编号":"00","开发语言名称":"C"},
+{"枚举值编号":"01","开发语言名称":"Python"},
+{"枚举值编号":"02","开发语言名称":"Java"},
+{"枚举值编号":"03","开发语言名称":"C++"},
+{"枚举值编号":"04","开发语言名称":"C#"},
+{"枚举值编号":"05","开发语言名称":"Visual Basic"},
+{"枚举值编号":"06","开发语言名称":"JavaScript"},
+{"枚举值编号":"07","开发语言名称":"PHP"},
+{"枚举值编号":"08","开发语言名称":"Assembly language"},
+{"枚举值编号":"09","开发语言名称":"SQL"},
+{"枚举值编号":"10","开发语言名称":"Classic Visual Basic"},
+{"枚举值编号":"11","开发语言名称":"Groovy"},
+{"枚举值编号":"12","开发语言名称":"Ruby"},
+{"枚举值编号":"13","开发语言名称":"R"},
+{"枚举值编号":"14","开发语言名称":"Perl"},
+{"枚举值编号":"15","开发语言名称":"Swift"},
+{"枚举值编号":"16","开发语言名称":"Fortran"},
+{"枚举值编号":"17","开发语言名称":"Delphi/Object Pascal"},
+{"枚举值编号":"18","开发语言名称":"MATLAB"},
+{"枚举值编号":"19","开发语言名称":"GO"},
+{"枚举值编号":"20","开发语言名称":"SAS"},
+{"枚举值编号":"21","开发语言名称":"Scratch"},
+{"枚举值编号":"22","开发语言名称":"Objective-C"},
+{"枚举值编号":"23","开发语言名称":"PL/SQL"},
+{"枚举值编号":"24","开发语言名称":"COBOL"},
+{"枚举值编号":"25","开发语言名称":"Prolog"},
+{"枚举值编号":"26","开发语言名称":"Ada"},
+{"枚举值编号":"27","开发语言名称":"Lisp"},
+{"枚举值编号":"28","开发语言名称":"Dart"},
+{"枚举值编号":"29","开发语言名称":"Rust"},
+{"枚举值编号":"30","开发语言名称":"Transact-SQL"},
+{"枚举值编号":"31","开发语言名称":"VBScript"},
+{"枚举值编号":"32","开发语言名称":"ABAP"},
+{"枚举值编号":"33","开发语言名称":"Kotlin"},
+{"枚举值编号":"34","开发语言名称":"Julia"},
+{"枚举值编号":"35","开发语言名称":"(Visual) FoxPro"},
+{"枚举值编号":"36","开发语言名称":"Scala"},
+{"枚举值编号":"37","开发语言名称":"Lua"},
+{"枚举值编号":"38","开发语言名称":"Logo"},
+{"枚举值编号":"39","开发语言名称":"LabVIEW"},
+{"枚举值编号":"40","开发语言名称":"ML"},
+{"枚举值编号":"41","开发语言名称":"Ladder Logic"},
+{"枚举值编号":"42","开发语言名称":"VHDL"},
+{"枚举值编号":"43","开发语言名称":"D"},
+{"枚举值编号":"44","开发语言名称":"TypeScript"},
+{"枚举值编号":"45","开发语言名称":"Awk"},
+{"枚举值编号":"46","开发语言名称":"Elixir"},
+{"枚举值编号":"47","开发语言名称":"Apex"},
+{"枚举值编号":"48","开发语言名称":"Haskell"},
+{"枚举值编号":"49","开发语言名称":"PowerShell"},
+{"枚举值编号":"99","开发语言名称":"其他"}
+]

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 86 - 0
cncc_serverjs/script/cncc/国产监控/告警/事件列表.js


+ 8 - 0
cncc_serverjs/script/cncc/国产监控/告警/数据结构.js

@@ -0,0 +1,8 @@
+var dataStr = (function(){
+    var data = odb.classfields("/cncc/action/tb_alert");
+    OUTPUT= _.compact(_.map(data,function(v){
+        if(v.hasOwnProperty('ftype')){
+            return {name:v.name, ftype:v.ftype}
+        }
+    }));
+})()

+ 29 - 0
cncc_serverjs/script/cncc/应用/meta-capacitya/hostpoolList.js

@@ -0,0 +1,29 @@
+var hostpool  = function(){
+    var rtn = null;
+    try{
+        var mql = "select name,contain from hostpool limit -1";
+        var data = _.map(odb.mql(mql).data,function(v){
+                        var name = v.name;
+                        var l = {};
+                        if(name.indexOf('hostpool:CAZ') != -1){
+                            l['location']='北京NPC';
+                            l['title']=name.split(":")[1];
+                        } else if(name.indexOf('hostpool:SHN') != -1){
+                            l['location']='上海NPC';
+                            l['title']=name.split(":")[1];
+                        }  else if(name.indexOf('hostpool:WXNHost') != -1){
+                            l['location']='无锡NPC';
+                            l['title']=name.split(":")[1];
+                        }
+                        _.extend(v, l);
+                        return v;
+                    });
+        rtn = _.groupBy(data,'location');
+        
+    }catch(err){
+        log.error(err);
+    }
+    return rtn;
+};
+
+OUTPUT= hostpool();

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 0
cncc_serverjs/script/cncc/应用/meta-capacitya/log.json


+ 20 - 6
cncc_serverjs/script/cncc/应用/meta-capacitya/performanceByHost.js

@@ -3,25 +3,39 @@ var input = JSON.parse(decodeURIComponent(INPUT));
 
 
 var perf = function(){
-    var rtn = {};
+    var rtn = [];
     try{
         var classBy = input.id.split(":")[0];
         var data = null;
         var currentDay = new Date().toJSON().slice(0,10);
-        var yesterday = new Date(new Date().setDate(new Date().getDate() - 1)).toJSON().slice(0,10);
+        var yesterday = new Date( _.now() - 86400000 * 30).toJSON().slice(0,10);
         input.timerange[0] = yesterday;
         input.timerange[1] = currentDay;
+        
         var mqlCpu = "select id,performance.time('"+input.timerange[0]+"','"+input.timerange[1]+"').find(name='cpuRate') from "+classBy+" where id='"+input.id+"'";
-         data = _.map(odb.mql(mqlCpu).data,'performance')[0];
-         _.extend(rtn,{cpuRate: data});
+        data = _.map(odb.mql(mqlCpu).data,'performance')[0];
+        var o = {};
+        o['data'] = data;
+        o['subtitle'] = input.timerange.join(" 至 ");
+        o['title'] = 'cpuRate'
+        rtn.push(o);
+         
         
         var mqlMem = "select id,performance.time('"+input.timerange[0]+"','"+input.timerange[1]+"').find(name='memRate') from "+classBy+" where id='"+input.id+"'";
         data = _.map(odb.mql(mqlMem).data,'performance')[0];
-        _.extend(rtn,{memRate: data});
+        var o = {};
+         o['data'] = data;
+         o['subtitle'] = input.timerange.join(" 至 ");
+        o['title'] = 'memRate'
+         rtn.push(o);
         
         var mqlDisk = "select id,performance.time('"+input.timerange[0]+"','"+input.timerange[1]+"').find(name='diskRateMax') from "+classBy+" where id='"+input.id+"'";
         data = _.map(odb.mql(mqlDisk).data,'performance')[0];
-        _.extend(rtn,{diskRate: data});
+        var o = {};
+        o['data'] = data;
+        o['subtitle'] = input.timerange.join(" 至 ");
+        o['title'] = 'diskRate'
+        rtn.push(o);
         
         
         

+ 21 - 9
cncc_serverjs/script/cncc/应用/meta-capacitya/performanceByVm.js

@@ -1,27 +1,39 @@
 var input = JSON.parse(decodeURIComponent(INPUT));
 
-
-
 var perf = function(){
-    var rtn = {};
+    var rtn = [];
     try{
         var classBy = input.id.split(":")[0];
         var data = null;
         var currentDay = new Date().toJSON().slice(0,10);
-        var yesterday = new Date(new Date().setDate(new Date().getDate() - 1)).toJSON().slice(0,10);
+        var yesterday = new Date( _.now() - 86400000 * 30 ).toJSON().slice(0,10);
+        
         input.timerange[0] = yesterday;
         input.timerange[1] = currentDay;
+        
         var mqlCpu = "select id,performance.time('"+input.timerange[0]+"','"+input.timerange[1]+"').find(name='cpu_busy') from "+classBy+" where id='"+input.id+"'";
          data = _.map(odb.mql(mqlCpu).data,'performance')[0];
-         _.extend(rtn,{cpuRate: data});
+         var o = {};
+         o['data'] = data;
+         o['subtitle'] = input.timerange.join(" 至 ");
+         o['title'] = 'cpu_busy'
+         rtn.push(o);
         
-        var mqlMem = "select id,performance.time('"+input.timerange[0]+"','"+input.timerange[1]+"').find(name='memRate') from "+classBy+" where id='"+input.id+"'";
+        var mqlMem = "select id,performance.time('"+input.timerange[0]+"','"+input.timerange[1]+"').find(name='mem_used') from "+classBy+" where id='"+input.id+"'";
         data = _.map(odb.mql(mqlMem).data,'performance')[0];
-        _.extend(rtn,{memRate: data});
+        var o = {};
+         o['data'] = data;
+         o['subtitle'] = input.timerange.join(" 至 ");
+        o['title'] = 'mem_used'
+         rtn.push(o);
         
-        var mqlDisk = "select id,performance.time('"+input.timerange[0]+"','"+input.timerange[1]+"').find(name='diskRateMax') from "+classBy+" where id='"+input.id+"'";
+        var mqlDisk = "select id,performance.time('"+input.timerange[0]+"','"+input.timerange[1]+"').find(name='disk_used') from "+classBy+" where id='"+input.id+"'";
         data = _.map(odb.mql(mqlDisk).data,'performance')[0];
-        _.extend(rtn,{diskRate: data});
+        var o = {};
+         o['data'] = data;
+         o['subtitle'] = input.timerange.join(" 至 ");
+         o['title'] = 'disk_used'
+         rtn.push(o);
         
         
         

+ 16 - 0
cncc_serverjs/script/cncc/应用/meta-capacitya/searchByTerm.js

@@ -0,0 +1,16 @@
+var input = JSON.parse(decodeURIComponent(INPUT));
+
+var search = function(){
+    var rtn = [];
+    try{
+        var mql = "select id,name,deploy from /cncc/entity/os/ where name like '*"+input.term+"*' or manageip like '*"+input.term+"*' or serviceip like '*"+input.term+"*'  limit -1";
+        _.forEach(odb.mql(mql).data,function(v){
+            rtn = rtn.concat(v['deploy']['_all']);
+        })
+    }catch(err){
+        log.error(err);
+    }
+    return rtn;
+};
+
+OUTPUT = search();

+ 55 - 36
cncc_serverjs/script/cncc/应用/meta-capacitya/summary.js

@@ -1,4 +1,11 @@
-
+var cRound = function(num, fixed) {
+    var pos = num.toString().indexOf('.'),
+    decimal_places = num.toString().length - pos - 1,
+    _int = num * Math.pow(10, decimal_places),
+    divisor_1 = Math.pow(10, decimal_places - fixed),
+    divisor_2 = Math.pow(10, fixed);
+    return Math.round(_int / divisor_1) / divisor_2;
+}
 
 
 var datacenters = (function(){
@@ -54,42 +61,67 @@ var server_x86 = (function(){
     }
 })();
 
+var getFromCache = function(keyStr){
+    var rtn = null;
+    var key = base64.encode(keyStr);
+    rtn = JSON.parse(appcontext.rawget(key));
+    return rtn;
+};
+
+var setToCache = function(keyStr,data){
+    var key = base64.encode(keyStr);
+    appcontext.rawset(key, data, 43200);
+};
+
 var hostsByDc = (function(){
     try{
         var allHostList = [];
         
-        var x86List = odb.mql("select id,name,cpu,memory,disk,datacenter from /cncc/entity/x86 limit -1").data;
-        allHostList = allHostList.concat(x86List);
         
-        var powerList = odb.mql("select id,name,cpu,memory,disk,datacenter from /cncc/entity/power limit -1").data;
-        allHostList = allHostList.concat(powerList);
+        var data = odb.mql("select id,name,cpu,memory,disk,datacenter,hypervisor from x86 limit -1").data;
+        var x86List = _.map(data,function(v){
+            v.memory = cRound(v.memory / 1024,2);
+            return v;
+        })
+        allHostList = allHostList.concat(x86List);
         
+        var powerList = odb.mql("select id,name,cpu,memory,disk,datacenter from power limit -1").data;
+        var powerListA = _.map(powerList,function(v){
+            return _.extend(v,{hypervisor:'HMC'});
+        })
+        allHostList = allHostList.concat(powerListA);
+            
+            
         return _.extend(_.groupBy(allHostList,'datacenter'), {"CCPC":[], "央行云":[]});
     }catch(err){
         log.error(err)
+        
         return null;
     }
 })();
 
 
 // 统计当前DC里所有服务器的分区容量数据
-var vmSummaryByHosts = function(hosts){
+var vmSummaryByHosts = function(hosts,node){
     var rtn = {};
     try{
         var summaryList = [];
         
         _.forEach(hosts,function(host){
             var sp = host.id.split(":");
-            var classBy = sp[0]=='/cncc/entity/x86'?'/cncc/entity/os/linux':'/cncc/entity/os/aix';
+            var classBy = sp[0]=='x86'?'linux':'aix';
             var mql = "select id,cpu,memory,disk from "+ classBy +" where deploy='"+host.id+"' limit -1";
-            log.info(mql)
+            // log.info(mql)
             var data = odb.mql(mql);
-            if(data){
+            
+            if(data.hasOwnProperty('data') && !_.isEmpty(data.data)){
                 summaryList = summaryList.concat(data.data);
             }
         })
         
         _.extend(rtn, {
+                        node: node,
+                        hosts: _.map(hosts,'id'),
                         cpu_allocated: _.reduce(summaryList,function(memo, val) {
                             return memo + val.cpu;
                         },0),
@@ -101,7 +133,7 @@ var vmSummaryByHosts = function(hosts){
                         },0)
         });
         
-        
+        //log.debug(JSON.stringify(rtn))
         
     }catch(err){
         log.error(11,err);
@@ -135,11 +167,6 @@ OUTPUT = _.map(datacenters,function(v,k){
         disk_unallocated: 0,
         disk_allocated_rate: 0,
         
-        storage_total: 0,
-        storage_allocated: 0,
-        storage_unallocated: 0,
-        storage_allocated_rate: 0,
-        
         server_power: 0,
         server_x86: 0,
         
@@ -149,10 +176,11 @@ OUTPUT = _.map(datacenters,function(v,k){
     
     var dc_hosts = hostsByDc[k];
     
+    
     if(_.isEmpty(dc_hosts)) {
         return o;
     } else{
-        var vmSummary = vmSummaryByHosts(dc_hosts);
+        var vmSummary = vmSummaryByHosts(dc_hosts,k);
         
         var cpu_total = _.reduce(dc_hosts,function(memo, val) {
                             return memo + val.cpu;
@@ -172,14 +200,10 @@ OUTPUT = _.map(datacenters,function(v,k){
         var disk_total = _.reduce(dc_hosts,function(memo, val) {
                             return memo + val.disk;
                         },0);
+        
         var disk_allocated = vmSummary.disk_allocated;
         var disk_unallocated = disk_total - disk_allocated;
-        var disk_allocated_rate = disk_total>0?disk_allocated/disk_total*100:0;
-        
-        var storage_total = 10;
-        var storage_allocated = 1;
-        var storage_unallocated = 1;
-        var storage_allocated_rate = 1;//storage_allocated/storage_total * 100;
+        var disk_allocated_rate = disk_total > 0 ? disk_allocated / disk_total * 100 : 0;
         
         var server_power = _.countBy(dc_hosts,function(v){
             return v.id.split(":")[0];
@@ -193,22 +217,17 @@ OUTPUT = _.map(datacenters,function(v,k){
             cpu_total: cpu_total,
             cpu_allocated: cpu_allocated,
             cpu_unallocated: cpu_unallocated,
-            cpu_allocated_rate: Math.round(cpu_allocated_rate,2),
-            
-            mem_total: Math.round(mem_total/1024/1024,2),
-            mem_allocated: Math.round(mem_allocated/1024/1024,2),
-            mem_unallocated: Math.round(mem_unallocated/1024/1024,2),
-            mem_allocated_rate: Math.round(mem_allocated_rate,2),
+            cpu_allocated_rate: cRound(cpu_allocated_rate,2),
             
-            disk_total: Math.round(disk_total/1024/1024,2),
-            disk_allocated: Math.round(disk_allocated/1024/1024,2),
-            disk_unallocated: Math.round(disk_unallocated/1024/1024,2),
-            disk_allocated_rate: Math.round(disk_allocated_rate,2),
+            mem_total: cRound(mem_total/1024,2),
+            mem_allocated: cRound(mem_allocated/1024,2),
+            mem_unallocated: cRound(mem_unallocated/1024,2),
+            mem_allocated_rate: cRound(mem_allocated_rate,2),
             
-            storage_total: storage_total,
-            storage_allocated: storage_allocated,
-            storage_unallocated: storage_unallocated,
-            storage_allocated_rate: Math.round(storage_allocated_rate,2),
+            disk_total: cRound(disk_total/1024,2),
+            disk_allocated: cRound(disk_allocated/1024,2),
+            disk_unallocated: cRound(disk_unallocated/1024,2),
+            disk_allocated_rate: cRound(disk_allocated_rate,2),
             
             server_power: server_power['power'],
             server_x86: server_power['x86'],

+ 87 - 23
cncc_serverjs/script/cncc/应用/meta-capacitya/summaryByDc.js

@@ -1,9 +1,19 @@
 var input = decodeURIComponent(INPUT);
 
+var cRound = function(num, fixed) {
+    var pos = num.toString().indexOf('.'),
+    decimal_places = num.toString().length - pos - 1,
+    _int = num * Math.pow(10, decimal_places),
+    divisor_1 = Math.pow(10, decimal_places - fixed),
+    divisor_2 = Math.pow(10, fixed);
+    return Math.round(_int / divisor_1) / divisor_2;
+}
+
 var datacenters = (function(){
     var rtn = {};
     try{
         var mql = "select id,name,datasource,org from /cncc/entity/datacenter where name='"+input+"' limit -1";
+        
         var tmp = odb.mql(mql).data;
         var grouped = _.groupBy(tmp,'datasource');
          
@@ -27,7 +37,9 @@ var datacenters = (function(){
     }catch(err){
         log.error(err);
     }
+    
     return rtn;
+    
 })();
 
 
@@ -51,11 +63,55 @@ var server_x86 = (function(){
     }
 })();
 
+
+var getFromCache = function(keyStr){
+    var rtn = null;
+    var key = base64.encode(keyStr);
+    rtn = JSON.parse(appcontext.rawget(key));
+    return rtn;
+};
+
+var setToCache = function(keyStr,data){
+    var key = base64.encode(keyStr);
+    appcontext.rawset(key, data, 43200);
+};
+
 var hostsByDc = (function(){
+    var allHostList = [];
     try{
-        var allHostList = [];
         
-        var x86List = odb.mql("select id,name,cpu,memory,disk,datacenter,hypervisor,performance from x86 limit -1").data;
+        var cacheData = null;//getFromCache("allHostList");
+        
+        if(_.isEmpty(cacheData)){
+            
+            var data = odb.mql("select id,name,cpu,memory,disk,datacenter,hypervisor,performance from x86 limit -1").data;
+            var x86List = _.map(data,function(v){
+                v.memory = cRound(v.memory / 1024,2);
+                // v.memory = cRound(v.disk / 1024,2);
+                return v;
+            })
+            allHostList = allHostList.concat(x86List);
+            
+            var powerList = odb.mql("select id,name,cpu,memory,disk,datacenter,performance from power limit -1").data;
+            var powerListA = _.map(powerList,function(v){
+                return _.extend(v,{hypervisor:'HMC'});
+            })
+            allHostList = allHostList.concat(powerListA);
+            
+            setToCache("allHostList",JSON.stringify(allHostList))
+        } else{
+            allHostList = cacheData;
+        }
+        
+        return _.extend(_.groupBy(allHostList,'datacenter'), {"CCPC":[], "央行云":[]});
+    }catch(err){
+        log.error(err)
+        var data = odb.mql("select id,name,cpu,memory,disk,datacenter,hypervisor,performance from x86 limit -1").data;
+        var x86List = _.map(data,function(v){
+            v.memory = cRound(v.memory / 1024,2);
+            // v.memory = cRound(v.disk / 1024,2);
+            return v;
+        })
         allHostList = allHostList.concat(x86List);
         
         var powerList = odb.mql("select id,name,cpu,memory,disk,datacenter,performance from power limit -1").data;
@@ -64,9 +120,8 @@ var hostsByDc = (function(){
         })
         allHostList = allHostList.concat(powerListA);
         
-        return _.extend(_.groupBy(allHostList,'datacenter'), {"CCPC":[], "央行云":[]});
-    }catch(err){
-        log.error(err)
+        setToCache("allHostList",JSON.stringify(allHostList))
+        
         return null;
     }
 })();
@@ -235,25 +290,25 @@ OUTPUT = _.map(datacenters,function(v,k){
             cpu_total: cpu_total,
             cpu_allocated: cpu_allocated,
             cpu_unallocated: cpu_unallocated,
-            cpu_allocated_rate: Math.round(cpu_allocated_rate,2),
+            cpu_allocated_rate: cRound(cpu_allocated_rate,2),
             
-            mem_total: Math.round(mem_total/1024/1024,2),
-            mem_allocated: Math.round(mem_allocated/1024/1024,2),
-            mem_unallocated: Math.round(mem_unallocated/1024/1024,2),
-            mem_allocated_rate: Math.round(mem_allocated_rate,2),
+            mem_total: cRound(mem_total,2),
+            mem_allocated: cRound(mem_allocated,2),
+            mem_unallocated: cRound(mem_unallocated,2),
+            mem_allocated_rate: cRound(mem_allocated_rate,2),
             
-            disk_total: Math.round(disk_total/1024/1024,2),
-            disk_allocated: Math.round(disk_allocated/1024/1024,2),
-            disk_unallocated: Math.round(disk_unallocated/1024/1024,2),
-            disk_allocated_rate: Math.round(disk_allocated_rate,2),
+            disk_total: cRound(disk_total,2),
+            disk_allocated: cRound(disk_allocated,2),
+            disk_unallocated: cRound(disk_unallocated,2),
+            disk_allocated_rate: cRound(disk_allocated_rate,2),
             
             storage_total: storage_total,
             storage_allocated: storage_allocated,
             storage_unallocated: storage_unallocated,
-            storage_allocated_rate: Math.round(storage_allocated_rate,2),
+            storage_allocated_rate: cRound(storage_allocated_rate,2),
             
-            server_power: server_power['power'],
-            server_x86: server_power['x86'],
+            server_power: server_power['power'] ? server_power['power'] : 0,
+            server_x86: server_power['x86'] ? server_power['x86'] : 0,
             
             severity: 0,
             status: 0,
@@ -263,17 +318,24 @@ OUTPUT = _.map(datacenters,function(v,k){
                         var detail = vmSummaryByHost(host);
                         
                         var o = {};
+                        
+                        o['hypervisor'] = host.hypervisor?host.hypervisor:'NONE';
+                        
+                        o['count'] = 0;
+                        
+                        o['severity'] = 0;
+                        
                         o['cpu_total'] = host.cpu;
-                        o['mem_total'] = Math.round(host.memory/1024,2);
-                        o['disk_total'] = Math.round(host.disk/1024,2);
+                        o['mem_total'] = cRound(host.memory,2);
+                        o['disk_total'] = cRound(host.disk/1024,2);
                         
                         o['cpu_allocated'] = detail.cpu_allocated;
-                        o['mem_allocated'] = Math.round((detail.mem_allocated)/1024,2);
-                        o['disk_allocated'] = Math.round((detail.disk_allocated)/1024,2);
+                        o['mem_allocated'] = cRound((detail.mem_allocated),2);
+                        o['disk_allocated'] = cRound((detail.disk_allocated)/1024,2);
                         
                         o['cpu_unallocated'] = host.cpu - detail.cpu_allocated;
-                        o['mem_unallocated'] = Math.round((host.memory - detail.mem_allocated)/1024,2);
-                        o['disk_unallocated'] = Math.round((host.disk - detail.disk_allocated)/1024,2);
+                        o['mem_unallocated'] = cRound((host.memory / 1024 - detail.mem_allocated),2);
+                        o['disk_unallocated'] = cRound((host.disk - detail.disk_allocated)/1024,2);
                         
                         
                         var perf = host.performance;
@@ -288,6 +350,8 @@ OUTPUT = _.map(datacenters,function(v,k){
                         }
                         
                         _.extend(detail,o);
+                        
+                        
                         return _.extend(host,detail);
                     })
         });

+ 18 - 3
cncc_serverjs/script/cncc/应用/meta-capacitya/template/menus.js

@@ -5,12 +5,23 @@ OUTPUT = [{
     "title": "资源池",
     "icon": "el-icon-office-building",
     "group": false,
+    "status": true,
     "children": [{
-        "id": "summary",
-        "name": "/summary",
-        "title": "整体概览",
+        "id": "summaryByNode",
+        "name": "/summaryByNode",
+        "title": "按站点统计",
         "icon": "el-icon-school",
         "group": false,
+        "status": true,
+        "children": []
+    },
+    {
+        "id": "summaryByPool",
+        "name": "/summaryByPool",
+        "title": "按物理池统计",
+        "icon": "el-icon-school",
+        "group": false,
+        "status": true,
         "children": []
     },
     {
@@ -19,6 +30,7 @@ OUTPUT = [{
         "title": "上海NPC",
         "icon": "el-icon-school",
         "group": true,
+        "status": false,
         "children": []
     },
     {
@@ -27,6 +39,7 @@ OUTPUT = [{
         "title": "北京NPC",
         "icon": "el-icon-school",
         "group": false,
+        "status": false,
         "children": []
     },
     {
@@ -35,6 +48,7 @@ OUTPUT = [{
         "title": "无锡NPC",
         "icon": "el-icon-school",
         "group": false,
+        "status": false,
         "children": []
     },
     {
@@ -43,6 +57,7 @@ OUTPUT = [{
         "title": "CCPC",
         "icon": "el-icon-school",
         "group": false,
+        "status": false,
         "children": []
     }]
 }];

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 2
cncc_serverjs/script/cncc/应用/meta-capacitya/test.js


+ 40 - 12
cncc_serverjs/script/cncc/应用/meta-capacitya/vmListByHost.js

@@ -1,6 +1,5 @@
 var input = INPUT ?  decodeURIComponent(INPUT) : null;
 
-
 var hostList = (function(host){
     var rtn = null;
     //  appname			varchar	"应用系统英文名称",
@@ -34,31 +33,38 @@ var hostList = (function(host){
 })(input);
 
 var columns = [
-        {field: "name", title: "主机名", width: "180"},
+        {field: "name", title: "主机名", width: "340"},
         {field: "manageip", title: "管理IP", width: "120"},
         {field: "serviceip", title: "业务IP", width: "120"},
         
-        {field: "cpu", title: "CPU", width: "80", render: `var s=function(row, column, cellValue, index){ try {
+        {field: "cpu", title: "CPU", width: "120", render: `var s=function(row, column, cellValue, index){ try {
                                                     return '<b style="color:#000;font-size:14px;">'+cellValue+'</b>';
                                                 } catch(err) { 
                                                     return null; 
                                                 }
         };eval(s);`},
-        {field: "memory", title: "MEM", width: "80", render: `var s=function(row, column, cellValue, index){ try {
-                                                    return '<b style="color:#000;font-size:14px;">'+Math.round(cellValue/1024,2) + '</b>';
+        {field: "memory", title: "MEM(GB)", width: "120", render: `var s=function(row, column, cellValue, index){ try {
+                                                    return '<b style="color:#000;font-size:14px;">'+cellValue + '</b>';
                                                 } catch(err) { 
                                                     return null; 
                                                 }
         };eval(s);`},
-        {field: "disk", title: "DISK", width: "80", render: `var s=function(row, column, cellValue, index){ try {
-                                                    return '<b style="color:#000;font-size:14px;">'+Math.round(cellValue/1024,2) + '</b>';
+        {field: "disk", title: "DISK(GB)", width: "120", render: `var s=function(row, column, cellValue, index){ try {
+                                                    return '<b style="color:#000;font-size:14px;">'+ cellValue + '</b>';
                                                 } catch(err) { 
                                                     return null; 
                                                 }
         };eval(s);`},
         {field: "cpu_busy", title: "CPU利用率", width: "180", render: `var s=function(row, column, cellValue, index){ try {
                                                     if(row.performance){
-                                                        return '<b style="color:#000;font-size:14px;">'+ row.performance[0][2] + '</b> ' + new Date(row.performance[0][0]).toLocaleString();    
+                                                        var val = _.round(row.performance[0][2],2);
+                                                        if(val >=80){
+                                                            return '<div style="display:flex;"><progress value="'+val+'" max="100" style="height:20px;"></progress> &nbsp;' + val + '%</div>';
+                                                        } else if(val >= 60 && val < 80){
+                                                            return '<div style="display:flex;"><progress value="'+val+'" max="100" style="height:20px;"></progress> &nbsp;' + val + '%</div>'; 
+                                                        } else{
+                                                            return '<div style="display:flex;"><progress value="'+val+'" max="100" style="height:20px;"></progress> &nbsp;' + val + '%</div>';
+                                                        }
                                                     }else{
                                                         return null;
                                                     }
@@ -67,14 +73,36 @@ var columns = [
                                                     return null; 
                                                 }
         };eval(s);`},
-        {field: "memRate", title: "内存使用率",visible:false,  width: "120", render: `var s=function(row, column, cellValue, index){ try {
-                                                    return cellValue;
+        {field: "mem_used", title: "内存使用率",visible:true,  width: "180", render: `var s=function(row, column, cellValue, index){ try {
+                                                    if(row.performance){
+                                                        var val = _.round(row.performance[0][2],2);
+                                                        if(val >=80){
+                                                            return '<div style="display:flex;"><progress value="'+val+'" max="100" style="height:20px;"></progress> &nbsp;' + val + '%</div>';
+                                                        } else if(val >= 60 && val < 80){
+                                                            return '<div style="display:flex;"><progress value="'+val+'" max="100" style="height:20px;"></progress> &nbsp;' + val + '%</div>'; 
+                                                        } else{
+                                                            return '<div style="display:flex;"><progress value="'+val+'" max="100" style="height:20px;"></progress> &nbsp;' + val + '%</div>';
+                                                        }
+                                                    }else{
+                                                        return null;
+                                                    }
                                                 } catch(err) { 
                                                     return null; 
                                                 }
         };eval(s);`},
-        {field: "diskRate", title: "磁盘利用率", visible:false, width: "120", render: `var s=function(row, column, cellValue, index){ try {
-                                                    return cellValue;
+        {field: "dis_used", title: "磁盘利用率", visible:true, width: "180", render: `var s=function(row, column, cellValue, index){ try {
+                                                    if(row.performance){
+                                                        var val = _.round(row.performance[0][2],2);
+                                                        if(val >=80){
+                                                            return '<div style="display:flex;"><progress value="'+val+'" max="100" style="height:20px;"></progress> &nbsp;' + val + '%</div>';
+                                                        } else if(val >= 60 && val < 80){
+                                                            return '<div style="display:flex;"><progress value="'+val+'" max="100" style="height:20px;"></progress> &nbsp;' + val + '%</div>'; 
+                                                        } else{
+                                                            return '<div style="display:flex;"><progress value="'+val+'" max="100" style="height:20px;"></progress> &nbsp;' + val + '%</div>';
+                                                        }
+                                                    }else{
+                                                        return null;
+                                                    }
                                                 } catch(err) { 
                                                     return null; 
                                                 }

+ 25 - 0
cncc_serverjs/script/cncc/应用/meta-capacitya/更新物理机配置缓存.js

@@ -0,0 +1,25 @@
+var getFromCache = function(keyStr){
+    var rtn = null;
+    var key = base64.encode(keyStr);
+    rtn = JSON.parse(appcontext.rawget(key));
+    return rtn;
+};
+
+var setToCache = function(keyStr,data){
+    var key = base64.encode(keyStr);
+    appcontext.rawset(key, data, 43200);
+};
+
+var allHostList = [];
+
+var x86List = odb.mql("select id,name,cpu,memory,disk,datacenter,hypervisor,performance from x86 limit -1").data;
+allHostList = allHostList.concat(x86List);
+
+var powerList = odb.mql("select id,name,cpu,memory,disk,datacenter,performance from power limit -1").data;
+var powerListA = _.map(powerList,function(v){
+    return _.extend(v,{hypervisor:'HMC'});
+})
+
+allHostList = allHostList.concat(powerListA);
+
+setToCache("allHostList",JSON.stringify(allHostList))

+ 0 - 0
cncc_serverjs/script/cncc/应用/meta-faulta/attachment/8500809039221148163/基线告警 (2).docx


+ 0 - 0
cncc_serverjs/script/cncc/应用/meta-faulta/attachment/8500809039221148163/运维文档 (4)


+ 0 - 884
cncc_serverjs/script/cncc/应用/meta-faulta/attachment/app:demoapp3/z000000000006EJ48jwebtQR/gui-config.json

@@ -1,884 +0,0 @@
-{
-    "configs": [
-        {
-            "server": "de1-1.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u5fb7\u56fd-DE1-1,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "de1-2.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u5fb7\u56fd-DE1-2,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "de1-3.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u5fb7\u56fd-DE1-3,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "de1-4.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u5fb7\u56fd-DE1-4,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "de2-1.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u5fb7\u56fd-DE2-1,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "de2-2.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u5fb7\u56fd-DE2-2,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "de2-3.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u5fb7\u56fd-DE2-3,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "de2-4.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u5fb7\u56fd-DE2-4,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "ee1-1.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u7231\u6c99\u5c3c\u4e9a-EE1-1,\u6d41\u91cf\u500d\u7387:0.10"
-        },
-        {
-            "server": "ee1-2.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u7231\u6c99\u5c3c\u4e9a-EE1-2,\u6d41\u91cf\u500d\u7387:0.10"
-        },
-        {
-            "server": "ee1-3.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u7231\u6c99\u5c3c\u4e9a-EE1-3,\u6d41\u91cf\u500d\u7387:0.10"
-        },
-        {
-            "server": "ee1-4.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u7231\u6c99\u5c3c\u4e9a-EE1-4,\u6d41\u91cf\u500d\u7387:0.10"
-        },
-        {
-            "server": "us1-1.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u7f8e\u56fd-US1-1,\u6d41\u91cf\u500d\u7387:1.50"
-        },
-        {
-            "server": "us1-2.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u7f8e\u56fd-US1-2,\u6d41\u91cf\u500d\u7387:1.50"
-        },
-        {
-            "server": "us1-3.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u7f8e\u56fd-US1-3,\u6d41\u91cf\u500d\u7387:1.50"
-        },
-        {
-            "server": "us1-4.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u7f8e\u56fd-US1-4,\u6d41\u91cf\u500d\u7387:1.50"
-        },
-        {
-            "server": "us2-1.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u7f8e\u56fd-US2-1,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "us2-2.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u7f8e\u56fd-US2-2,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "us2-3.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u7f8e\u56fd-US2-3,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "us2-4.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u7f8e\u56fd-US2-4,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "hk1-1.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u9999\u6e2f-HK1-1,\u6d41\u91cf\u500d\u7387:0.50"
-        },
-        {
-            "server": "hk1-2.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u9999\u6e2f-HK1-2,\u6d41\u91cf\u500d\u7387:0.50"
-        },
-        {
-            "server": "hk1-3.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u9999\u6e2f-HK1-3,\u6d41\u91cf\u500d\u7387:0.50"
-        },
-        {
-            "server": "hk1-4.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u9999\u6e2f-HK1-4,\u6d41\u91cf\u500d\u7387:0.50"
-        },
-        {
-            "server": "hk1-5.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u9999\u6e2f-HK1-5,\u6d41\u91cf\u500d\u7387:0.50"
-        },
-        {
-            "server": "hk1-6.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u9999\u6e2f-HK1-6,\u6d41\u91cf\u500d\u7387:0.50"
-        },
-        {
-            "server": "hk1-7.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u9999\u6e2f-HK1-7,\u6d41\u91cf\u500d\u7387:0.50"
-        },
-        {
-            "server": "hk1-8.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u9999\u6e2f-HK1-8,\u6d41\u91cf\u500d\u7387:0.50"
-        },
-        {
-            "server": "tw1-1.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u53f0\u6e7e-TW1-1,\u6d41\u91cf\u500d\u7387:0.50"
-        },
-        {
-            "server": "tw1-2.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u53f0\u6e7e-TW1-2,\u6d41\u91cf\u500d\u7387:0.50"
-        },
-        {
-            "server": "tw1-3.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u53f0\u6e7e-TW1-3,\u6d41\u91cf\u500d\u7387:0.50"
-        },
-        {
-            "server": "tw1-4.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u53f0\u6e7e-TW1-4,\u6d41\u91cf\u500d\u7387:0.50"
-        },
-        {
-            "server": "ty1-1.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u65e5\u672c-TY1-1,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "ty1-2.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u65e5\u672c-TY1-2,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "ty1-3.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u65e5\u672c-TY1-3,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "ty1-4.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u65e5\u672c-TY1-4,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "ty2-1.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u65e5\u672c-TY2-1,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "ty2-2.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u65e5\u672c-TY2-2,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "ty2-3.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u65e5\u672c-TY2-3,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "ty2-4.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u65e5\u672c-TY2-4,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "ty2-5.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u65e5\u672c-TY2-5,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "ty2-6.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u65e5\u672c-TY2-6,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "ty2-7.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u65e5\u672c-TY2-7,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "ty2-8.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u65e5\u672c-TY2-8,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "os1-1.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u65e5\u672c-OS1-1,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "os1-2.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u65e5\u672c-OS1-2,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "os1-3.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u65e5\u672c-OS1-3,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "os1-4.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u65e5\u672c-OS1-4,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "os1-5.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u65e5\u672c-OS1-5,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "os1-6.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u65e5\u672c-OS1-6,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "os1-7.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u65e5\u672c-OS1-7,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "os1-8.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u65e5\u672c-OS1-8,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "os2-1.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u65e5\u672c-OS2-1,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "os2-2.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u65e5\u672c-OS2-2,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "os2-3.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u65e5\u672c-OS2-3,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "os2-4.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u65e5\u672c-OS2-4,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "os2-5.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u65e5\u672c-OS2-5,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "os2-6.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u65e5\u672c-OS2-6,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "os2-7.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u65e5\u672c-OS2-7,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "os2-8.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u65e5\u672c-OS2-8,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "nl1-1.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u8377\u5170-NL1-1,\u6d41\u91cf\u500d\u7387:0.50"
-        },
-        {
-            "server": "nl1-2.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u8377\u5170-NL1-2,\u6d41\u91cf\u500d\u7387:0.50"
-        },
-        {
-            "server": "nl1-3.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u8377\u5170-NL1-3,\u6d41\u91cf\u500d\u7387:0.50"
-        },
-        {
-            "server": "nl1-4.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u8377\u5170-NL1-4,\u6d41\u91cf\u500d\u7387:0.50"
-        },
-        {
-            "server": "nl1-5.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u8377\u5170-NL1-5,\u6d41\u91cf\u500d\u7387:0.50"
-        },
-        {
-            "server": "nl1-6.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u8377\u5170-NL1-6,\u6d41\u91cf\u500d\u7387:0.50"
-        },
-        {
-            "server": "nl1-7.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u8377\u5170-NL1-7,\u6d41\u91cf\u500d\u7387:0.50"
-        },
-        {
-            "server": "nl1-8.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u8377\u5170-NL1-8,\u6d41\u91cf\u500d\u7387:0.50"
-        },
-        {
-            "server": "uk1-1.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u82f1\u56fd-UK1-1,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "uk1-2.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u82f1\u56fd-UK1-2,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "uk1-3.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u82f1\u56fd-UK1-3,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "uk1-4.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u82f1\u56fd-UK1-4,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "au1-1.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u6fb3\u5927\u5229\u4e9a-AU1-1,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "au1-2.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u6fb3\u5927\u5229\u4e9a-AU1-2,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "au1-3.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u6fb3\u5927\u5229\u4e9a-AU1-3,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "au1-4.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u6fb3\u5927\u5229\u4e9a-AU1-4,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "v6-1.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u7f8e\u56fd-V6-1,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "v6-2.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u65e5\u672c-V6-2,\u6d41\u91cf\u500d\u7387:1.00"
-        },
-        {
-            "server": "v6-3.troiecloud.com",
-            "server_port": 443,
-            "password": "x4AdSgxysZffR7qX3J",
-            "tcp_fast_open": false,
-            "verify": true,
-            "verify_certificate": true,
-            "verify_hostname": true,
-            "type": "trojan",
-            "remarks": "\u9999\u6e2f-V6-3,\u6d41\u91cf\u500d\u7387:0.50"
-        }
-    ],
-    "localPort": 1080,
-    "index": 0,
-    "global": false,
-    "enabled": true,
-    "isDefault": false,
-    "socks5_address": "127.0.0.1",
-    "socks5_port": 1080,
-    "http_address": "127.0.0.1",
-    "http_port": 1081,
-    "pac_address": "127.0.0.1",
-    "pac_port": 8070
-}

BIN
cncc_serverjs/script/cncc/应用/meta-faulta/attachment/biz:开发测试/z000000000005N7R3YeeSISU/rule (1).png


BIN
cncc_serverjs/script/cncc/应用/meta-faulta/attachment/biz:开发测试/z000000000005N7R3YeeSISU/rule (2).png


BIN
cncc_serverjs/script/cncc/应用/meta-faulta/attachment/biz:开发测试/z000000000005N7R3YeeSISU/rule (3).png


+ 0 - 184
cncc_serverjs/script/cncc/应用/meta-faulta/attachment/biz:数字国网/z0000000000050znkhAEhdgY1mIFEJNw5utmO/ai-message.vue

@@ -1,184 +0,0 @@
-Vue.component("matrix-ai-message", {
-    delimiters: ['#{', '}#'],
-    props: {
-        model: Object
-    },
-    data(){
-        return {
-            message: {
-                term: "",
-                defaultSubject: [],
-                subject: [],
-                ws: null,
-            }
-        }
-    },
-    template:   `<el-container>
-                    <span slot="label">
-                        <a href="javascript:void(0);">消息 <span class="badge" style="position: absolute;background: rgb(255, 0, 0);" v-if="allMsg>0">#{allMsg}#</span></a>
-                    </span>
-                    <el-aside width="34%" style="height:100%;overflow: auto;background: transparent;">
-                        <div class="media" :class="[index==0?'selected':'']" :id="objectHash.sha1(item)" v-for="(item,index) in message.subject" style="border-bottom: 1px solid rgb(221, 221, 221);padding: 5px;cursor: pointer;margin: 0px;" @click="clickMe(item)">
-                            <div class="media-left">
-                                <span class="fas fa-circle" style="position: absolute;left:40px;color: rgb(255, 0, 0);transform: scale(.7);" v-if="item.msgs.length>0"></span>
-                                <a href="#">
-                                    <img class="media-object" :src="'/static/assets/images/robot/png/'+item.icon + '.png'" style="width: 42px;height: 42px;">
-                                </a>
-                            </div>
-                            <div class="media-body" style="text-align: left;">
-                                <h5 class="media-heading">#{item.title}#</h5>
-                                <span class="date-time">#{moment(item.vtime).format("LLL")}#</span>
-                            </div>
-                        </div>
-                    </el-aside>
-                    <el-container>
-                        <el-main style="padding:0px;text-align: center;line-height: 30px;background:rgb(228, 231, 237);overflow:hidden auto;" id="subject-msgs">
-                            <ul class="chats">
-                                <li :class="item.type" v-for="item in message.defaultSubject.msgs">
-                                    <span class="date-time">#{moment(item.ctime).format("LLL")}#</span>
-                                    <a href="javascript:;" class="name">#{item.icon}#</a>
-                                    <a href="javascript:;" class="image">
-                                        <img alt="" :src="'/static/assets/images/robot/png/'+item.icon + '.png'" style="width: 42px;height: 42px;" />
-                                    </a>
-                                    <div class="message animated pulse" contenteditable="false" style="outline:none;">
-                                        #{item.msg}#
-                                    </div>
-                                </li>
-                            </ul>
-                        </el-main>
-                        <el-footer>
-                            <div class="input-group" style="padding:5px 10px;">
-                                <input type="text" class="form-control" placeholder="消息输入" v-model="message.term" @keyup.13="sendMsg"/>
-                                <span class="input-group-btn">
-                                    <a class="btn btn-grey" href="javascript:void(0);" @click="sendMsg"><i class="fas fa-paper-plane"></i></a>
-                                </span>
-                            </div>
-                        </el-footer>
-                    </el-container>
-                </el-container>`,
-    computed: {
-        allMsg(){
-            return _.sumBy(this.message.subject,function(v){ return v.msgs.length; });
-        }
-    },
-    created: function(){
-        const self = this;
-
-        eventHub.$on("WIN-CLOSE-EVENT",self.wsClose);
-
-        // 初始化主题
-        self.message.subject = fsHandler.callFsJScript("/matrix/ai/subscribe.js", null).message;
-        
-    },
-    mounted: function(){
-        const self = this;
-        
-        // 默认主题消息
-        let item = _.first(self.message.subject);
-        let message = fsHandler.callFsJScript("/matrix/ai/getMessage.js", encodeURIComponent(JSON.stringify(item)) ).message;
-        self.message.defaultSubject = _.extend(item, {msgs:message});
-
-        // 初始化默认WS
-        self.initWs(item);
-
-        // 消息列表滚动到最底部
-        self.scrollSmoothToBottom('subject-msgs');
-
-        self.$nextTick(function(){
-            
-        })
-    },
-    destroyed: function(){
-        this.message.ws.close(self.message.ws);
-    },
-    methods: {
-        initWs(item) {
-            const self = this;
-            
-            if(this.message.ws) {
-                this.message.ws.close(this.message.ws);
-            }
-
-            try {
-                if(!this.message.ws){
-                    this.message.ws = new WebSocket(`ws://${document.location.host}/websocket/${item.subject}?source=${item.source}&title=${item.title}`);
-                }
-
-                this.message.ws.onopen = function(evt) {
-                    console.log("已打开: " + JSON.stringify(evt), self.message.ws);
-                };
-                this.message.ws.onclose = function (evt) {
-                    console.log("已关闭: " + JSON.stringify(evt));
-                };
-                this.message.ws.onerror = function (evt) {
-                    console.log("错误: " + JSON.stringify(evt));
-                };
-                this.message.ws.onmessage = function (evt) {
-                    let wsMsg = evt.data;
-                    
-                    if (wsMsg.indexOf("error") > 0) {
-                        console.log("错误: " + wsMsg.error + "\r\n");
-                    } else {
-                        console.log("收到: " + wsMsg + "\r\n");
-                        self.message.defaultSubject.msgs.push(_.merge(JSON.parse(wsMsg),{icon:'event',type:'from'}));
-                        // 消息列表滚动到最底部
-                        self.scrollSmoothToBottom('subject-msgs');
-                    }
-                };
-            } catch (err) {
-                console.error(err);
-            }
-
-        },
-        sendMessage(){
-            const self = this;
-
-            if (self.message.ws.readyState === 1) {
-                self.message.ws.send(`事件来了 ${moment().format("hh:mm:ss a")} 来自 ${self.message.wsUrl}`);
-            }
-        },
-        apply(){
-            const self = this;
-
-            if(self.message.ws){
-
-                this.ws.close(self.message.ws);
-
-                self.init();
-
-                $('#wsSetup').collapse('hide');
-            }
-        },
-        // 切换主题,获取相应消息
-        clickMe(item){
-            
-            // 选择主题效果
-            $(this.$el).find(".selected").removeClass("selected");
-            $(`#${objectHash.sha1(item)}`).addClass("selected");
-            
-            // 获取最新主题消息
-            let message = fsHandler.callFsJScript("/matrix/ai/getMessage.js", encodeURIComponent(JSON.stringify(item)) ).message;
-            this.message.defaultSubject = _.extend(item, {msgs: message});
-
-            // 接收消息
-            this.initWs(item);
-        },
-        sendMsg(){
-            
-            if(!this.message.term) return false;
-
-            this.message.defaultSubject.msgs.push({icon:'wzd', time:_.now(), msg:this.message.term, type: 'to'});
-
-            // 消息列表滚动到最底部
-            this.scrollSmoothToBottom('subject-msgs');
-
-            this.message.term = "";
-        },
-        scrollSmoothToBottom (id) {
-            var div = document.getElementById(id);
-            $('#' + id).animate({
-                scrollTop: div.scrollHeight// - div.clientHeight
-            }, 500);
-        }
-    },
-});

BIN
cncc_serverjs/script/cncc/应用/meta-faulta/attachment/linux:172.26.38.248/17368221814077026651/Export_2021-06-19 17_29_52.xlsx


BIN
cncc_serverjs/script/cncc/应用/meta-faulta/attachment/linux:node3/alert:10.216.202.66-cpuutilization-5/rule.png


+ 0 - 0
cncc_serverjs/script/cncc/应用/meta-faulta/attachment/pod:tomcat-pod3/alert:100.83.165.231_pot-down_5/基线告警 (2).docx


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 38
cncc_serverjs/script/cncc/应用/meta-faulta/attachment/pod:tomcat-pod3/z0000000000060znkhAEhdgY1mHVcfDjVnMLE/eif.20210602.log


BIN
cncc_serverjs/script/cncc/应用/meta-faulta/attachment/pod:web-demo-j6qxj/z0000000000060znkhAEhdgY1mFhr1U6hW2f3/展示系统接口说明_20180926.docx


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 5
cncc_serverjs/script/cncc/应用/meta-faulta/attachment/pod:web-demo-j6qxj/z0000000000060znkhAEhdgY1mTXRj2goMqcu/ETCD_eventbus_2021_3_24下午3_07_02.json


BIN
cncc_serverjs/script/cncc/应用/meta-faulta/attachment/pod:web-demo-j6qxj/z0000000000060znkhAEhdgY1mTXRj2goMqcu/pexels-juan-733475 (4).jpg


BIN
cncc_serverjs/script/cncc/应用/meta-faulta/attachment/pod:web-demo-j6qxj/z0000000000060znkhAEhdgY1mTXRj2goMqcu/pexels-juan-733475.jpg


+ 29 - 13
cncc_serverjs/script/cncc/应用/meta-faulta/bdos/init.js

@@ -1,32 +1,48 @@
+// CREATE INDEX cnccbdos_appname ON matrix_native.cnccbdos (appname);
+// CREATE INDEX cnccbdos_appno ON matrix_native.cnccbdos (appno);
+// CREATE INDEX cnccbdos_appnode ON matrix_native.cnccbdos (appnode);
+// CREATE INDEX cnccbdos_busuid ON matrix_native.cnccbdos (busuid);
+// CREATE INDEX cnccbdos_errtype ON matrix_native.cnccbdos (errtype);
+// CREATE INDEX cnccbdos_filename ON matrix_native.cnccbdos (filename);
+// CREATE INDEX cnccbdos_macappname ON matrix_native.cnccbdos (macappname);
+// CREATE INDEX cnccbdos_machine ON matrix_native.cnccbdos (machine);
+// CREATE INDEX cnccbdos_minute ON matrix_native.cnccbdos (minute);
+// CREATE INDEX cnccbdos_msgdealstatus ON matrix_native.cnccbdos (msgdealstatus);
+// CREATE INDEX cnccbdos_msgtype ON matrix_native.cnccbdos (msgtype);
+// CREATE INDEX cnccbdos_msguid ON matrix_native.cnccbdos (msguid);
+// CREATE INDEX cnccbdos_node ON matrix_native.cnccbdos (node);
+// CREATE INDEX cnccbdos_orgbusuid ON matrix_native.cnccbdos (orgbusuid);
+// CREATE INDEX cnccbdos_orgmsgrefid ON matrix_native.cnccbdos (orgmsgrefid);
+// CREATE INDEX cnccbdos_orgmsgtype ON matrix_native.cnccbdos (orgmsgtype);
+// CREATE INDEX cnccbdos_orgmsguid ON matrix_native.cnccbdos (orgmsguid);
+// CREATE INDEX cnccbdos_path ON matrix_native.cnccbdos (path);
+// CREATE INDEX cnccbdos_recvnode ON matrix_native.cnccbdos (recvnode);
+// CREATE INDEX cnccbdos_sendnode ON matrix_native.cnccbdos (sendnode);
+// CREATE INDEX cnccbdos_syscode ON matrix_native.cnccbdos (syscode);
+// CREATE INDEX cnccbdos_transuid ON matrix_native.cnccbdos (transuid);
+
 var columns=[ 
-	{field:"dc", type:"s", title:"#DC", width:120},
+	
 	{field:"appname", type:"s", title:"应用名", width:200},
+	{field:"errtype", type:"s", title:"错误类型", width:200},
+	{field:"minute", type:"s", title:"统计时间点(分钟)", width:200},
 	{field:"busuid", type:"s", title:"报文编号", width:200},
 	{field:"filename", type:"s", title:"报文所在文件名称", width:200},
 	{field:"macappname", type:"s", title:"所属系统", width:200},
 	{field:"machine", type:"s", title:"服务器名称", width:200},
-	{field:"mesgpriority", type:"s", title:"mesgpriority", width:200},
-	{field:"msgcomptime", type:"i", title:"处理完成时间", width:200},
-	{field:"msgdealsch", type:"f", title:"处理时长(毫秒)", width:200},
 	{field:"msgdealstatus", type:"s", title:"报文处理状态", width:200},
-	{field:"msgdealtime_pmts", type:"i", title:"处理时间pmts", width:200},
-	{field:"msgrecvtime_pmts", type:"i", title:"接收时间pmts", width:200},
 	{field:"msgtype", type:"s", title:"报文编号", width:200},
 	{field:"msguid", type:"s", title:"msg编号", width:200},
 	{field:"node", type:"s", title:"站点节点", width:200},
+	{field:"orgbusuid", type:"s", title:"原报文编号", width:200},
 	{field:"orgmsgrefid", type:"s", title:"原msg编号", width:200},
 	{field:"orgmsgtype", type:"s", title:"原报文类型", width:200},
 	{field:"orgmsguid", type:"s", title:"原msg编号", width:200},
-	{field:"origreceiversid", type:"s", title:"origreceiversid", width:200},
-	{field:"origsenddate", type:"s", title:"日期", width:200},
-	{field:"origsendtime", type:"s", title:"时间", width:200},
 	{field:"path", type:"s", title:"文件路径", width:350},
-	{field:"pid", type:"s", title:"PID", width:200},
-	{field:"presendtime", type:"i", title:"前节点发送时间", width:200},
 	{field:"recvnode", type:"s", title:"接收行(参与者)", width:200},
 	{field:"sendnode", type:"s", title:"发起行(参与者)", width:200},
-	{field:"syscode", type:"s", title:"业务系统", width:200},
-	{field:"updown", type:"s", title:"上行下行", width:200}
+	{field:"syscode", type:"s", title:"业务系统", width:200}
+
 ];
 
 OUTPUT = _.sortBy(columns,'field');

+ 1 - 1
cncc_serverjs/script/cncc/应用/meta-faulta/bdos/交易吞吐量排名.js

@@ -1,4 +1,4 @@
-var rows= JSON.parse(dfs.read("/script/cncc/meta-report/bdos/data.json"));
+var rows= JSON.parse(dfs.read("/script/cncc/应用/meta-report/bdos/data.json"));
 var columns=[ 
 	{field:"updown", type:"s", title:"链路方向", width:100, visible:false,render: `var s=function(row, column, cellValue, index){
 	        if(cellValue==='U'){

+ 1 - 1
cncc_serverjs/script/cncc/应用/meta-faulta/bdos/处理时长排名.js

@@ -1,4 +1,4 @@
-var rows= JSON.parse(dfs.read("/script/cncc/meta-report/bdos/data.json"));
+var rows= JSON.parse(dfs.read("/script/cncc/应用/meta-report/bdos/data.json"));
 var columns=[ 
 	{field:"updown", type:"s", title:"链路方向", visible: false,width:100, render: `var s=function(row, column, cellValue, index){
 	        if(cellValue==='U'){

+ 61 - 35
cncc_serverjs/script/cncc/应用/meta-faulta/bdos/报文检索.js

@@ -1,5 +1,8 @@
+var input = JSON.parse(decodeURIComponent(INPUT));
+
 var columns=[ 
-    {field:"updown", type:"s", title:"链路方向", visible: false, width:100, render: `var s=function(row, column, cellValue, index){
+    {field:"minute", type:"s", title:"汇总时间", width:220},
+    {field:"updown", type:"s", title:"链路方向(updown)", visible: false, width:100, render: `var s=function(row, column, cellValue, index){
 	        if(cellValue==='U'){
 	            return '<b style="color:#5094d5;">上行</b>';
 	        }else{
@@ -7,7 +10,7 @@ var columns=[
 	        }
 	    };eval(s);`
 	},
-	{field:"syscode", type:"s", title:"业务名称", width:120, render: `var s=function(row, column, cellValue, index){
+	{field:"syscode", type:"s", title:"业务名称(syscode)", width:160, render: `var s=function(row, column, cellValue, index){
 	        if(cellValue){
     	        var origin = window.location.origin;
     	        return cellValue+' <a href="'+origin+'/static/app/matrix/meta-linka/index.html" style="color:#5094d5;" class="el-icon-s-platform"></a> ' + ' <a href="javascript:#;" style="color:#5094d5;" class="el-icon-s-data"></a>';
@@ -17,8 +20,8 @@ var columns=[
 	        
 	    };eval(s);`
 	},
-	{field:"busuid", type:"s", title:"报文编号", width:220},
-	{field:"appname", type:"s", title:"应用名称", width:120, visible: false, render: `var s=function(row, column, cellValue, index){
+	{field:"busuid", type:"s", title:"报文编号(busuid)", width:220},
+	{field:"appname", type:"s", title:"应用名称(appname)", width:120, visible: false, render: `var s=function(row, column, cellValue, index){
 	        if(cellValue){
     	        var origin = window.location.origin;
     	        return cellValue+' <a href="'+origin+'/static/app/matrix/meta-linka/index.html" style="color:#5094d5;" class="el-icon-s-platform"></a>';
@@ -27,7 +30,7 @@ var columns=[
 	        }
 	    };eval(s);`
 	},
-	{field:"machine", type:"s", title:"服务器名称", visible: false, width:120, render: `var s=function(row, column, cellValue, index){
+	{field:"machine", type:"s", title:"服务器名称(machine)", visible: true, width:220, render: `var s=function(row, column, cellValue, index){
 	        if(cellValue){
     	        var origin = window.location.origin;
     	        return cellValue+' <a href="'+origin+'/static/app/matrix/meta-linka/index.html" style="color:#5094d5;" class="el-icon-s-platform"></a>';
@@ -36,32 +39,27 @@ var columns=[
 	        }
 	    };eval(s);`
 	},
-	{field:"rt", type:"f", title:"处理时长(毫秒)", width:140, render: `var s=function(row, column, cellValue, index){
-	        return '<b style="color:#0761a8;">'+cellValue+'</b>';
+	{field:"atrt", type:"f", title:"全链路响应时间(毫秒)(atrt)", width:240, render: `var s=function(row, column, cellValue, index){
+	        return '<b style="color:#0761a8;font-size:16px;">'+cellValue+'</b>';
 	    };eval(s);`
 	},
-	{field:"tpm", type:"f", title:"吞吐量(每分钟)", width:140, render: `var s=function(row, column, cellValue, index){
-	        return '<b style="color:#0761a8;">'+cellValue+'</b>';
+	{field:"antc", type:"f", title:"应用节点耗时(毫秒)(antc)", width:240, render: `var s=function(row, column, cellValue, index){
+	        return '<b style="color:#0761a8;font-size:16px;">'+cellValue+'</b>';
 	    };eval(s);`
 	},
-	{field:"fpm", type:"f", title:"失败率(每分钟)", width:140, render: `var s=function(row, column, cellValue, index){
-	        return '<b style="color:#0761a8;">'+cellValue+'</b>';
-	    };eval(s);`
-	},
-	{field:"msgdealsch", type:"f", title:"处理时长(毫秒)", visible: false, width:200, render: `var s=function(row, column, cellValue, index){
+	{field:"msgdealsch", type:"f", title:"处理时长(毫秒)(msgdealsch)", visible: false, width:200, render: `var s=function(row, column, cellValue, index){
 	        return '<b style="color:#ff0000;">'+cellValue+'</b>';
 	    };eval(s);`
 	},
 	{field:"dc", type:"s", title:"#DC", visible: false, width:120},
 	{field:"filename", type:"s", title:"报文所在文件名称", visible: false, width:200},
-	{field:"macappname", type:"s", title:"所属系统", width:200},
+	{field:"macappname", type:"s", title:"所属系统(macappname)", width:200},
 	{field:"mesgpriority", type:"s", title:"mesgpriority", visible: false, width:200},
 	{field:"msgcomptime", type:"i", title:"处理完成时间", visible: false, width:200},
 	{field:"msgdealstatus", type:"s", title:"报文处理状态", visible: false, width:200},
 	{field:"msgdealtime_pmts", type:"i", title:"处理时间pmts", visible: false, width:200},
 	{field:"msgrecvtime_pmts", type:"i", title:"接收时间pmts", visible: false, width:200},
 	{field:"msgtype", type:"s", title:"报文编号", width:200},
-	
 	{field:"msguid", type:"s", title:"msg编号", width:200},
 	{field:"orgmsguid", type:"s", title:"原msg编号", width:220},
 	{field:"node", type:"s", title:"站点节点", width:200},
@@ -73,8 +71,8 @@ var columns=[
 	{field:"path", type:"s", title:"文件路径", visible: false, width:350},
 	{field:"pid", type:"s", title:"PID", visible: false, width:200},
 	{field:"presendtime", type:"i", title:"前节点发送时间", width:200},
-	{field:"recvnode", type:"s", title:"接收行(参与者)", width:200},
-	{field:"sendnode", type:"s", title:"发起行(参与者)", width:200}
+	{field:"recvnode", type:"s", title:"接收行(参与者)(recvnode)", width:200},
+	{field:"sendnode", type:"s", title:"发起行(参与者)(sendnode)", width:200}
 ];
 
 var subColumns=[ 
@@ -156,25 +154,53 @@ var subColumns=[
 	{field:"sendnode", type:"s", title:"发起行(参与者)", visible:false, width:200}
 ];
 
+var trace = null;
+
+function getCurrentDateTime(value) {
+    var str = "";
+
+    var currentTime = new Date(value) 
+    var year = currentTime.getFullYear() 
+    var month = currentTime.getMonth() + 1;
+    var day = currentTime.getDate() 
+    var hours = currentTime.getHours() 
+    var minutes = currentTime.getMinutes() 
+
+    if (minutes < 10) {
+        minutes = "0" + minutes
+    }
+    
+    str += year + "" + month + "" + day + "" + hours + "" + minutes;
+    
+    return str;
+}
+
+var timeRangeByMinute = (function(){
+    var rtn = [];
+    var range = [new Date(input.timerange).getTime()];
+    // for(var i=range[0];i<=range[1];i++){
+    //     var d = getCurrentDateTime(i);
+    //     rtn.push(d);
+    //     i = i + 60000;
+    // }
+    // return rtn;
+    return [getCurrentDateTime(range[0])]
+})();
+
 var rows = (function(){
-    var tmp = JSON.parse(dfs.read("/script/cncc/meta-report/bdos/data.json"));
     
-    return _.sortBy(_.compact(_.map(tmp,function(v){ 
-        if(v.updown==='U' || v.updown==='D'){
-            v.msgdealsch = Number(v.msgdealsch);
-            var o = {};
-            o['rt']= Math.round(v.msgdealsch, 2);
-            o['tpm']= Math.round(v.msgdealsch * 20, 0);
-            o['fpm']= Math.round(v.msgdealsch * 1.2, 2);
-            
-            var msgtype = v.msgtype?v.msgtype.split("."):[];
-            log.info(111,msgtype)
-            if(!_.includes([101,102], Number(msgtype[1]))) return;
-            
-            return _.extend(v,o);
-        }
-    })),'msgdealsch').reverse()
+    var minuteCond = _.map(timeRangeByMinute,function(v){
+        return "minute="+v;
+    })[0];
+    
+    var props = input.props.length > 0 ? input.props.join(" and ") + " and " : " ";
+    var mql = "select * from /native/cnccbdos where syscode='IBPS' and " + props + " (" + minuteCond +") limit 200";
+    trace = mql;
+    var tmp =  odb.mql(mql).data;
+    
+    return _.sortBy(tmp,'atrt').reverse()
     
 })();
 
-OUTPUT = {rows: rows, columns:columns, subColumns:subColumns, title:"业务故障分析"};
+
+OUTPUT = {rows: rows, columns:columns, subColumns:subColumns, title:"业务故障分析", trace:trace, timeRange:timeRangeByMinute};

+ 0 - 49
cncc_serverjs/script/cncc/应用/meta-faulta/contextmenu/action.js

@@ -1,49 +0,0 @@
-var input = JSON.parse(INPUT);
-
-var update = function(){
-    var rtn = null;
-    try{
-        var mql = null;
-        if(input.value == 13)
-        {
-            mql = "delete from /matrix/devops/ where id in ('"+input.id.join("','") +"')";
-        }
-        else if(input.value == 12)
-        {
-            var firstoccurrencemql = "select id,firstoccurrence from /matrix/devops/alert_status where id in ('"+input.id.join("','") +"')";
-            var firstoccurrencertn = odb.mql(firstoccurrencemql)
-            
-            _.forEach(firstoccurrencertn.data,function(v){
-                var myid = v.id;
-                var tmp = JSON.stringify(v.firstoccurrence).replace(/"\"/g,"").replace(/"/g,"");
-
-                log.info((new Date()).getTime())
-
-                log.info((new Date(tmp)).getTime())
-                var myduration =(new Date()).getTime() - (new Date(tmp)).getTime();
-                if(mql !== null)
-                {
-                    mql = mql + "\nupdate /matrix/devops/ set status = " + input.value + ",duration = "+ myduration + " where id = '"+ myid +"';";
-                }
-                else
-                {
-                    mql = "update /matrix/devops/ set status = " + input.value + ",duration = "+ myduration + " where id = '"+ myid +"';";
-                }
-            });
-            
-        }
-        else
-        {
-            mql = "update /matrix/devops/ set status= " + input.value + " where id in ('"+input.id.join("','") +"')";
-        }
-        log.info(mql)
-        rtn = odb.mql(mql);
-    }catch(err){
-        log.error(err);
-        rtn = null;
-    }
-    log.info(rtn);
-    return rtn;
-};
-
-OUTPUT = update();

+ 0 - 147
cncc_serverjs/script/cncc/应用/meta-faulta/contextmenu/context-menu.json

@@ -1,147 +0,0 @@
-[
-  {
-    "component": {
-      "name": "DiagnosisView"
-    },
-    "icon": "",
-    "id": 1,
-    "name": "告警分析",
-    "type": "component"
-  },
-  {
-    "icon": "",
-    "id": 11,
-    "name": "流程系统",
-    "type": "url",
-    "url": {
-      "target": "_blank",
-      "value": "http://www.baidu.com"
-    }
-  },
-  {
-    "name": "12",
-    "type": "divider"
-  },
-  {
-    "action": {
-      "name": "this.m3.callFS('/cncc/meta-faulta/contextmenu/action.js', term);",
-      "value": 10
-    },
-    "icon": "",
-    "id": 3,
-    "name": "打开",
-    "type": "action"
-  },
-  {
-    "action": {
-      "name": "this.m3.callFS('/cncc/meta-faulta/contextmenu/action.js', term);",
-      "value": 11
-    },
-    "icon": "",
-    "id": 4,
-    "name": "确认",
-    "type": "action"
-  },
-  {
-    "action": {
-      "name": "this.m3.callFS('/cncc/meta-faulta/contextmenu/action.js', term);",
-      "value": 12
-    },
-    "icon": "",
-    "id": 5,
-    "name": "关闭",
-    "type": "action"
-  },
-  {
-    "action": {
-      "name": "this.m3.callFS('/cncc/meta-faulta/contextmenu/action.js', term);",
-      "value": 13
-    },
-    "icon": "",
-    "id": 6,
-    "name": "删除",
-    "type": "action"
-  },
-  {
-    "action": {
-      "name": "this.m3.callFS('/cncc/meta-faulta/contextmenu/action.js', term);",
-      "value": 14
-    },
-    "icon": "",
-    "id": 61,
-    "name": "上报",
-    "type": "action"
-  },
-  {
-    "name": "",
-    "type": "divider"
-  },
-  {
-    "icon": "",
-    "id": 7,
-    "name": "附件",
-    "type": "attachment"
-  },
-  {
-    "id": 1620616262499,
-    "name": 1620616262499,
-    "type": "divider"
-  },
-  {
-    "action": {
-      "name": "",
-      "value": null
-    },
-    "icon": "",
-    "id": 8,
-    "name": "短信发送",
-    "type": "action"
-  },
-  {
-    "action": {
-      "name": "",
-      "value": null
-    },
-    "icon": "",
-    "id": 9,
-    "name": "邮件发送",
-    "type": "action"
-  },
-  {
-    "action": {
-      "name": "",
-      "value": null
-    },
-    "icon": "",
-    "id": 10,
-    "name": "生成工单",
-    "type": "action"
-  },
-  {
-    "id": 1620622426073,
-    "name": 1620622426073,
-    "type": "divider"
-  },
-  {
-    "icon": "",
-    "id": 11,
-    "name": "标签",
-    "type": "tag"
-  },
-  {
-    "id": 1620615628340,
-    "name": 1620615628340,
-    "type": "divider"
-  },
-  {
-    "icon": "",
-    "id": 1620616806756,
-    "name": "官网",
-    "type": "url",
-    "url": {
-      "param": "",
-      "target": "_top",
-      "value": "http://wecise.com"
-    }
-  }
-]

+ 0 - 13
cncc_serverjs/script/cncc/应用/meta-faulta/contextmenu/getContextMenu.js

@@ -1,13 +0,0 @@
-var getContextMenu = function(){
-    var rtn = null;
-    
-    try{
-        var tmp = dfs.read("/script/cncc/meta-faulta/contextmenu/context-menu.json");
-        rtn = JSON.parse(tmp);
-    } catch(err){
-        rtn = null;
-    }
-    return rtn;
-};
-
-OUTPUT = getContextMenu();

+ 0 - 145
cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/attributeRel.js

@@ -1,145 +0,0 @@
-var input = decodeURIComponent(INPUT);
-
-// 默认视图配置
-var view = (function(){
-    try{
-        var CONFIG_PATH = "/script/cncc/meta-faulta/view/config.json";
-        return JSON.parse(dfs.read(JSON.parse(dfs.read(CONFIG_PATH)).defaultView)).datasource;
-    }catch(err){
-        return null
-    }
-})();
-
-var rows = (function(){
-    var rtn = null;
-    
-    try{
-        var term = [];
-        term[0]="#"+view.class;
-        term[1]=input.replace(/"/gi,"");
-        term[2]="top 500";
-        var mql = _.compact(term).join(" | ");
-        log.debug(mql)
-        rtn = odb.search(mql).data;
-    }catch(err){
-        rtn = [];
-    }
-    return rtn;
-})();
-
-
-// 常用渲染表达式
-var render_columns = [
-    {field: "rootCause", title: "根原因", width: "80", render: `var s=function(row, column, cellValue, index){
-                try{
-                    if(cellValue == 1){
-                         var el = document.querySelector('.attributeRelEvent-row-'+index+' >.'+column.id+' > .cell');
-                         el.classList.add('el-icon-star-on','animate__animated', 'animate__flash','flash-red');
-                         el.style.color='#ff0000';
-                         el.style.fontSize='18px';
-                        return "";
-                    } else {
-                        return "";
-                    }
-                } catch(err){
-                    return "";
-                }
-            };eval(s);`},
-    {field: "severity", title: "级别", width: "80", render: `var s=function(row, column, cellValue, index){ 
-        try{ 
-            /* by row */
-            var el = document.querySelector('.attributeRelEvent-row-'+index);
-            /* by column */
-            /* var el = document.querySelector('.attributeRelEvent-row-'+index+' >.'+column.id+' > .cell');*/
-            if(row.status=='11'){
-                el.style.backgroundColor = m3.utils.adjustColor(global.register.event.severity[cellValue][2], -100);
-            }else{
-                el.style.backgroundColor = global.register.event.severity[cellValue][2];
-            }
-            el.style.color = '#ffffff';
-            el.style.textAlign = 'center';
-            return global.register.event.severity[cellValue][1]; 
-        } catch(err) { 
-            return null; 
-        }
-    };eval(s);`},
-    {field: "status", title: "状态", width: "80", render: `var s=function(row, column, cellValue, index){ try {
-                                                return global.register.event.status[cellValue][1];
-                                            } catch(err) { 
-                                                return null; 
-                                            }
-    };eval(s);`}
-];
-
-// default template
-var default_columns = 
-    [
-        {field: "rootCause", title: "根原因", width: "80", render: `var s=function(row, column, cellValue, index){
-                try{
-                    if(cellValue == 1){
-                         var el = document.querySelector('.attributeRelEvent-row-'+index+' >.'+column.id+' > .cell');
-                         el.classList.add('el-icon-star-on','animate__animated', 'animate__flash','flash-red');
-                         el.style.color='#ff0000';
-                         el.style.fontSize='18px';
-                        return "";
-                    } else {
-                        return "";
-                    }
-                } catch(err){
-                    return "";
-                }
-            };eval(s);`},
-        {field: "severity", title: "级别", width: "80", render: `var s=function(row, column, cellValue, index){ 
-            try{ 
-                /* by row */
-                var el = document.querySelector('.attributeRelEvent-row-'+index);
-                /* by column */
-                /*var el = document.querySelector('.attributeRelEvent-row-'+index+' >.'+column.id+' > .cell');*/
-                el.style.backgroundColor = global.register.event.severity[cellValue][2];
-                el.style.color = '#ffffff';
-                el.style.textAlign = 'center';
-                return global.register.event.severity[cellValue][1]; 
-            } catch(err) { 
-                return null; 
-            }
-        };eval(s);`},
-        {field: "biz", title: "业务", width: "120"},
-        {field: "app", title: "系统", width: "120"},
-        {field: "ip", title: "IP地址", width: "120"},
-        {field: "tally", title: "告警次数", width: "120"},
-        {field: "host", title: "主机名", width: "120"},
-        {field: "status", title: "状态", width: "80", render: `var s=function(row, column, cellValue, index){ try {
-                                                    return global.register.event.status[cellValue][1];
-                                                } catch(err) { 
-                                                    return null; 
-                                                }
-        };eval(s);`},
-        {field: "vtime", title: "发生时间", width: "160", render: 'var s=function(row, column, cellValue, index){return moment(cellValue).format("YYYY-MM-DD HH:mm:ss");};eval(s);'},
-        {field: "msg", title: "告警内容", width: "380"},
-        {field: "during", title: "耗时", width: "80"},
-        {field: "admin", title: "管理员", width: "80"},
-        {field: "location", title: "地点", width: "80"},
-        {field: "tags", title: "标签", width: "80"},
-        {field: "entity", title: "实体", width: "180", visible:false},
-        {field: "id", title: "ID", width: "80", visible:false},
-        {field: "class", title: "类", width: "80", visible:false}
-        
-    ];
-    
-// columns
-var columns = (function(){
-    if(view){
-        // 如果用户自定义了属性
-        if(view.fields){
-            return view.fields.concat(render_columns);
-        } else {
-            return default_columns;
-        }
-    }else{
-        return default_columns;
-    }
-})();
-
-var summary = {all: rows.length, groupbBySeverity:null};
-
-OUTPUT =  {columns:columns,rows:rows, summary:summary};

+ 0 - 12
cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/bitlog/getBitlogList.js

@@ -1,12 +0,0 @@
-var bitlog = function(){
-    var rtn = null;
-    try{
-        var mql = "select * from /system/bitlog";
-        rtn = odb.mql(mql).data;
-    } catch(err){
-        rtn = [];
-    }
-    return rtn;
-};
-
-OUTPUT = bitlog();

+ 0 - 38
cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/bitlog/getBucketByEntity.js

@@ -1,38 +0,0 @@
-var input = decodeURIComponent(INPUT);
-
-var entity = (function(){
-    var rtn = null;
-    
-    try{
-        var mql = "select * from /matrix/entity/ where id='"+ input +"'";
-        rtn = odb.mql(mql).data[0];
-        
-    }catch(err){
-        log.error(err);
-        rtn = [];
-    }
-    
-    return rtn;
-})();
-
-var getBucket = function(){
-  var rtn = null;
-  
-  try{
-      var mql = "select * from /system/bitlog where class = '"+ entity.class +"'";
-    //   log.debug(mql)
-      rtn = odb.mql(mql).data;
-      
-  }catch(err){
-      log.error(err);
-      rtn = [];
-  }
-  
-  return rtn;
-  
-};
-
-OUTPUT = { 
-            entity: [entity],
-            bucket: getBucket()
-        };

+ 0 - 28
cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/bitlog/searchBitlogByTerm.js

@@ -1,28 +0,0 @@
-var input = JSON.parse(decodeURIComponent(INPUT));
-
-var search = function(){
-    var rtn = null;
-    var mqlStr = "";
-    try{
-        
-        var compiled = _.template("SELECT <%= bucket%><%= key%>.time('<%= time%>')<%= words%><%= limit%> FROM <%= className%> where id='<%= id%>'");
-        
-        mqlStr = compiled({
-                bucket: input.field,
-                key: input.file?"['"+input.file+"']":'',
-                time: input.time.join("','"),
-                className: input.class,
-                id: input.id,
-                words: input.words.length>0?".find('"+input.words.join("','")+"')":'',
-                limit: '.limit(2000)'
-        });
-        log.debug(mqlStr)
-        rtn = {result:odb.mql(mqlStr).data[0][input.field],mql:mqlStr};
-        
-    }catch(err){
-        return {result:err,mql:mqlStr};
-    }
-    return rtn;
-}
-
-OUTPUT = search();

+ 0 - 19
cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/bitlog/searchEntityByClass.js

@@ -1,19 +0,0 @@
-var input = JSON.parse(decodeURIComponent(INPUT));
-
-var search = function(){
-    var rtn = null;
-    
-    try{
-        var mql = ["#" + input.class, "top 500"];
-        if(input.term){
-            mql = ["#" + input.class, input.term, "top 500"];
-        }
-        rtn = odb.search(mql.join(" | ")).data;
-    }catch(err){
-        rtn = [];
-    }
-    
-    return rtn;
-};
-
-OUTPUT = search();

+ 0 - 137
cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/eventListBySmartGroup.js

@@ -1,137 +0,0 @@
-var input = JSON.parse(decodeURIComponent(INPUT));
-
-// 默认视图配置
-var view = (function(){
-    try{
-        var CONFIG_PATH = "/script/cncc/meta-faulta/view/config.json";
-        return JSON.parse(dfs.read(JSON.parse(dfs.read(CONFIG_PATH)).defaultView)).datasource;
-    }catch(err){
-        return null
-    }
-})();
-
-var rows = (function(){
-    var rtn = null;
-    try{
-        var mql = "select * from "+view.class+" where id in ('" + input.join("','") + "')";
-        log.debug(mql)
-        rtn = odb.mql(mql).data;
-    }catch(err){
-        rtn = [];
-    }
-    return rtn;
-})();
-
-// 常用渲染表达式
-var render_columns = [
-    {field: "rootCause", title: "根原因", width: "80", render: `var s=function(row, column, cellValue, index){
-                try{
-                    if(cellValue == 1){
-                         var el = document.querySelector('.smartGroupEvent-row-'+index+' >.'+column.id+' > .cell');
-                         el.classList.add('el-icon-star-on','animate__animated', 'animate__flash','flash-red');
-                         el.style.color='#ff0000';
-                         el.style.fontSize='18px';
-                        return "";
-                    } else {
-                        return "";
-                    }
-                } catch(err){
-                    return "";
-                }
-            };eval(s);`},
-    {field: "severity", title: "级别", width: "80", render: `var s=function(row, column, cellValue, index){ 
-        try{ 
-            /* by row */
-            var el = document.querySelector('.smartGroupEvent-row-'+index);
-            /* by column */
-            /* var el = document.querySelector('.smartGroupEvent-row-'+index+' >.'+column.id+' > .cell');*/
-            if(row.status=='11'){
-                el.style.backgroundColor = m3.utils.adjustColor(global.register.event.severity[cellValue][2], -100);
-            }else{
-                el.style.backgroundColor = global.register.event.severity[cellValue][2];
-            }
-            el.style.color = '#ffffff';
-            el.style.textAlign = 'center';
-            return global.register.event.severity[cellValue][1]; 
-        } catch(err) { 
-            return null; 
-        }
-    };eval(s);`},
-    {field: "status", title: "状态", width: "80", render: `var s=function(row, column, cellValue, index){ try {
-                                                return global.register.event.status[cellValue][1];
-                                            } catch(err) { 
-                                                return null; 
-                                            }
-    };eval(s);`}
-];
-
-// default template
-var default_columns = 
-    [
-        {field: "rootCause", title: "根原因", width: "80", render: `var s=function(row, column, cellValue, index){
-                try{
-                    if(cellValue == 1){
-                         var el = document.querySelector('.smartGroupEvent-row-'+index+' >.'+column.id+' > .cell');
-                         el.classList.add('el-icon-star-on','animate__animated', 'animate__flash','flash-red');
-                         el.style.color='#ff0000';
-                         el.style.fontSize='18px';
-                        return "";
-                    } else {
-                        return "";
-                    }
-                } catch(err){
-                    return "";
-                }
-            };eval(s);`},
-        {field: "severity", title: "级别", width: "80", render: `var s=function(row, column, cellValue, index){ 
-            try{ 
-                /* by row */
-                var el = document.querySelector('.smartGroupEvent-row-'+index);
-                /* by column */
-                /*var el = document.querySelector('.row-'+index+' >.'+column.id+' > .cell');*/
-                el.style.backgroundColor = global.register.event.severity[cellValue][2];
-                el.style.color = '#ffffff';
-                el.style.textAlign = 'center';
-                return global.register.event.severity[cellValue][1]; 
-            } catch(err) { 
-                return null; 
-            }
-        };eval(s);`},
-        {field: "biz", title: "业务", width: "120"},
-        {field: "app", title: "系统", width: "120"},
-        {field: "ip", title: "IP地址", width: "120"},
-        {field: "tally", title: "告警次数", width: "120"},
-        {field: "host", title: "主机名", width: "120"},
-        {field: "status", title: "状态", width: "80", render: `var s=function(row, column, cellValue, index){ try {
-                                                    return global.register.event.status[cellValue][1];
-                                                } catch(err) { 
-                                                    return null; 
-                                                }
-        };eval(s);`},
-        {field: "vtime", title: "发生时间", width: "160", render: 'var s=function(row, column, cellValue, index){return moment(cellValue).format("YYYY-MM-DD HH:mm:ss");};eval(s);'},
-        {field: "msg", title: "告警内容", width: "380"},
-        {field: "during", title: "耗时", width: "80"},
-        {field: "admin", title: "管理员", width: "80"},
-        {field: "location", title: "地点", width: "80"},
-        {field: "tags", title: "标签", width: "80"},
-        {field: "entity", title: "实体", width: "180", visible:false},
-        {field: "id", title: "ID", width: "80", visible:false},
-        {field: "class", title: "类", width: "80", visible:false}
-        
-    ];
-    
-// columns
-var columns = (function(){
-    if(view){
-        // 如果用户自定义了属性
-        if(view.fields){
-            return view.fields.concat(render_columns);
-        } else {
-            return default_columns;
-        }
-    }else{
-        return default_columns;
-    }
-})();
-
-OUTPUT =  {columns:columns,rows:rows};

+ 0 - 12
cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/getBitlogList.js

@@ -1,12 +0,0 @@
-var bitlog = function(){
-    var rtn = null;
-    try{
-        var mql = "select * from /system/bitlog";
-        rtn = odb.mql(mql).data;
-    } catch(err){
-        rtn = [];
-    }
-    return rtn;
-};
-
-OUTPUT = bitlog();

+ 0 - 148
cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/history.js

@@ -1,148 +0,0 @@
-var input = decodeURIComponent(INPUT);
-
-// 默认视图配置
-var view = (function(){
-    try{
-        var CONFIG_PATH = "/script/cncc/meta-faulta/view/config.json";
-        return JSON.parse(dfs.read(JSON.parse(dfs.read(CONFIG_PATH)).defaultView)).datasource;
-    }catch(err){
-        return null
-    }
-})();
-
-var rows = (function(){
-    var rtn = null;
-    
-    try{
-        var term = [];
-        // 不能增加#,查询版本数据
-        term[0]=view.class;
-        term[1]=input.replace(/"/gi,"");
-        term[2]="top 5000";
-        var mql = _.compact(term).join(" | ");
-        log.debug(mql)
-        rtn = odb.search(mql).data;
-    }catch(err){
-        rtn = [];
-    }
-    return rtn;
-})();
-
-
-// 常用渲染表达式
-var render_columns = [
-    {field: "rootCause", title: "根原因", width: "80", render: `var s=function(row, column, cellValue, index){
-                try{
-                    if(cellValue == 1){
-                         var el = document.querySelector('.historySameEvent-row-'+index+' >.'+column.id+' > .cell');
-                         el.classList.add('el-icon-star-on','animate__animated', 'animate__flash','flash-red');
-                         el.style.color='#ff0000';
-                         el.style.fontSize='18px';
-                        return "";
-                    } else {
-                        return "";
-                    }
-                } catch(err){
-                    return "";
-                }
-            };eval(s);`},
-    {field: "severity", title: "级别", width: "80", render: `var s=function(row, column, cellValue, index){ 
-        try{ 
-            /* by row */
-            var el = document.querySelector('.historySameEvent-row-'+index);
-            /* by column */
-            /* var el = document.querySelector('.historySameEvent-row-'+index+' >.'+column.id+' > .cell');*/
-            if(row.status=='11'){
-                el.style.backgroundColor = m3.utils.adjustColor(global.register.event.severity[cellValue][2], -100);
-            }else{
-                el.style.backgroundColor = global.register.event.severity[cellValue][2];
-            }
-            el.style.color = '#ffffff';
-            el.style.textAlign = 'center';
-            return global.register.event.severity[cellValue][1]; 
-        } catch(err) { 
-            return null; 
-        }
-    };eval(s);`},
-    {field: "status", title: "状态", width: "80", render: `var s=function(row, column, cellValue, index){ try {
-                                                return global.register.event.status[cellValue][1];
-                                            } catch(err) { 
-                                                return null; 
-                                            }
-    };eval(s);`}
-];
-
-// default template
-var default_columns = 
-    [
-        {field: "rootCause", title: "根原因", width: "80", render: `var s=function(row, column, cellValue, index){
-                try{
-                    if(cellValue == 1){
-                         var el = document.querySelector('.historySameEvent-row-'+index+' >.'+column.id+' > .cell');
-                         el.classList.add('el-icon-star-on','animate__animated', 'animate__flash','flash-red');
-                         el.style.color='#ff0000';
-                         el.style.fontSize='18px';
-                        return "";
-                    } else {
-                        return "";
-                    }
-                } catch(err){
-                    return "";
-                }
-            };eval(s);`},
-        {field: "severity", title: "级别", width: "80", render: `var s=function(row, column, cellValue, index){ 
-            try{ 
-                /* by row */
-                var el = document.querySelector('.historySameEvent-row-'+index);
-                /* by column */
-                /*var el = document.querySelector('.historySameEvent-row-'+index+' >.'+column.id+' > .cell');*/
-                el.style.backgroundColor = global.register.event.severity[cellValue][2];
-                el.style.color = '#ffffff';
-                el.style.textAlign = 'center';
-                return global.register.event.severity[cellValue][1]; 
-            } catch(err) { 
-                return null; 
-            }
-        };eval(s);`},
-        {field: "biz", title: "业务", width: "120"},
-        {field: "app", title: "系统", width: "120"},
-        {field: "ip", title: "IP地址", width: "120"},
-        {field: "tally", title: "告警次数", width: "120"},
-        {field: "host", title: "主机名", width: "120"},
-        {field: "status", title: "状态", width: "80", render: `var s=function(row, column, cellValue, index){ try {
-                                                    return global.register.event.status[cellValue][1];
-                                                } catch(err) { 
-                                                    return null; 
-                                                }
-        };eval(s);`},
-        {field: "vtime", title: "发生时间", width: "160", render: 'var s=function(row, column, cellValue, index){return moment(cellValue).format("YYYY-MM-DD HH:mm:ss");};eval(s);'},
-        {field: "msg", title: "告警内容", width: "380"},
-        {field: "during", title: "耗时", width: "80"},
-        {field: "admin", title: "管理员", width: "80"},
-        {field: "location", title: "地点", width: "80"},
-        {field: "tags", title: "标签", width: "80"},
-        {field: "entity", title: "实体", width: "180", visible:false},
-        {field: "id", title: "ID", width: "80", visible:false},
-        {field: "class", title: "类", width: "80", visible:false}
-        
-    ];
-    
-// columns
-var columns = (function(){
-    if(view){
-        // 如果用户自定义了属性
-        if(view.fields){
-            return view.fields.concat(render_columns);
-        } else {
-            return default_columns;
-        }
-    }else{
-        return default_columns;
-    }
-})();
-
-var summary = {all: rows.length, groupbBySeverity:null};
-
-OUTPUT =  {columns:columns,rows:rows, summary:summary};
-
-

+ 0 - 16
cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/journal.js

@@ -1,16 +0,0 @@
-var input = JSON.parse(decodeURIComponent(INPUT));
-
-var journal = function(){
-    var rtn = null;
-    try{
-        var mql = "select * from /matrix/ where id='"+input.id+"'  order by vtime desc with version limit 100";
-        var tmp = odb.mql(mql).data;
-        rtn = tmp;
-    }catch(err){
-        rtn = null;
-    }
-    
-    return rtn;
-};
-
-OUTPUT = journal();

+ 0 - 27
cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/searchBitlogByTerm.js

@@ -1,27 +0,0 @@
-var input = JSON.parse(decodeURIComponent(INPUT));
-
-var search = function(){
-    var rtn = null;
-    var mqlStr = "";
-    try{
-        
-        var compiled = _.template("SELECT <%= bucket%><%= key%>.time('<%= time%>')<%= words%> FROM <%= className%> where id='<%= id%>'");
-        
-        mqlStr = compiled({
-                bucket: input.field,
-                key: input.file?"['"+input.file+"']":'',
-                time: input.time.join("','"),
-                className: input.class,
-                id: input.id,
-                words: input.words.length>0?".find('"+input.words.join("','")+"')":''
-        });
-        
-        rtn = {result:odb.mql(mqlStr).data[0][input.field],mql:mqlStr};
-        
-    }catch(err){
-        return {result:err,mql:mqlStr};
-    }
-    return rtn;
-}
-
-OUTPUT = search();

+ 0 - 19
cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/searchEntityByClass.js

@@ -1,19 +0,0 @@
-var input = JSON.parse(decodeURIComponent(INPUT));
-
-var search = function(){
-    var rtn = null;
-    
-    try{
-        var mql = ["#" + input.class, "top 500"];
-        if(input.term){
-            mql = ["#" + input.class, input.term, "top 500"];
-        }
-        rtn = odb.search(mql.join(" | ")).data;
-    }catch(err){
-        rtn = [];
-    }
-    
-    return rtn;
-};
-
-OUTPUT = search();

+ 0 - 89
cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/smartGroup.js

@@ -1,89 +0,0 @@
-var input = JSON.parse(decodeURIComponent(INPUT));
-
-// 默认视图配置
-var view = (function(){
-    try{
-        var CONFIG_PATH = "/script/cncc/meta-faulta/view/config.json";
-        return JSON.parse(dfs.read(JSON.parse(dfs.read(CONFIG_PATH)).defaultView)).datasource;
-    }catch(err){
-        log.error(err)
-        return null
-    }
-})();
-
-// 获取事件列表
-var eventListByGroup = (function(){
-    var rtn = null;
-    try {
-        var mqlStr = "#"+view.class+" | " + input.join(";") + " | entity!=null | status<12 | print id, biz, severity, entity | group  with topo | top 1000";
-        log.debug(mqlStr)
-        rtn = odb.search(mqlStr).data[0];
-    }catch(err){
-        log.error(err)
-    }
-    return rtn;
-})();
-
-
-// rows
-var rows = _.sortBy(_.map(eventListByGroup,function(v,k){
-    
-    var s5 = _.filter(v,function(v){
-        if(v.severity >= 5){
-            return v;
-        }
-    }).length;
-    var s4 =  _.where(v,{severity:4}).length;
-    var s3 =  v.length - s5 - s4;
-    return { 
-                type: 1, 
-                group: Number(k) < 10 ? '分组0'+k : '分组'+k, 
-                app: _.uniq(_.chain(v).where('biz').map('biz').value()).join(" "), 
-                severity: [s5,s4,s3], 
-                ids: _.chain(v).where('id').map('id').value().join(";"),
-                list: v
-    };
-        
-}),'group');
-
-// datatable列名
-var columns = [
-                {field:'type',title:'类型', width:'80', render: `var s=function(row, column, cellValue, index){
-                            return cellValue==1?'自动分组':'手动分组';
-                        };eval(s);`,visible: false},
-                {field:'group',title:'分组名称',width:'120'},
-                {field:'app',title:'影响应用系统', width:'140'},
-                {field:'severity',title:'告警级别统计', width:'120', render:`var s = function(row, column, cellValue, index){
-                    return '<a href="javascript:void(0);" class="btn btn-link" style="width:30px;padding: 2px 4px;background:'+global.register.event.severity[5][2]+'">'+cellValue[0]+'</a>
-                        <a href="javascript:void(0);" class="btn btn-link" style="width:30px;padding: 2px 4px;background:'+global.register.event.severity[4][2]+'">'+cellValue[1]+'</a>
-                        <a href="javascript:void(0);" class="btn btn-link" style="width:30px;padding: 2px 4px;background:'+global.register.event.severity[3][2]+'">'+cellValue[2]+'</a>';};eval(s);`
-                },
-                {field:'ids',title:'IDS', width:'80', visible: false}
-        ];
-
-
-var template = [
-                {field:'type',title:'类型', width:'80', render: `var s=function(row, column, cellValue, index){
-                             return cellValue==1?'自动分组':'手动分组';
-                        };eval(s);`,visible: false},
-                {field:'group',title:'分组名称',width:'120'},
-                {field:'app',title:'影响应用系统', width:'140'},
-                {field:'severity',title:'告警级别统计', width:'120', render:`var s = function(row, column, cellValue, index){
-                    return '<a href="javascript:void(0);" class="btn btn-link" style="width:30px;padding: 2px 4px;background:'+global.register.event.severity[5][2]+'">'+cellValue[0]+'</a>
-                        <a href="javascript:void(0);" class="btn btn-link" style="width:30px;padding: 2px 4px;background:'+global.register.event.severity[4][2]+'">'+cellValue[1]+'</a>
-                        <a href="javascript:void(0);" class="btn btn-link" style="width:30px;padding: 2px 4px;background:'+global.register.event.severity[3][2]+'">'+cellValue[2]+'</a>';};eval(s);`
-                },
-                {field:'ids',title:'IDS', width:'80', visible: false}
-    ];
-
-
-var summary = {all: rows.length, groupbBySeverity:null};
-
-var rtn = {
-    rows: rows,
-    columns: columns,
-    template: template,
-    summary:summary
-};
-
-OUTPUT = rtn;

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 4
cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/test.js


+ 0 - 39
cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/tsdb/getBucketByEntity.js

@@ -1,39 +0,0 @@
-var input = decodeURIComponent(INPUT);
-
-var entity = (function(){
-    var rtn = null;
-    
-    try{
-        var mql = "select * from /matrix/entity/ where id='"+ input +"'";
-        log.debug(mql)
-        rtn = odb.mql(mql).data[0];
-        
-    }catch(err){
-        log.error(err);
-        rtn = [];
-    }
-    
-    return rtn;
-})();
-
-var getBucket = function(){
-  var rtn = null;
-  
-  try{
-      var mql = "select * from /system/tsdb where class = '"+ entity.class +"'";
-      log.debug(mql)
-      rtn = odb.mql(mql).data;
-      
-  }catch(err){
-      log.error(err);
-      rtn = [];
-  }
-  
-  return rtn;
-  
-};
-
-OUTPUT = { 
-            entity: [entity],
-            bucket: getBucket()
-        };

+ 0 - 11
cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/tsdb/getClassNameById.js

@@ -1,11 +0,0 @@
-var input = decodeURIComponent(INPUT);
-
-var getClassName = function(){
-    try{
-        return odb.mql("select class('"+input+"') from /").data[0].class;
-    } catch(err){
-        return null
-    }
-}
-
-OUTPUT = getClassName();

+ 0 - 65
cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/tsdb/getClassNumberStringKeysByClassName.js

@@ -1,65 +0,0 @@
-var input = JSON.parse(decodeURIComponent(INPUT));
-
-// 查出指定类的bucket属性
-var classKeysList = function(){
-    try{
-        var rtn = _.filter(_.map(odb.classfields(input.class),function(v){
-            // 获取bucket属性
-            //  && !v.Name.match(/_baseline/)
-            if(v.Btype == 'tsdb' && v.Name && v.Ftype == 'bucket'){
-                
-                var subKeys = [];
-                var subKeysMql = "";
-                // 获取子对象
-                // 根据index查看是否有crc定义
-                var item = v.Params[v['CRC']];
-                if(!_.isEmpty(item)){
-                    // 子对象
-                    subKeys = getSubObj(v.Name, item.Name).result;
-                    // debug用
-                    subKeysMql = getSubObj(v.Name, item.Name).mql;
-                }
-                
-                var params = _.filter(_.map(v.Params,function(val,idx){
-                    if(val.Type != 'string'){
-                        return {value: val.Name, label:val.Name, ftype:val.Type, unit: val.Unit?val.Unit:"" };
-                    }
-                    
-                }),null);
-                
-                return {value: v.Name, label: v.Name, ftype: v.Ftype, children:params, subKeys: subKeys, trace: subKeysMql};
-            }
-        }),null);
-        return rtn;
-    } catch(err){
-        return err;
-    }
-};
-
-
-// 获取子对象
-// meta中定义的crc,指定了哪个bucket属性有子对象
-// SELECT id,disk1_perf[1].time('2020-06-01','').distinct() FROM /matrix/entity/it/it_aix where id='it_aix:192.168.190.175'
-var getSubObj  = function(bucket,bucketKey){
-    
-    var mql = "";
-    
-    try{
-        // 当月
-        var current_month = new Date().toISOString().slice(0, 7);
-        
-        mql = "SELECT "+bucket+"['"+bucketKey+"'].time('"+current_month+"','').distinct() FROM "+input.class+" where id='"+input.entity+"'";
-        
-        var rtn = _.map(_.flatten(odb.mql(mql).data[0][bucket]),function(v){
-            return  {name:v, value: bucketKey+"='"+v+"'"};
-        });
-        
-        return {result:rtn, mql:mql};
-        
-    } catch(err){
-        return {result:[], mql:mql};;
-    }
-    
-}
-
-OUTPUT = classKeysList();

+ 0 - 12
cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/tsdb/getTsdbList.js

@@ -1,12 +0,0 @@
-var tsdb = function(){
-    var rtn = null;
-    try{
-        var mql = "select * from /system/tsdb";
-        rtn = odb.mql(mql).data;
-    } catch(err){
-        rtn = [];
-    }
-    return rtn;
-};
-
-OUTPUT = tsdb();

+ 0 - 19
cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/tsdb/searchEntityByClass.js

@@ -1,19 +0,0 @@
-var input = JSON.parse(decodeURIComponent(INPUT));
-
-var search = function(){
-    var rtn = null;
-    
-    try{
-        var mql = ["#" + input.class, "top 500"];
-        if(input.term){
-            mql = ["#" + input.class, input.term, "top 500"];
-        }
-        rtn = odb.search(mql.join(" | ")).data;
-    }catch(err){
-        rtn = [];
-    }
-    
-    return rtn;
-};
-
-OUTPUT = search();

+ 0 - 42
cncc_serverjs/script/cncc/应用/meta-faulta/diagnosis/tsdb/searchPerformanceByTerm.js

@@ -1,42 +0,0 @@
-var input = JSON.parse(decodeURIComponent(INPUT));
-
-var search = function(){
-    var rtn = null;
-    var mqlStr = "";
-    try{
-        
-        // 有子对象
-        if(input.defaultSubKey){
-            var compiled = _.template("SELECT <%= bucket%>['<%= key%>'].time('<%= time%>').find(<%= defaultSubKey%>) FROM <%= className%> where id='<%= id%>'");
-        
-            mqlStr = compiled({
-                    bucket: input.bucket,
-                    key: input.key,
-                    time: input.time.join("','"),
-                    className: input.class,
-                    id: input.id,
-                    defaultSubKey: input.defaultSubKey
-            }); 
-        } 
-        // 没有子对象
-        else{
-            var compiled = _.template("SELECT <%= bucket%>['<%= key%>'].time('<%= time%>') FROM <%= className%> where id='<%= id%>'");
-        
-            mqlStr = compiled({
-                    bucket: input.bucket,
-                    key: input.key,
-                    time: input.time.join("','"),
-                    className: input.class,
-                    id: input.id
-            });
-        }
-        
-        
-        rtn = {result:odb.mql(mqlStr).data[0][input.bucket],mql:mqlStr};
-    }catch(err){
-        return {result:err,mql:mqlStr};
-    }
-    return rtn;
-}
-
-OUTPUT = search();

+ 0 - 303
cncc_serverjs/script/cncc/应用/meta-faulta/event_list.js

@@ -1,303 +0,0 @@
-
-var input = JSON.parse(decodeURIComponent(INPUT));
-
-var TEMPLATE_PATH = "/script/cncc/meta-faulta/view/template/"
-var TRACE = "";
-// 是否启用root cause
-var ROOT_CAUSE=false;
-
-// 获取视图配置
-var view = (function(){
-    var rtn = null;
-    try{
-        return JSON.parse(dfs.read(TEMPLATE_PATH + input.view + ".json"));
-    }catch(err){
-        log.error(err);
-        return null;
-    }
-})();
-
-// 事件统计
-var summary = (function(){
-    try {
-        var term = [];
-        var param = [];
-        
-        if(view.datasource.class) {
-            term[0]="#"+view.datasource.class;
-        }
-        
-        if(view.datasource.filter) {
-            term.push(view.datasource.filter);
-        }
-        
-        if(view.datasource.top) {
-            term.push("top " + view.datasource.top);
-        }
-        
-        term.push(" print id, severity");
-        
-        var tmp = _.compact(term).join(" | ");
-        
-        tmp.split("|").forEach(function(v,idx){
-            if(v.indexOf("top") > -1){
-                param[10]=v;
-            } else {
-                param[idx]=v;
-            }
-        })
-        
-        var summaryStr = _.compact(param).join(" | ");
-        var summary = {all:0, groupBySeverity:{}};
-        
-        log.info(summaryStr);
-        var result = odb.search(summaryStr).data || [];
-        
-        // All
-        summary.all = result.length;
-        
-        // Group by Severity
-        _.forEach(_.groupBy(result,'severity'),function(v,k){
-            var o = {};
-            o[k] = v.length;
-            _.extend(summary.groupBySeverity, o);
-            return o;
-        });
-        
-        return summary;
-        ;
-    }catch(err){
-        log.error(err);
-        return null;
-    }
-})();
-
-// 获取事件列表
-var eventList = (function(){
-    try {
-        var term = [];
-        var param = [];
-        
-        if(view.datasource.class) {
-            term[0]="#"+view.datasource.class;
-        }
-        
-        if(view.datasource.filter) {
-            term.push(view.datasource.filter);
-        }
-        
-        if(view.datasource.top) {
-            term.push("top " + view.datasource.top);
-        }
-        
-        if(!_.isEmpty(term)){
-            term.push(input.term);
-        }
-        
-        // var fields = " print entity,vtime,status,severity, " + _.map(view.datasource.fields,'field').join(", ");
-        // log.info(2,fields)
-        // term.push(fields);
-        
-        
-        var tmp = _.compact(term).join(" | ");
-        
-        tmp.split("|").forEach(function(v,idx){
-            if(v.indexOf("top") > -1){
-                param[10]=v;
-            } else {
-                param[idx]=v;
-            }
-        })
-        
-        var termStr = _.compact(param).join(" | ");
-        
-        TRACE = termStr;
-        
-        return odb.search(termStr);     
-    }catch(err){
-        log.error(err);
-        return null;
-    }
-})();
-
-// 根原因查找实例
-var rootCauseList = (function(){
-    
-    if(!ROOT_CAUSE) return false;
-    
-    try {
-        var currentAlerts = odb.mql("select distinct entity from " + view.datasource.class + " where severity>3 limit -1").data;
-        var entityIDs = "";
-        _.forEach(currentAlerts,function(v){
-            entityIDs=entityIDs+"'"+ v.entity + "',"
-        })
-                
-        var reg=/,$/gi;
-        
-        var content = graphalg.endpoints("match (" + entityIDs.replace(reg,"") + ")-[*]->(" + entityIDs.replace(reg,"") + ")");
-        
-        return content;
-    } catch(err){
-        return null;
-    }
-    
-})();
-
-// rows
-var rows = (function(){
-    
-    if(_.isEmpty(eventList)) return [];
-    
-    try{
-         if(ROOT_CAUSE){
-            return _.sortBy(_.map(eventList.data,function(v){
-                    return _.extend(v, {rootCause: (_.include(rootCauseList,v.entity) && v.severity > 3)?1:0} );
-                }), function(v){
-                return v.rootCause * -1;
-            }); 
-        } else {
-            return  _.sortBy(eventList.data,function(v){
-                    return v.rootCause * -1;
-                });
-        }
-    } catch(err){
-        return _.sortBy(eventList.data,function(v){
-                    return v.rootCause * -1;
-                });
-    }
-    
-})();
-
-// 常用渲染表达式
-var render_columns = [
-    {field: "rootCause", title: "根原因", width: "80", render: `var s=function(row, column, cellValue, index){
-                try{
-                    if(cellValue == 1){
-                         var el = document.querySelector('.event-console-row-'+index+' >.'+column.id+' > .cell');
-                         el.classList.add('el-icon-star-on','animate__animated', 'animate__flash','flash-red');
-                         el.style.color='#ff0000';
-                         el.style.fontSize='18px';
-                        return "";
-                    } else {
-                        return "";
-                    }
-                } catch(err){
-                    return "";
-                }
-            };eval(s);`},
-    {field: "severity", title: "级别", width: "80", render: `var s=function(row, column, cellValue, index){ 
-        try{ 
-            /* by row */
-            var el = document.querySelector('.event-console-row-'+index);
-            /* by column */
-            /* var el = document.querySelector('.event-console-row-'+index+' >.'+column.id+' > .cell');*/
-            if(row.status==11){
-                el.style.backgroundColor = m3.utils.adjustColor(global.register.event.severity[cellValue][2], -100);
-            }else{
-                el.style.backgroundColor = global.register.event.severity[cellValue][2];
-            }
-            
-            el.style.color = m3.utils.adjustColor(global.register.event.severity[cellValue][2], 1000);;
-            el.style.textAlign = 'center';
-            return global.register.event.severity[cellValue][1]; 
-        } catch(err) {
-            return null; 
-        }
-    };eval(s);`},
-    {field: "status", title: "状态", width: "80", render: `var s=function(row, column, cellValue, index){ try {
-                                                return global.register.event.status[cellValue][1];
-                                            } catch(err) { 
-                                                return null; 
-                                            }
-    };eval(s);`}
-];
-
-// default template
-var default_columns = 
-    [
-        {field: "rootCause", title: "根原因", width: "80", render: `var s=function(row, column, cellValue, index){
-                try{
-                    if(cellValue == 1){
-                         var el = document.querySelector('.event-console-row-'+index+' >.'+column.id+' > .cell');
-                         el.classList.add('el-icon-star-on','animate__animated', 'animate__flash','flash-red');
-                         el.style.color='#ff0000';
-                         el.style.fontSize='18px';
-                        return "";
-                    } else {
-                        return "";
-                    }
-                } catch(err){
-                    return "";
-                }
-            };eval(s);`},
-        {field: "severity", title: "级别", width: "80", render: `var s=function(row, column, cellValue, index){ 
-            try{ 
-                /* by row */
-                var el = document.querySelector('.event-console-row-'+index);
-                /* by column */
-                /* var el = document.querySelector('.event-console-row-'+index+' >.'+column.id+' > .cell');*/
-                el.style.backgroundColor = global.register.event.severity[cellValue][2];
-                el.style.color = '#ffffff';
-                el.style.textAlign = 'center';
-                return global.register.event.severity[cellValue][1]; 
-            } catch(err) { 
-                return null; 
-            }
-        };eval(s);`},
-        {field: "biz", title: "业务", width: "120"},
-        {field: "app", title: "系统", width: "120"},
-        {field: "ip", title: "IP地址", width: "120"},
-        {field: "tally", title: "告警次数", width: "120"},
-        {field: "host", title: "主机名", width: "120"},
-        {field: "status", title: "状态", width: "80", render: `var s=function(row, column, cellValue, index){ try {
-                                                    return global.register.event.status[cellValue][1];
-                                                } catch(err) { 
-                                                    return null; 
-                                                }
-        };eval(s);`},
-        {field: "vtime", title: "发生时间", width: "160", render: 'var s=function(row, column, cellValue, index){return moment(cellValue).format("YYYY-MM-DD HH:mm:ss");};eval(s);'},
-        {field: "msg", title: "告警内容", width: "380"},
-        {field: "during", title: "耗时", width: "80"},
-        {field: "admin", title: "管理员", width: "80"},
-        {field: "location", title: "地点", width: "80"},
-        {field: "tags", title: "标签", width: "180"},
-        {field: "entity", title: "实体", width: "180", visible:false},
-        {field: "id", title: "ID", width: "80", visible:false},
-        {field: "class", title: "类", width: "80", visible:false}
-        
-    ];
-    
-// columns
-var columns = (function(){
-    if(eventList && view.datasource){
-        // 如果用户自定义了属性
-        if(view.datasource.fields){
-            return _.map(view.datasource.fields,function(v){
-                var p = _.find(render_columns,{field:v.field});
-                if(p){
-                    return _.extend(v,p);
-                }else{
-                    return v;
-                }
-            });
-        } else {
-            if(view.datasource.class){
-                return eventList.meta.columns[view.datasource.class];   
-            }
-        }
-    }else{
-        return default_columns;
-    }
-})();
-
-var notify = (function(){
-    return summary.groupBySeverity[3] + summary.groupBySeverity[4] + summary.groupBySeverity[5];
-})();
-    
-OUTPUT = {
-            rows: rows,
-            columns: columns,
-            summary: summary,
-            notify: notify,
-            trace: TRACE
-        };

+ 0 - 3
cncc_serverjs/script/cncc/应用/meta-faulta/graph/config.json

@@ -1,3 +0,0 @@
-{
-    "match": "match ('<%= ids %>') union ('<%= ids %>') <-[*1]-() union () <- [*1] - ('<%= ids %>')"
-}

+ 0 - 15
cncc_serverjs/script/cncc/应用/meta-faulta/job/deleteEvent.js

@@ -1,15 +0,0 @@
-var deleteclosed = function(){
-    var rtn = null;
-    try{
-        var mql = "delete from /matrix/devops/ where status = 12";
-        log.info(mql)
-        rtn = odb.mql(mql);
-    }catch(err){
-        log.error(err);
-        rtn = null;
-    }
-    log.info(rtn);
-    return rtn;
-};
-
-OUTPUT = deleteclosed();

+ 0 - 88
cncc_serverjs/script/cncc/应用/meta-faulta/job/job_list.js

@@ -1,88 +0,0 @@
-var input = JSON.parse(decodeURIComponent(INPUT));
-
-var mqlStr = "";
-var s = function(param){
-    try{
-        // 过滤删除状态
-        mqlStr = param + " | status < 9 |  facet status as status_状态维度, class as class_类维度, tags as tags_标签维度,vtime as vtime_时间维度";
-        // log.info(mqlStr)
-        return odb.search(mqlStr);  
-    } catch(err){
-        log.error(err);
-        return null;
-    }
-};
-
-var message = s(input.term);
-
-// datatable数据 搜索返回多个子类,前端按root class类显示
-var rows = message.data;
-
-// datatable列名
-var columns = message.meta;
-// 供前端选择类显示
-var classes = message.meta.classes;
-
-// 默认显示root class类
-var rootClass = message.meta.rootclass
-
-var template = [
-        {field: "status", title: "状态", width: 90, render:`var s=function(row,column,cellValue,index){ 
-                try{ 
-                /* by row */
-                var el = document.querySelector('#pane-jobView .row-'+index);
-                /* by column */
-                /* var el = document.querySelector('.row-'+index+' >.'+column.id+' > .cell');*/
-                el.style.backgroundColor = global.register.jobs.status[cellValue][2];
-                el.style.color = '#ffffff';
-                el.style.textAlign = 'center';
-                return global.register.jobs.status[cellValue][1]; 
-                
-            } catch(err) { 
-                return null; 
-            }
-        };eval(s);`},
-        {field: "name", title: "作业名称", width:160},
-        {field: "dir", title: "目录", width:260},
-        {field: "type", title: "类型", width:90,render:`var s=function(row,column,cellValue,index){ 
-                try{ 
-                var el = document.querySelector('#pane-jobView .row-'+index);
-                el.style.textAlign = 'center';
-                return global.register.jobs.type[cellValue][1]; 
-            } catch(err) { 
-                return null; 
-            }
-        };eval(s);`},
-        {field: "stime", title: "开始时间", width:160, render: 'var s=function(row,column,cellValue,index){return moment(cellValue).format("YYYY-MM-DD HH:mm:ss.sss");};eval(s);'},
-        {field: "etime", title: "结束时间", width:160, render: 'var s=function(row,column,cellValue,index){return moment(cellValue).format("YYYY-MM-DD HH:mm:ss.sss");};eval(s);'},
-        {field: "utime", title: "耗时", width:160, render: `var s=function(row,column,cellValue,index){
-            var timeDiff = moment(row.etime).diff(moment(row.stime), "millisecond");
-            if(timeDiff > 1000){
-                return moment(row.etime).diff(moment(row.stime), "seconds") + ' 秒';    
-            } else {
-                return timeDiff + ' 毫秒';    
-            }
-        };eval(s);`},
-        {field: "cmds", title: "命令", width:80},
-        {field: "runid", title: "RUNID", width:260},
-        {field: "sid", title: "SID", width:260},
-        {field: "author", title: "管理员"},
-        {field: "vtime", title: "发生时间", width:160, render: 'var s=function(row,column,cellValue,index){return moment(cellValue).format("YYYY-MM-DD HH:MM:SS");};eval(s);'},
-        {field: "tags", title: "标签"},
-        {field: "id", title: "ID",visible:false},
-        {field: "day", title: "DAY",visible:false},
-        {field: "class", title: "类",visible:false}
-        
-];
-
-var rtn = {
-    rows: rows,
-    columns: columns,
-    classes: classes,
-    rootClass: '/matrix/jobs/jobrun',
-    template: template,
-    meta: message.meta,
-    trace: mqlStr
-};
-
-OUTPUT = rtn;

+ 0 - 14
cncc_serverjs/script/cncc/应用/meta-faulta/message/getMessage.js

@@ -1,14 +0,0 @@
-var getMessage = function(){
-    var rtn = null;
-    
-    try{
-        var mql = "select * from  /matrix/system/operationlog order by vtime desc limit 30";
-        rtn = odb.mql(mql).data;
-    } catch(err){
-        rtn = [];
-    }
-    
-    return rtn;
-};
-
-OUTPUT = getMessage();

+ 0 - 3
cncc_serverjs/script/cncc/应用/meta-faulta/notify/config.json

@@ -1,3 +0,0 @@
-{
-  "voice": "/assets/audio/notification.mp3"
-}

+ 0 - 80
cncc_serverjs/script/cncc/应用/meta-faulta/notify/getLogList.js

@@ -1,80 +0,0 @@
-//var input = INPUT;
-
-var voiceList = function(){
-    var rtn = null;
-    try{
-        rtn = odb.mql("SELECT class,content,day,id,name,objectid,rule,sendstatus,sendtime,status,tags,vtime FROM /matrix/notification/log order by sendtime desc limit -1").data;
-    } catch(err){
-        log.error(err);
-        rtn = [];
-    }
-    return rtn;
-};
-
-var columns = [
-				{
-					field: "id",
-					title: "ID",
-					width: 120,
-					visible:false
-				},
-				{
-					field: "class",
-					title: "CLASS",
-					width: 120,
-					visible:false
-				},
-				{
-					field: "sendstatus",
-					title: "状态",
-					width: 160,
-					visible: true
-				},
-				{
-					field: "objectid",
-					title: "事件ID",
-					width: 160,
-					visible: true
-				},
-				{
-					field: "rule",
-					title: "规则名称",
-					visible: true
-				},
-				{
-					field: "rule",
-					title: "接收人",
-					width: 160,
-					visible: true
-				},
-				{
-					field: "rule",
-					title: "接收人电话",
-					width: 160,
-					visible: true
-				},
-				{
-					field: "rule",
-					title: "接收人邮件",
-					width: 160,
-					visible: true
-				},
-				{
-					field: "rule",
-					title: "引用模板",
-					width: 160,
-					visible: true
-				},
-				{
-					field: "sendtime",
-					title: "发送时间",
-					width: 160,
-					visible: true,
-					render: `var s=function(row, column, cellValue, index){
-					    return moment(cellValue).format("YYYY-MM-DD HH:mm:ss");};eval(s);`
-				}];
-
-OUTPUT = {
-            rows: voiceList(),
-            columns:columns
-        };

+ 0 - 0
cncc_serverjs/script/cncc/应用/meta-faulta/notify/getRuleList.js


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است