sbd-npm 1.4.50 → 1.4.52

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 +13 -4
  3. package/util.js +3 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.4.50",
3
+ "version": "1.4.52",
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("?", "?");
@@ -359,6 +363,9 @@ $(function () {
359
363
  html.push("<td>", database_variable_num, "</td>");
360
364
  html.push("<td class='text-right'>", item["key"], "</td>");
361
365
  }
366
+ if (item["key"] === "innodb_buffer_pool_size") {
367
+ item["val"] += " (" + Util.trans_byte_size(item["val"]) + ")";
368
+ }
362
369
  html.push("<td class='text-left' style='word-break: break-all'>", item["val"], "</td>");
363
370
  html.push("</tr>");
364
371
  });
@@ -499,7 +506,7 @@ $(function () {
499
506
  $("#task_div").html(ht_html.join(""));
500
507
  $("#task_add").click(function() {
501
508
  let task_content = $("#task_content").val();
502
- task_content = task_content.replace(/[^\w\u4e00-\u9fff]/g, ''); // 去掉除字母、数字、下划线(_)、汉字外的其他字符
509
+ task_content = task_content.replace(/[^\w\u4e00-\u9fff]/g, ''); // 去掉除字母、数字、下划线(_)、汉字外的其他字符(䒚 /[^\w\u3400-\u9fff\u{20000}-\u{2EBEF}]/gu)
503
510
  if (task_content && task_content.length > 0) {
504
511
  $("#task_content").prop('disabled', true);
505
512
  $("#task_add").prop('disabled', true);
@@ -525,9 +532,11 @@ $(function () {
525
532
  } else {
526
533
  Status.task_status = 0;
527
534
  if (j["code"] && j["code"] === 2) {
528
- $("#task_tips").html("<b class='text-danger'>已添加新任务在处理中!</b>");
535
+ let do_content = j["do_content"] ? ("(" + j["do_content"] + ")") : "";
536
+ $("#task_tips").html("<b class='text-danger'>已添加新任务" + do_content + "在处理中!</b>");
529
537
  } else if (j["code"] && j["code"] === 3) {
530
- $("#task_tips").html("<b class='text-danger'>有任务在执行中!</b>");
538
+ let doing_content = j["doing_content"] ? ("(" + j["doing_content"] + ")") : "";
539
+ $("#task_tips").html("<b class='text-danger'>有任务" + doing_content + "在执行中!</b>");
531
540
  } else {
532
541
  $("#task_tips").html("<b class='text-danger'>参数异常!</b>");
533
542
  }
package/util.js CHANGED
@@ -2478,9 +2478,8 @@ const Util = {
2478
2478
  return Util.to_float(mega_byte, 2) + " MB";
2479
2479
  } else if (kilo_byte > 0) {
2480
2480
  return Util.to_float(kilo_byte, 2) + " KB";
2481
- } else {
2482
- return byte + " B";
2483
2481
  }
2482
+ return byte + " B";
2484
2483
  },
2485
2484
 
2486
2485
  /**
@@ -2633,8 +2632,7 @@ const Util = {
2633
2632
  * @param obj_token
2634
2633
  */
2635
2634
  parse_value_trend: function (obj_token) {
2636
- let data_arr = [];
2637
- let unit = "";
2635
+ let data_arr = [], unit = "";
2638
2636
  $("." + obj_token).each(function () {
2639
2637
  let val = $(this).text();
2640
2638
  if (unit === "") {
@@ -2643,9 +2641,7 @@ const Util = {
2643
2641
  unit = match_arr[0];
2644
2642
  }
2645
2643
  }
2646
- let digit = Util.filter_chinese(val);
2647
- let d = {"obj": $(this), "digit": digit};
2648
- data_arr.push(d);
2644
+ data_arr.push({"obj": $(this), "digit": Util.filter_chinese(val)});
2649
2645
  });
2650
2646
  let data_arr_len = data_arr.length;
2651
2647
  if (data_arr_len > 0) {