sbd-npm 1.4.49 → 1.4.51

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 +16 -6
  3. package/util.js +2 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.4.49",
3
+ "version": "1.4.51",
4
4
  "description": "Stock Big Data",
5
5
  "author": "DHQ <dhq314@gmail.com>",
6
6
  "license": "ISC",
package/status.js CHANGED
@@ -141,7 +141,11 @@ $(function () {
141
141
  referer_replacement = u.hostname + ":" + u.port + "/";
142
142
  }
143
143
  ip_daily_data.forEach(function (item) {
144
- html.push("<tr>");
144
+ if (item["is_block"] === 1) {
145
+ html.push("<tr class='danger'>");
146
+ } else {
147
+ html.push("<tr>");
148
+ }
145
149
  html.push("<td>", Status.pack_ip_link(item["ip"]), "</td>");
146
150
  html.push("<td>", Status.map_url(item['location']), "</td>");
147
151
  item["referer"] = item["referer"].replace("?", "?");
@@ -499,7 +503,7 @@ $(function () {
499
503
  $("#task_div").html(ht_html.join(""));
500
504
  $("#task_add").click(function() {
501
505
  let task_content = $("#task_content").val();
502
- task_content = task_content.replace(/[^\w\u4e00-\u9fff]/g, ''); // 去掉除字母、数字、下划线(_)、汉字外的其他字符
506
+ task_content = task_content.replace(/[^\w\u4e00-\u9fff]/g, ''); // 去掉除字母、数字、下划线(_)、汉字外的其他字符(䒚 /[^\w\u3400-\u9fff\u{20000}-\u{2EBEF}]/gu)
503
507
  if (task_content && task_content.length > 0) {
504
508
  $("#task_content").prop('disabled', true);
505
509
  $("#task_add").prop('disabled', true);
@@ -525,9 +529,11 @@ $(function () {
525
529
  } else {
526
530
  Status.task_status = 0;
527
531
  if (j["code"] && j["code"] === 2) {
528
- $("#task_tips").html("<b class='text-danger'>已添加新任务在处理中!</b>");
532
+ let do_content = j["do_content"] ? ("(" + j["do_content"] + ")") : "";
533
+ $("#task_tips").html("<b class='text-danger'>已添加新任务" + do_content + "在处理中!</b>");
529
534
  } else if (j["code"] && j["code"] === 3) {
530
- $("#task_tips").html("<b class='text-danger'>有任务在执行中!</b>");
535
+ let doing_content = j["doing_content"] ? ("(" + j["doing_content"] + ")") : "";
536
+ $("#task_tips").html("<b class='text-danger'>有任务" + doing_content + "在执行中!</b>");
531
537
  } else {
532
538
  $("#task_tips").html("<b class='text-danger'>参数异常!</b>");
533
539
  }
@@ -554,7 +560,8 @@ $(function () {
554
560
  },
555
561
 
556
562
  fetch_task_data: function(is_init = 0) {
557
- Util.post(location.pathname, {active_div: localStorage[Status.tab_token], is_init: is_init, machine_id: $("#task_machines").val()}, function (j) {
563
+ let machine_id = $("#task_machines").val();
564
+ Util.post(location.pathname, {active_div: localStorage[Status.tab_token], is_init: is_init, machine_id: machine_id}, function (j) {
558
565
  if (j["machines"]) {
559
566
  Status.pack_machine_component("task_machines", j["machines"]);
560
567
  if (j["machines"].length > 0) {
@@ -614,6 +621,9 @@ $(function () {
614
621
  $("#task_add").html('添加任务').prop('disabled', false).removeClass("btn-warning").addClass("btn-default");
615
622
  }
616
623
  }
624
+ if (j["ip_process_num"]) {
625
+ $("#task_machines option[value='" + machine_id + "']").text(j["ip_process_num"]);
626
+ }
617
627
  Util.hide_tips();
618
628
  });
619
629
  },
@@ -713,7 +723,7 @@ $(function () {
713
723
  });
714
724
  Util.render_table_html("machine_process_div_body", html);
715
725
  $("#machine_process_tip").html('共 <span class="label label-info">' + process_num + '</span> 进程,最后更新时间:' + Util.seconds_to_format(j["date"]) + ',Revision:' + j["revision"] + ',MachineId:' + j["machine_id"]);
716
- $("#machines option[value='" + $("#machines").val() + "']").text(j["ip"] + "(" + process_num + ")");
726
+ $("#machines option[value='" + j["machine_id"] + "']").text(j["ip"] + "(" + process_num + ")");
717
727
  } else if (is_init === 1) {
718
728
  $('#machines').html('<option value="">暂无Machine</option>');
719
729
  }
package/util.js CHANGED
@@ -1714,7 +1714,8 @@ const Util = {
1714
1714
  $(this).click(function () {
1715
1715
  let tr_obj = $(this).parent().parent();
1716
1716
  let word = $(tr_obj).children('td').eq(1).text();
1717
- if (confirm("是否确定要删除“ " + word + " ” ?")) {
1717
+ let chinese = $(tr_obj).children('td').eq(2).text();
1718
+ if (confirm("是否确定要删除“ " + word + "「" + chinese + "」 ” ?")) {
1718
1719
  Util.post(location.pathname, {"active_div": "word_del", "word": word}, function () {
1719
1720
  $(tr_obj).remove();
1720
1721
  Util.show_tips("删除 “ " + word + " ” 成功", 3456, "alert-success");