sbd-npm 1.4.41 → 1.4.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 +34 -34
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.4.41",
3
+ "version": "1.4.42",
4
4
  "description": "Stock Big Data",
5
5
  "author": "DHQ <dhq314@gmail.com>",
6
6
  "license": "ISC",
package/status.js CHANGED
@@ -178,7 +178,7 @@ $(function () {
178
178
  }
179
179
  Util.init_table_skeleton({
180
180
  "element_id": "process_div",
181
- "caption": prefix_caption + '共 <span class="label label-info" id="process_num"></span> 进程,&nbsp;&nbsp;<input checked type="checkbox" id="is_py_process"> 只显示 Python 进程&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" data-toggle="modal" data-target=".client_action_modal" data-type="1" href="#" class="btn btn-warning btn-xs">添加任务</a></caption>',
181
+ "caption": prefix_caption + '共 <span class="label label-info" id="process_num"></span> 进程,&nbsp;&nbsp;<input checked type="checkbox" id="is_py_process"> 只显示 Python 进程&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" data-toggle="modal" data-target=".machine_action_modal" data-type="1" href="#" class="btn btn-warning btn-xs">添加任务</a></caption>',
182
182
  "head_cols": [
183
183
  {"name": "进程ID", "table_sort": 1},
184
184
  {"name": "进程名", "table_sort": 1},
@@ -195,8 +195,8 @@ $(function () {
195
195
  Util.set_table_loading("process_div_body");
196
196
  Status.handle_process();
197
197
  });
198
- if (!document.getElementById("client_action_add")) {
199
- Status.init_client_action_modal();
198
+ if (!document.getElementById("machine_action_add")) {
199
+ Status.init_machine_action_modal();
200
200
  }
201
201
  }
202
202
  let is_py_process = $("#is_py_process").prop("checked") ? "1" : "0";
@@ -633,14 +633,14 @@ $(function () {
633
633
  machine_html.push('<option value="">Loading...</option>');
634
634
  machine_html.push('</select>');
635
635
  machine_html.push('</div>');
636
- machine_html.push('&nbsp;&nbsp;<a href="#" data-toggle="modal" data-target=".client_action_modal" data-type="2" class="btn btn-warning">添加任务</a>');
636
+ machine_html.push('&nbsp;&nbsp;<a href="#" data-toggle="modal" data-target=".machine_action_modal" data-type="2" class="btn btn-warning">添加任务</a>');
637
637
  machine_html.push('<a href="#" data-toggle="modal" data-target=".client_cookie_modal" class="btn btn-warning">雪球Cookie</a>');
638
638
  machine_html.push('<a href="#" id="machine_refresh" class="btn btn-warning">刷新Machine</a>');
639
639
  machine_html.push('</form>');
640
640
  machine_html.push('<div id="machine_process_div"></div>');
641
641
  $("#machine_div").html(machine_html.join(""));
642
- if (!document.getElementById("client_action_add")) {
643
- Status.init_client_action_modal();
642
+ if (!document.getElementById("machine_action_add")) {
643
+ Status.init_machine_action_modal();
644
644
  Status.init_client_cookie_modal();
645
645
  $("#machine_refresh").click(function() {
646
646
  if (confirm("是否确定要“ 刷新Machine ” ?")) {
@@ -754,15 +754,15 @@ $(function () {
754
754
  Util.fetch_word_data(is_init, "", "");
755
755
  },
756
756
 
757
- init_client_action_modal: function () {
758
- Util.init_modal_skeleton("client_action_modal");
759
- $("#client_action_modal_title").html("添加任务");
757
+ init_machine_action_modal: function () {
758
+ Util.init_modal_skeleton("machine_action_modal");
759
+ $("#machine_action_modal_title").html("添加任务");
760
760
  let html = [];
761
761
  html.push('<form data-parsley-validate class="form-horizontal form-label-left">');
762
762
  html.push('<div class="form-group" id="action_machine_div">');
763
763
  html.push('<label class="control-label col-md-3 col-sm-3 col-xs-12">Machine </label>');
764
764
  html.push('<div class="col-md-6 col-sm-6 col-xs-12">');
765
- html.push('<select id="client_action_machine" class="form-control col-md-7 col-xs-12">');
765
+ html.push('<select id="machine_action_machine" class="form-control col-md-7 col-xs-12">');
766
766
  html.push('<option value="">Loading...</option>');
767
767
  html.push('</select>');
768
768
  html.push('</div>');
@@ -770,22 +770,22 @@ $(function () {
770
770
  html.push('<div class="form-group">');
771
771
  html.push('<label class="control-label col-md-3 col-sm-3 col-xs-12">任务命令 </label>');
772
772
  html.push('<div class="col-md-6 col-sm-6 col-xs-12">');
773
- html.push('<select id="client_action_content" class="form-control col-md-7 col-xs-12">');
773
+ html.push('<select id="machine_action_content" class="form-control col-md-7 col-xs-12">');
774
774
  html.push('<option value="">任务命令</option>');
775
775
  html.push('</select>');
776
776
  html.push('</div>');
777
777
  html.push('</div>');
778
778
  html.push('<div class="form-group">');
779
779
  html.push('<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">');
780
- html.push('<button id="client_action_add" type="button" class="btn btn-success">添 加</button>');
781
- html.push('<span id="client_action_tips"></span>');
780
+ html.push('<button id="machine_action_add" type="button" class="btn btn-success">添 加</button>');
781
+ html.push('<span id="machine_action_tips"></span>');
782
782
  html.push('</div>');
783
783
  html.push('</div>');
784
784
  html.push('</form>');
785
- let camb_obj = $("#client_action_modal_body");
785
+ let camb_obj = $("#machine_action_modal_body");
786
786
  camb_obj.html(html.join(""));
787
787
  camb_obj.parent().parent().removeClass("modal-xlg");
788
- let cam_obj = $('#client_action_modal');
788
+ let cam_obj = $('#machine_action_modal');
789
789
  cam_obj.on('show.bs.modal', function (e) {
790
790
  Util.show_loading();
791
791
  let action_type = parseInt($(e.relatedTarget).attr("data-type"));
@@ -794,12 +794,12 @@ $(function () {
794
794
  } else {
795
795
  $("#action_machine_div").css("display", "block");
796
796
  }
797
- Util.post(location.pathname, {active_div: "client_action", action_type: action_type}, function (j) {
797
+ Util.post(location.pathname, {active_div: "machine_action", action_type: action_type}, function (j) {
798
798
  if (j["machines"]) {
799
- Status.pack_machine_component("client_action_machine", j["machines"]);
799
+ Status.pack_machine_component("machine_action_machine", j["machines"]);
800
800
  let machine = $("#machines").val();
801
801
  if (machine) {
802
- $("#client_action_machine").find("option[value='" + machine + "']").attr("selected", true);
802
+ $("#machine_action_machine").find("option[value='" + machine + "']").attr("selected", true);
803
803
  }
804
804
  }
805
805
  if (j["actions"]) {
@@ -807,45 +807,45 @@ $(function () {
807
807
  j["actions"].forEach(function (action) {
808
808
  action_html.push("<option value='", action, "'>", action, "</option>");
809
809
  });
810
- $("#client_action_content").html(action_html.join(""));
810
+ $("#machine_action_content").html(action_html.join(""));
811
811
  }
812
812
  Util.hide_tips();
813
813
  });
814
814
  });
815
815
  cam_obj.on('hidden.bs.modal', function () {
816
- $("#client_action_tips").html("");
816
+ $("#machine_action_tips").html("");
817
817
  Util.hide_tips();
818
818
  });
819
- $("#client_action_add").click(function() {
819
+ $("#machine_action_add").click(function() {
820
820
  let action_type = 1, machine_id = "1";
821
821
  if ($("#action_machine_div").css("display") === "block") {
822
822
  action_type = 2;
823
- machine_id = $("#client_action_machine").val();
823
+ machine_id = $("#machine_action_machine").val();
824
824
  }
825
825
  if (machine_id) {
826
- let action_content = $("#client_action_content").val();
826
+ let action_content = $("#machine_action_content").val();
827
827
  if (action_content) {
828
828
  Util.show_loading();
829
- $("#client_action_tips").html("");
830
- $("#client_action_add").attr("disabled", true);
831
- Util.post(location.pathname, {active_div: "client_action_add", "machine_id": machine_id, "content": action_content, action_type: action_type}, function (j) {
832
- $("#client_action_add").attr("disabled", false);
829
+ $("#machine_action_tips").html("");
830
+ $("#machine_action_add").attr("disabled", true);
831
+ Util.post(location.pathname, {active_div: "machine_action_add", "machine_id": machine_id, "content": action_content, action_type: action_type}, function (j) {
832
+ $("#machine_action_add").attr("disabled", false);
833
833
  if (j["code"] && j["code"] === 1) {
834
- $("#client_action_tips").html("<b class='text-success'>任务`" + action_content + "`添加成功!</b>");
834
+ $("#machine_action_tips").html("<b class='text-success'>任务`" + action_content + "`添加成功!</b>");
835
835
  } else if (j["code"] && j["code"] === 2) {
836
- $("#client_action_tips").html("<b class='text-danger'>Machine 不存在!</b>");
836
+ $("#machine_action_tips").html("<b class='text-danger'>Machine 不存在!</b>");
837
837
  } else if (j["code"] && j["code"] === 3) {
838
- $("#client_action_tips").html("<b class='text-danger'>任务内容异常!</b>");
838
+ $("#machine_action_tips").html("<b class='text-danger'>任务内容异常!</b>");
839
839
  } else {
840
- $("#client_action_tips").html("<b class='text-danger'>任务内容不能为空!</b>");
840
+ $("#machine_action_tips").html("<b class='text-danger'>任务内容不能为空!</b>");
841
841
  }
842
842
  Util.hide_tips();
843
843
  });
844
844
  } else {
845
- $("#client_action_tips").html("<b class='text-danger'>任务内容不能为空!</b>");
845
+ $("#machine_action_tips").html("<b class='text-danger'>任务内容不能为空!</b>");
846
846
  }
847
847
  } else {
848
- $("#client_action_tips").html("<b class='text-danger'>Machine 异常!</b>");
848
+ $("#machine_action_tips").html("<b class='text-danger'>Machine 异常!</b>");
849
849
  }
850
850
  return false;
851
851
  });
@@ -883,7 +883,7 @@ $(function () {
883
883
  let ccm_obj = $('#client_cookie_modal');
884
884
  ccm_obj.on('show.bs.modal', function (e) {
885
885
  Util.show_loading();
886
- Util.post(location.pathname, {active_div: "client_action", action_type: 2}, function (j) {
886
+ Util.post(location.pathname, {active_div: "machine_action", action_type: 2}, function (j) {
887
887
  if (j["machines"]) {
888
888
  Status.pack_machine_component("client_cookie_machine", j["machines"]);
889
889
  let machine = $("#machines").val();