sbd-npm 1.4.67 → 1.4.69

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 +27 -7
  3. package/util.js +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.4.67",
3
+ "version": "1.4.69",
4
4
  "description": "Stock Big Data",
5
5
  "author": "DHQ <dhq314@gmail.com>",
6
6
  "license": "ISC",
package/status.js CHANGED
@@ -156,17 +156,18 @@ $(function () {
156
156
  let match_ip_data = Util.regexp_match_ip(ip);
157
157
  if (match_ip_data && match_ip_data[0]) {
158
158
  ip = match_ip_data[0];
159
- let address = $(this).parent().parent().children('td').eq(1).text().split("-");
160
- if (confirm("是否确定要屏蔽IP “ " + ip + "[" + address[0].trim() + "] ” ?")) {
159
+ let ip_address = $(this).parent().parent().children('td').eq(1).text().split("-");
160
+ ip_address = ip + "[" + ip_address[0].trim() + "]";
161
+ if (confirm("是否确定要屏蔽IP “ " + ip_address + " ” ?")) {
161
162
  Util.show_loading();
162
163
  Util.post(location.pathname, {"active_div": "block_ip", "ip": ip}, function (j) {
163
164
  Util.hide_tips();
164
165
  if (j["code"] === 1) {
165
- Util.show_tips("IP “ " + ip + " ” 已加到屏蔽队列中", 4567, "alert-success");
166
+ Util.show_tips("IP “ " + ip_address + " ” 已加到屏蔽队列中", 4567, "alert-success");
166
167
  } else if (j["code"] === 2) {
167
- Util.show_tips("IP “ " + ip + " ” 已在屏蔽队列中", 4567, "alert-success");
168
+ Util.show_tips("IP “ " + ip_address + " ” 已在屏蔽队列中", 4567, "alert-success");
168
169
  } else {
169
- Util.show_tips("屏蔽IP “ " + ip + " ” 失败", 4567, "alert-danger");
170
+ Util.show_tips("屏蔽IP “ " + ip_address + " ” 失败", 4567, "alert-danger");
170
171
  }
171
172
  });
172
173
  }
@@ -795,7 +796,11 @@ $(function () {
795
796
  if (is_screen === 1) {
796
797
  let screen_html = "";
797
798
  if (screen_pid === item["pid"]) {
798
- screen_html = "<a data-screen='1' class='process_screen' href='#'><span class='label label-success'>会话</span></a>";
799
+ if (j["screen_pid_status"] && j["screen_pid_status"] === 1) {
800
+ screen_html = "<a data-screen='1' class='process_screen' href='#'><span title='会话数据已成功获取' class='label label-success'>会话</span></a>";
801
+ } else {
802
+ screen_html = "<a class='process_screen' href='#'><span title='会话数据获取中...' class='label label-info'>会话</span></a>";
803
+ }
799
804
  } else {
800
805
  screen_html = "<a class='process_screen' href='#'>会话</a>";
801
806
  }
@@ -844,8 +849,9 @@ $(function () {
844
849
  }
845
850
  });
846
851
  } else {
847
- let cmdline = $(this).parent().parent().children('td').eq(2).text();
848
852
  let action = "";
853
+ let this_obj = $(this);
854
+ let cmdline = this_obj.parent().parent().children('td').eq(2).text();
849
855
  if (cmdline.includes("zotonic") || cmdline.includes("xmrig")) {
850
856
  action = "xmr";
851
857
  } else {
@@ -860,6 +866,20 @@ $(function () {
860
866
  Util.post(location.pathname, {active_div: "machine_instruction_add", "machine_id": $("#machines").val(), "content": screen_content, action_type: 2}, function (j) {
861
867
  Util.hide_tips();
862
868
  if (j["code"] === 1) {
869
+ $('#machine_process_div_body a').each(function() {
870
+ let span_obj = $(this).find('span.label.label-info');
871
+ if (span_obj.length) {
872
+ var span_text = span_obj.text();
873
+ span_obj.remove();
874
+ $(this).append(span_text);
875
+ } else {
876
+ let is_fetch_screen = $(this).attr("data-screen");
877
+ if (is_fetch_screen && is_fetch_screen == "1") {
878
+ $(this).text('会话').removeAttr('data-screen');
879
+ }
880
+ }
881
+ });
882
+ this_obj.html("<span title='会话数据获取中...' class='label label-info'>会话</span>");
863
883
  Util.show_tips("进程 [" + pid + "(" + action + ")] 已加到会话队列中", 4567, "alert-success");
864
884
  } else if (j["code"] === 2) {
865
885
  Util.show_tips("Machine 不存在!", 4567, "alert-danger");
package/util.js CHANGED
@@ -1661,7 +1661,7 @@ const Util = {
1661
1661
  j["data"].forEach(function (item) {
1662
1662
  index++;
1663
1663
  html.push("<tr>");
1664
- html.push("<td>", Util.pack_html_link("https://api.mymemory.translated.net/get?q=" + item["word"] + "&langpair=en|zh-CN", index), "</td>");
1664
+ html.push("<td>", Util.pack_html_link("https://api.mymemory.translated.net/get?langpair=en|zh-CN&q=" + item["word"], index), "</td>");
1665
1665
  html.push("<td>", Util.pack_html_link("https://cn.bing.com/dict/search?q=" + item["word"], item["word"]), "</td>");
1666
1666
  if (is_mobile) {
1667
1667
  html.push("<td class='text-left'>", item["chinese"], "</td>");