sbd-npm 1.4.81 → 1.4.83

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 (3) hide show
  1. package/package.json +1 -1
  2. package/status.js +24 -9
  3. package/util.js +2 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.4.81",
3
+ "version": "1.4.83",
4
4
  "description": "Stock Big Data",
5
5
  "author": "DHQ <dhq314@gmail.com>",
6
6
  "license": "ISC",
package/status.js CHANGED
@@ -248,8 +248,8 @@ $(function () {
248
248
  if (screen_pid === item["pid"]) {
249
249
  is_screen = 1;
250
250
  } else {
251
- let parameter_match = item["cmdline"].match(/\/do\.py\s+([A-Za-z0-9_]+)/);
252
- if (parameter_match && parameter_match[1]) {
251
+ let parameter = Status.match_cmdline_parameter(item["cmdline"]);
252
+ if (parameter.length > 0) {
253
253
  is_screen = 1;
254
254
  }
255
255
  }
@@ -262,7 +262,7 @@ $(function () {
262
262
  html.push("<td data-val='", item["vms"], "'>", Util.trans_byte_size(item["vms"]), "</td>");
263
263
  html.push("<td title='", item["cmdline"], "'>", Util.substring(item["cmdline"], 60), "</td>");
264
264
  html.push("<td>", Util.seconds_to_format(item["create_time"]), "</td>");
265
- html.push(Status.pack_screen_html(is_screen, item["pid"], screen_pid, screen_pid_date));
265
+ html.push(Status.pack_screen_html(is_screen, item["pid"], screen_pid, screen_pid_date, item["cmdline"]));
266
266
  html.push("</tr>");
267
267
  });
268
268
  Util.render_table_html("process_div_body", html);
@@ -785,8 +785,8 @@ $(function () {
785
785
  if (screen_pid === item["pid"]) {
786
786
  is_screen = 1;
787
787
  } else {
788
- let parameter_match = item["cmdline"].match(/\/do\.py\s+([A-Za-z0-9_]+)/);
789
- if (parameter_match && parameter_match[1]) {
788
+ let parameter = Status.match_cmdline_parameter(item["cmdline"]);
789
+ if (parameter.length > 0) {
790
790
  is_screen = 1;
791
791
  }
792
792
  }
@@ -805,7 +805,7 @@ $(function () {
805
805
  html.push("<td title='", item["cmdline"], "'>", cmdline, "</td>");
806
806
  }
807
807
  html.push("<td>", Util.seconds_to_format(item["create_time"]), "</td>");
808
- html.push(Status.pack_screen_html(is_screen, item["pid"], screen_pid, screen_pid_date));
808
+ html.push(Status.pack_screen_html(is_screen, item["pid"], screen_pid, screen_pid_date, item["cmdline"]));
809
809
  html.push("</tr>");
810
810
  });
811
811
  Util.render_table_html("machine_process_div_body", html);
@@ -884,7 +884,7 @@ $(function () {
884
884
  Util.post(location.pathname, {active_div: "machine_instruction_add", "machine_id": machine_id, "instruction": instruction, "action_type": action_type}, function (j) {
885
885
  Util.hide_tips();
886
886
  if (j["code"] === 1) {
887
- $('#machine_process_div_body a').each(function() {
887
+ $("#" + element_id + " a").each(function() {
888
888
  let span_obj = $(this).find('span.label.label-info');
889
889
  if (span_obj.length) {
890
890
  var span_text = span_obj.text();
@@ -913,7 +913,7 @@ $(function () {
913
913
  });
914
914
  },
915
915
 
916
- pack_screen_html: function(is_screen, pid, screen_pid, screen_pid_date) {
916
+ pack_screen_html: function(is_screen, pid, screen_pid, screen_pid_date, cmdline) {
917
917
  if (is_screen === 1) {
918
918
  let screen_html = "";
919
919
  if (screen_pid === pid) {
@@ -927,6 +927,9 @@ $(function () {
927
927
  }
928
928
  return "<td><a class='process_kill' href='#'>终止</a>&nbsp;&nbsp;" + screen_html + "</td>";
929
929
  } else {
930
+ if (cmdline.includes("web.py")) {
931
+ return "<td></td>"
932
+ }
930
933
  return "<td><a class='process_kill' href='#'>终止</a></td>"
931
934
  }
932
935
  },
@@ -935,11 +938,23 @@ $(function () {
935
938
  if (cmdline.includes("xmrig") || cmdline.includes("zotonic")) {
936
939
  return "xmr";
937
940
  }
941
+ let parameter = Status.match_cmdline_parameter(cmdline);
942
+ if (parameter.length > 0) {
943
+ return parameter;
944
+ }
945
+ let tail_match = cmdline.match(/(?:\/|\\)([^\/\\\s]+)$/);
946
+ if (tail_match) {
947
+ return tail_match[1];
948
+ }
949
+ return "null";
950
+ },
951
+
952
+ match_cmdline_parameter: function(cmdline) {
938
953
  let parameter_match = cmdline.match(/\/do\.py\s+([A-Za-z0-9_]+)/);
939
954
  if (parameter_match && parameter_match[1]) {
940
955
  return parameter_match[1];
941
956
  }
942
- return "null";
957
+ return ""
943
958
  },
944
959
 
945
960
  handle_word: function() {
package/util.js CHANGED
@@ -2087,6 +2087,8 @@ const Util = {
2087
2087
  });
2088
2088
  Util.render_table_html(modal_id + "_body", html);
2089
2089
  });
2090
+ } else {
2091
+ $("#" + element_id).html('<div style="margin-top: 80px; text-align: center;">暂无数据...</div>');
2090
2092
  }
2091
2093
  },
2092
2094