sbd-npm 1.4.48 → 1.4.50

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 +6 -2
  3. package/util.js +13 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.4.48",
3
+ "version": "1.4.50",
4
4
  "description": "Stock Big Data",
5
5
  "author": "DHQ <dhq314@gmail.com>",
6
6
  "license": "ISC",
package/status.js CHANGED
@@ -554,7 +554,8 @@ $(function () {
554
554
  },
555
555
 
556
556
  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) {
557
+ let machine_id = $("#task_machines").val();
558
+ Util.post(location.pathname, {active_div: localStorage[Status.tab_token], is_init: is_init, machine_id: machine_id}, function (j) {
558
559
  if (j["machines"]) {
559
560
  Status.pack_machine_component("task_machines", j["machines"]);
560
561
  if (j["machines"].length > 0) {
@@ -614,6 +615,9 @@ $(function () {
614
615
  $("#task_add").html('添加任务').prop('disabled', false).removeClass("btn-warning").addClass("btn-default");
615
616
  }
616
617
  }
618
+ if (j["ip_process_num"]) {
619
+ $("#task_machines option[value='" + machine_id + "']").text(j["ip_process_num"]);
620
+ }
617
621
  Util.hide_tips();
618
622
  });
619
623
  },
@@ -713,7 +717,7 @@ $(function () {
713
717
  });
714
718
  Util.render_table_html("machine_process_div_body", html);
715
719
  $("#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 + ")");
720
+ $("#machines option[value='" + j["machine_id"] + "']").text(j["ip"] + "(" + process_num + ")");
717
721
  } else if (is_init === 1) {
718
722
  $('#machines').html('<option value="">暂无Machine</option>');
719
723
  }
package/util.js CHANGED
@@ -420,8 +420,11 @@ const Util = {
420
420
  if (location_name === "") {
421
421
  location_name = location.length > 20 ? location.substring(0, 20) : location;
422
422
  }
423
- //return "<a target='_blank' class='link_cls map_link' rel='noopener noreferrer nofollow' href='https://map.baidu.com/m?fr=ps01000&word=" + location + "'>" + location_name + "</a>";
424
- return "<a target='_blank' class='link_cls map_link' rel='noopener noreferrer nofollow' href='https://www.amap.com/search?query=" + location + "'>" + location_name + "</a>";
423
+ if (Util.is_has_chinese(location)) {
424
+ //return "<a target='_blank' class='link_cls map_link' rel='noopener noreferrer nofollow' href='https://map.baidu.com/m?fr=ps01000&word=" + location + "'>" + location_name + "</a>";
425
+ return "<a target='_blank' class='link_cls map_link' rel='noopener noreferrer nofollow' href='https://www.amap.com/search?query=" + location + "'>" + location_name + "</a>";
426
+ }
427
+ return Util.google_map_url(location, location_name);
425
428
  }
426
429
  return "--";
427
430
  },
@@ -1711,7 +1714,8 @@ const Util = {
1711
1714
  $(this).click(function () {
1712
1715
  let tr_obj = $(this).parent().parent();
1713
1716
  let word = $(tr_obj).children('td').eq(1).text();
1714
- if (confirm("是否确定要删除“ " + word + " ” ?")) {
1717
+ let chinese = $(tr_obj).children('td').eq(2).text();
1718
+ if (confirm("是否确定要删除“ " + word + "「" + chinese + "」 ” ?")) {
1715
1719
  Util.post(location.pathname, {"active_div": "word_del", "word": word}, function () {
1716
1720
  $(tr_obj).remove();
1717
1721
  Util.show_tips("删除 “ " + word + " ” 成功", 3456, "alert-success");
@@ -2595,8 +2599,7 @@ const Util = {
2595
2599
  * @returns {boolean}
2596
2600
  */
2597
2601
  is_has_chinese: function (str) {
2598
- let re = /[^\u4e00-\u9fa5]/;
2599
- return !re.test(str);
2602
+ return /[\u4e00-\u9fa5]/.test(str);
2600
2603
  },
2601
2604
 
2602
2605
  /**
@@ -3653,7 +3656,11 @@ const Util = {
3653
3656
  }
3654
3657
  start_obj.val(start_date);
3655
3658
  }
3656
- start_obj.daterangepicker({locale: {format: 'YYYY-MM-DD'}, singleDatePicker: true, singleClasses: "picker_2"});
3659
+ start_obj.daterangepicker({
3660
+ locale: {format: 'YYYY-MM-DD'},
3661
+ singleDatePicker: true,
3662
+ singleClasses: "picker_2"
3663
+ });
3657
3664
  if (end_id.length > 0) {
3658
3665
  let end_obj = $('#' + end_id);
3659
3666
  if (!Util.regexp_date_yyyy_mm_dd(end_obj.val())) {