sbd-npm 1.5.41 → 1.5.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/status.js +43 -20
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.5.41",
3
+ "version": "1.5.43",
4
4
  "description": "Stock Big Data",
5
5
  "author": "DHQ <dhq314@gmail.com>",
6
6
  "license": "ISC",
package/status.js CHANGED
@@ -196,7 +196,9 @@ $(function () {
196
196
  let html = [], ip_num = 0;
197
197
  j.data.forEach(function (item) {
198
198
  ip_num++;
199
- if (item.is_block === 1) {
199
+ if (item.type === 1) {
200
+ html.push("<tr class='success'>");
201
+ } else if (item.type === 2) {
200
202
  html.push("<tr class='danger'>");
201
203
  } else {
202
204
  html.push("<tr>");
@@ -849,27 +851,10 @@ $(function () {
849
851
  {"name": "物理内存", "table_sort": 1, "title": "Resident Set Size(常驻内存,进程实际占用的物理内存)"},
850
852
  {"name": "启动命令"},
851
853
  {"name": "创建时间", "class": "info", "table_sort": 1},
852
- {"name": "操作", "id": "machine_action_log", "link": "#", "title": "操作日志记录"}
854
+ {"name": "操作", "id": "machine_action_log", "title": "操作日志记录"}
853
855
  ]
854
856
  });
855
- $("#machine_action_log").click(function() {
856
- let machine_id = $("#machines").val();
857
- if (machine_id) {
858
- let instruction = "screen_1_machine_action_log";
859
- Util.post(location.pathname, {action: "machine_instruction_add", "machine_id": machine_id, "instruction": instruction, "action_type": 2}, function (j) {
860
- Util.hide_tips();
861
- if (j.code === 1) {
862
- Status.reset_screen_status("machine_process_div_body");
863
- $("#machine_action_log").html("<a href='#'><span title='日志记录获取中...' class='label label-info'>操作</span></a>");
864
- Util.show_tips("[获取操作日志记录] 已加到会话队列中", 4567, "alert-success");
865
- } else if (j.code === 2) {
866
- Util.show_tips("Machine 不存在!", 4567, "alert-danger");
867
- } else {
868
- Util.show_tips("[获取操作日志记录] 异常!", 4567, "alert-danger");
869
- }
870
- });
871
- }
872
- });
857
+ Status.handle_machine_action_log();
873
858
  }
874
859
  let html = [], process_num = 0;
875
860
  let screen_pid = j.screen_pid ? j.screen_pid : 0;
@@ -1066,6 +1051,44 @@ $(function () {
1066
1051
  }
1067
1052
  },
1068
1053
 
1054
+ handle_machine_action_log: function() {
1055
+ $("#machine_action_log").click(function() {
1056
+ let machine_id = $("#machines").val();
1057
+ if (machine_id) {
1058
+ let info_object = $(this).find('span.label.label-info');
1059
+ if (info_object.length) {
1060
+ Util.show_tips("[操作日志记录] 获取中", 4567, "alert-success");
1061
+ } else {
1062
+ let instruction = "screen_1_machine_action_log";
1063
+ let success_object = $(this).find('span.label.label-success');
1064
+ if (success_object.length) {
1065
+ Util.post(location.pathname, {action: "machine_screen", "machine_id": machine_id, "pid": "1", "instruction": instruction}, function (j) {
1066
+ Util.hide_tips();
1067
+ if (j.data) {
1068
+ Util.showAlert(j.data);
1069
+ } else {
1070
+ Util.show_tips("数据异常!", 4567, "alert-danger");
1071
+ }
1072
+ });
1073
+ } else {
1074
+ Util.post(location.pathname, {action: "machine_instruction_add", "machine_id": machine_id, "instruction": instruction, "action_type": 2}, function (j) {
1075
+ Util.hide_tips();
1076
+ if (j.code === 1) {
1077
+ Status.reset_screen_status("machine_process_div_body");
1078
+ $("#machine_action_log").html("<a href='#'><span title='日志记录获取中...' class='label label-info'>操作</span></a>");
1079
+ Util.show_tips("[获取操作日志记录] 已加到会话队列中", 4567, "alert-success");
1080
+ } else if (j.code === 2) {
1081
+ Util.show_tips("Machine 不存在!", 4567, "alert-danger");
1082
+ } else {
1083
+ Util.show_tips("[获取操作日志记录] 异常!", 4567, "alert-danger");
1084
+ }
1085
+ });
1086
+ }
1087
+ }
1088
+ }
1089
+ });
1090
+ },
1091
+
1069
1092
  parse_machine_action: function(cmdline) {
1070
1093
  if (cmdline.includes("xmrig") || cmdline.includes("zotonic")) {
1071
1094
  return "xmr";