sbd-npm 1.5.41 → 1.5.42

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 +39 -18
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.5.41",
3
+ "version": "1.5.42",
4
4
  "description": "Stock Big Data",
5
5
  "author": "DHQ <dhq314@gmail.com>",
6
6
  "license": "ISC",
package/status.js CHANGED
@@ -852,24 +852,7 @@ $(function () {
852
852
  {"name": "操作", "id": "machine_action_log", "link": "#", "title": "操作日志记录"}
853
853
  ]
854
854
  });
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
- });
855
+ Status.handle_machine_action_log();
873
856
  }
874
857
  let html = [], process_num = 0;
875
858
  let screen_pid = j.screen_pid ? j.screen_pid : 0;
@@ -1066,6 +1049,44 @@ $(function () {
1066
1049
  }
1067
1050
  },
1068
1051
 
1052
+ handle_machine_action_log: function() {
1053
+ $("#machine_action_log").click(function() {
1054
+ let machine_id = $("#machines").val();
1055
+ if (machine_id) {
1056
+ let info_object = $(this).find('span.label.label-info');
1057
+ if (info_object.length) {
1058
+ Util.show_tips("[操作日志记录] 获取中...", 4567, "alert-success");
1059
+ } else {
1060
+ let instruction = "screen_1_machine_action_log";
1061
+ let success_object = $(this).find('span.label.label-success');
1062
+ if (success_object.length) {
1063
+ Util.post(location.pathname, {action: "machine_screen", "machine_id": machine_id, "pid": "1", "instruction": instruction}, function (j) {
1064
+ Util.hide_tips();
1065
+ if (j.data) {
1066
+ Util.showAlert(j.data);
1067
+ } else {
1068
+ Util.show_tips("数据异常!", 4567, "alert-danger");
1069
+ }
1070
+ });
1071
+ } else {
1072
+ Util.post(location.pathname, {action: "machine_instruction_add", "machine_id": machine_id, "instruction": instruction, "action_type": 2}, function (j) {
1073
+ Util.hide_tips();
1074
+ if (j.code === 1) {
1075
+ Status.reset_screen_status("machine_process_div_body");
1076
+ $("#machine_action_log").html("<a href='#'><span title='日志记录获取中...' class='label label-info'>操作</span></a>");
1077
+ Util.show_tips("[获取操作日志记录] 已加到会话队列中", 4567, "alert-success");
1078
+ } else if (j.code === 2) {
1079
+ Util.show_tips("Machine 不存在!", 4567, "alert-danger");
1080
+ } else {
1081
+ Util.show_tips("[获取操作日志记录] 异常!", 4567, "alert-danger");
1082
+ }
1083
+ });
1084
+ }
1085
+ }
1086
+ }
1087
+ });
1088
+ },
1089
+
1069
1090
  parse_machine_action: function(cmdline) {
1070
1091
  if (cmdline.includes("xmrig") || cmdline.includes("zotonic")) {
1071
1092
  return "xmr";