sbd-npm 1.4.41 → 1.4.43
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.
- package/package.json +1 -1
- package/status.js +64 -63
- package/summary_daily.js +1 -1
- package/util.js +1 -1
package/package.json
CHANGED
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> 进程, <input checked type="checkbox" id="is_py_process"> 只显示 Python 进程 <a href="#" data-toggle="modal" data-target=".
|
181
|
+
"caption": prefix_caption + '共 <span class="label label-info" id="process_num"></span> 进程, <input checked type="checkbox" id="is_py_process"> 只显示 Python 进程 <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("
|
199
|
-
Status.
|
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,21 +633,22 @@ $(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(' <a href="#" data-toggle="modal" data-target=".
|
637
|
-
machine_html.push('<a href="#" data-toggle="modal" data-target=".
|
636
|
+
machine_html.push(' <a href="#" data-toggle="modal" data-target=".machine_action_modal" data-type="2" class="btn btn-warning">添加任务</a>');
|
637
|
+
machine_html.push('<a href="#" data-toggle="modal" data-target=".machine_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("
|
643
|
-
Status.
|
644
|
-
Status.
|
642
|
+
if (!document.getElementById("machine_action_add")) {
|
643
|
+
Status.init_machine_action_modal();
|
644
|
+
Status.init_machine_cookie_modal();
|
645
645
|
$("#machine_refresh").click(function() {
|
646
646
|
if (confirm("是否确定要“ 刷新Machine ” ?")) {
|
647
647
|
Util.show_loading();
|
648
648
|
$("#machine_refresh").attr("disabled", true).html("正在处理中...");
|
649
649
|
Util.post(location.pathname, {active_div: "machine_refresh"}, function (j) {
|
650
650
|
setTimeout(function () {
|
651
|
+
$('#machine_process_div').html('');
|
651
652
|
$('#machines').html('<option value="">暂无Machine</option>');
|
652
653
|
$("#machine_refresh").html("刷新Machine").attr("disabled", false);
|
653
654
|
Util.hide_tips();
|
@@ -754,15 +755,15 @@ $(function () {
|
|
754
755
|
Util.fetch_word_data(is_init, "", "");
|
755
756
|
},
|
756
757
|
|
757
|
-
|
758
|
-
Util.init_modal_skeleton("
|
759
|
-
$("#
|
758
|
+
init_machine_action_modal: function () {
|
759
|
+
Util.init_modal_skeleton("machine_action_modal");
|
760
|
+
$("#machine_action_modal_title").html("添加任务");
|
760
761
|
let html = [];
|
761
762
|
html.push('<form data-parsley-validate class="form-horizontal form-label-left">');
|
762
763
|
html.push('<div class="form-group" id="action_machine_div">');
|
763
764
|
html.push('<label class="control-label col-md-3 col-sm-3 col-xs-12">Machine </label>');
|
764
765
|
html.push('<div class="col-md-6 col-sm-6 col-xs-12">');
|
765
|
-
html.push('<select id="
|
766
|
+
html.push('<select id="machine_action_machine" class="form-control col-md-7 col-xs-12">');
|
766
767
|
html.push('<option value="">Loading...</option>');
|
767
768
|
html.push('</select>');
|
768
769
|
html.push('</div>');
|
@@ -770,22 +771,22 @@ $(function () {
|
|
770
771
|
html.push('<div class="form-group">');
|
771
772
|
html.push('<label class="control-label col-md-3 col-sm-3 col-xs-12">任务命令 </label>');
|
772
773
|
html.push('<div class="col-md-6 col-sm-6 col-xs-12">');
|
773
|
-
html.push('<select id="
|
774
|
+
html.push('<select id="machine_action_content" class="form-control col-md-7 col-xs-12">');
|
774
775
|
html.push('<option value="">任务命令</option>');
|
775
776
|
html.push('</select>');
|
776
777
|
html.push('</div>');
|
777
778
|
html.push('</div>');
|
778
779
|
html.push('<div class="form-group">');
|
779
780
|
html.push('<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">');
|
780
|
-
html.push('<button id="
|
781
|
-
html.push('<span id="
|
781
|
+
html.push('<button id="machine_action_add" type="button" class="btn btn-success">添 加</button>');
|
782
|
+
html.push('<span id="machine_action_tips"></span>');
|
782
783
|
html.push('</div>');
|
783
784
|
html.push('</div>');
|
784
785
|
html.push('</form>');
|
785
|
-
let camb_obj = $("#
|
786
|
+
let camb_obj = $("#machine_action_modal_body");
|
786
787
|
camb_obj.html(html.join(""));
|
787
788
|
camb_obj.parent().parent().removeClass("modal-xlg");
|
788
|
-
let cam_obj = $('#
|
789
|
+
let cam_obj = $('#machine_action_modal');
|
789
790
|
cam_obj.on('show.bs.modal', function (e) {
|
790
791
|
Util.show_loading();
|
791
792
|
let action_type = parseInt($(e.relatedTarget).attr("data-type"));
|
@@ -794,12 +795,12 @@ $(function () {
|
|
794
795
|
} else {
|
795
796
|
$("#action_machine_div").css("display", "block");
|
796
797
|
}
|
797
|
-
Util.post(location.pathname, {active_div: "
|
798
|
+
Util.post(location.pathname, {active_div: "machine_action", action_type: action_type}, function (j) {
|
798
799
|
if (j["machines"]) {
|
799
|
-
Status.pack_machine_component("
|
800
|
+
Status.pack_machine_component("machine_action_machine", j["machines"]);
|
800
801
|
let machine = $("#machines").val();
|
801
802
|
if (machine) {
|
802
|
-
$("#
|
803
|
+
$("#machine_action_machine").find("option[value='" + machine + "']").attr("selected", true);
|
803
804
|
}
|
804
805
|
}
|
805
806
|
if (j["actions"]) {
|
@@ -807,122 +808,122 @@ $(function () {
|
|
807
808
|
j["actions"].forEach(function (action) {
|
808
809
|
action_html.push("<option value='", action, "'>", action, "</option>");
|
809
810
|
});
|
810
|
-
$("#
|
811
|
+
$("#machine_action_content").html(action_html.join(""));
|
811
812
|
}
|
812
813
|
Util.hide_tips();
|
813
814
|
});
|
814
815
|
});
|
815
816
|
cam_obj.on('hidden.bs.modal', function () {
|
816
|
-
$("#
|
817
|
+
$("#machine_action_tips").html("");
|
817
818
|
Util.hide_tips();
|
818
819
|
});
|
819
|
-
$("#
|
820
|
+
$("#machine_action_add").click(function() {
|
820
821
|
let action_type = 1, machine_id = "1";
|
821
822
|
if ($("#action_machine_div").css("display") === "block") {
|
822
823
|
action_type = 2;
|
823
|
-
machine_id = $("#
|
824
|
+
machine_id = $("#machine_action_machine").val();
|
824
825
|
}
|
825
826
|
if (machine_id) {
|
826
|
-
let action_content = $("#
|
827
|
+
let action_content = $("#machine_action_content").val();
|
827
828
|
if (action_content) {
|
828
829
|
Util.show_loading();
|
829
|
-
$("#
|
830
|
-
$("#
|
831
|
-
Util.post(location.pathname, {active_div: "
|
832
|
-
$("#
|
830
|
+
$("#machine_action_tips").html("");
|
831
|
+
$("#machine_action_add").attr("disabled", true);
|
832
|
+
Util.post(location.pathname, {active_div: "machine_action_add", "machine_id": machine_id, "content": action_content, action_type: action_type}, function (j) {
|
833
|
+
$("#machine_action_add").attr("disabled", false);
|
833
834
|
if (j["code"] && j["code"] === 1) {
|
834
|
-
$("#
|
835
|
+
$("#machine_action_tips").html("<b class='text-success'>任务`" + action_content + "`添加成功!</b>");
|
835
836
|
} else if (j["code"] && j["code"] === 2) {
|
836
|
-
$("#
|
837
|
+
$("#machine_action_tips").html("<b class='text-danger'>Machine 不存在!</b>");
|
837
838
|
} else if (j["code"] && j["code"] === 3) {
|
838
|
-
$("#
|
839
|
+
$("#machine_action_tips").html("<b class='text-danger'>任务内容异常!</b>");
|
839
840
|
} else {
|
840
|
-
$("#
|
841
|
+
$("#machine_action_tips").html("<b class='text-danger'>任务内容不能为空!</b>");
|
841
842
|
}
|
842
843
|
Util.hide_tips();
|
843
844
|
});
|
844
845
|
} else {
|
845
|
-
$("#
|
846
|
+
$("#machine_action_tips").html("<b class='text-danger'>任务内容不能为空!</b>");
|
846
847
|
}
|
847
848
|
} else {
|
848
|
-
$("#
|
849
|
+
$("#machine_action_tips").html("<b class='text-danger'>Machine 异常!</b>");
|
849
850
|
}
|
850
851
|
return false;
|
851
852
|
});
|
852
853
|
},
|
853
854
|
|
854
|
-
|
855
|
-
Util.init_modal_skeleton("
|
856
|
-
$("#
|
855
|
+
init_machine_cookie_modal: function () {
|
856
|
+
Util.init_modal_skeleton("machine_cookie_modal");
|
857
|
+
$("#machine_cookie_modal_title").html("雪球Cookie");
|
857
858
|
let html = [];
|
858
859
|
html.push('<form data-parsley-validate class="form-horizontal form-label-left">');
|
859
860
|
html.push('<div class="form-group" id="action_machine_div">');
|
860
861
|
html.push('<label class="control-label col-md-3 col-sm-3 col-xs-12">Machine </label>');
|
861
862
|
html.push('<div class="col-md-6 col-sm-6 col-xs-12">');
|
862
|
-
html.push('<select id="
|
863
|
+
html.push('<select id="machine_cookie_machine" class="form-control col-md-7 col-xs-12">');
|
863
864
|
html.push('<option value="">Loading...</option>');
|
864
865
|
html.push('</select>');
|
865
866
|
html.push('</div>');
|
866
867
|
html.push('</div>');
|
867
868
|
html.push('<div class="form-group">');
|
868
|
-
html.push('<label class="control-label col-md-3 col-sm-3 col-xs-12" for="
|
869
|
+
html.push('<label class="control-label col-md-3 col-sm-3 col-xs-12" for="machine_cookie_content">Cookie </label>');
|
869
870
|
html.push('<div class="col-md-6 col-sm-6 col-xs-12">');
|
870
|
-
html.push('<textarea class="form-control" rows="10" id="
|
871
|
+
html.push('<textarea class="form-control" rows="10" id="machine_cookie_content"></textarea>');
|
871
872
|
html.push('</div>');
|
872
873
|
html.push('</div>');
|
873
874
|
html.push('<div class="form-group">');
|
874
875
|
html.push('<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">');
|
875
|
-
html.push('<button id="
|
876
|
-
html.push('<span id="
|
876
|
+
html.push('<button id="machine_cookie_add" type="button" class="btn btn-success">添 加</button>');
|
877
|
+
html.push('<span id="machine_cookie_tips"></span>');
|
877
878
|
html.push('</div>');
|
878
879
|
html.push('</div>');
|
879
880
|
html.push('</form>');
|
880
|
-
let ccmb_obj = $("#
|
881
|
+
let ccmb_obj = $("#machine_cookie_modal_body");
|
881
882
|
ccmb_obj.html(html.join(""));
|
882
883
|
ccmb_obj.parent().parent().removeClass("modal-xlg");
|
883
|
-
let ccm_obj = $('#
|
884
|
+
let ccm_obj = $('#machine_cookie_modal');
|
884
885
|
ccm_obj.on('show.bs.modal', function (e) {
|
885
886
|
Util.show_loading();
|
886
|
-
Util.post(location.pathname, {active_div: "
|
887
|
+
Util.post(location.pathname, {active_div: "machine_action", action_type: 2}, function (j) {
|
887
888
|
if (j["machines"]) {
|
888
|
-
Status.pack_machine_component("
|
889
|
+
Status.pack_machine_component("machine_cookie_machine", j["machines"]);
|
889
890
|
let machine = $("#machines").val();
|
890
891
|
if (machine) {
|
891
|
-
$("#
|
892
|
+
$("#machine_cookie_machine").find("option[value='" + machine + "']").attr("selected", true);
|
892
893
|
}
|
893
894
|
}
|
894
895
|
Util.hide_tips();
|
895
896
|
});
|
896
897
|
});
|
897
898
|
ccm_obj.on('hidden.bs.modal', function () {
|
898
|
-
$("#
|
899
|
-
$("#
|
899
|
+
$("#machine_cookie_content").val("");
|
900
|
+
$("#machine_cookie_tips").html("");
|
900
901
|
Util.hide_tips();
|
901
902
|
});
|
902
|
-
$("#
|
903
|
-
let machine_id = $("#
|
903
|
+
$("#machine_cookie_add").click(function() {
|
904
|
+
let machine_id = $("#machine_cookie_machine").val();
|
904
905
|
if (machine_id) {
|
905
|
-
let
|
906
|
-
if (
|
906
|
+
let machine_cookie = $("#machine_cookie_content").val();
|
907
|
+
if (machine_cookie) {
|
907
908
|
Util.show_loading();
|
908
|
-
$("#
|
909
|
-
$("#
|
910
|
-
Util.post(location.pathname, {active_div: "
|
911
|
-
$("#
|
909
|
+
$("#machine_cookie_tips").html("");
|
910
|
+
$("#machine_cookie_add").attr("disabled", true);
|
911
|
+
Util.post(location.pathname, {active_div: "machine_cookie_add", "machine_id": machine_id, "cookie": machine_cookie}, function (j) {
|
912
|
+
$("#machine_cookie_add").attr("disabled", false);
|
912
913
|
if (j["code"] && j["code"] === 1) {
|
913
|
-
$("#
|
914
|
+
$("#machine_cookie_tips").html("<b class='text-success'>Cookie添加成功!</b>");
|
914
915
|
} else if (j["code"] && j["code"] === 2) {
|
915
|
-
$("#
|
916
|
+
$("#machine_cookie_tips").html("<b class='text-danger'>Machine 不存在!</b>");
|
916
917
|
} else {
|
917
|
-
$("#
|
918
|
+
$("#machine_cookie_tips").html("<b class='text-danger'>Cookie异常!</b>");
|
918
919
|
}
|
919
920
|
Util.hide_tips();
|
920
921
|
});
|
921
922
|
} else {
|
922
|
-
$("#
|
923
|
+
$("#machine_cookie_tips").html("<b class='text-danger'>Cookie不能为空!</b>");
|
923
924
|
}
|
924
925
|
} else {
|
925
|
-
$("#
|
926
|
+
$("#machine_cookie_tips").html("<b class='text-danger'>Machine 异常!</b>");
|
926
927
|
}
|
927
928
|
return false;
|
928
929
|
});
|
package/summary_daily.js
CHANGED
@@ -534,7 +534,7 @@ $(function () {
|
|
534
534
|
},
|
535
535
|
|
536
536
|
render_market_overview_modal: function (obj) {
|
537
|
-
let title =
|
537
|
+
let title = $(obj).text().trim();
|
538
538
|
$("#at_title").html("[" + title + "]数据");
|
539
539
|
Util.set_table_loading("market_overview_load_status");
|
540
540
|
if (Modal.mo_end_time === 0) {
|
package/util.js
CHANGED
@@ -60,7 +60,7 @@ const Util = {
|
|
60
60
|
$("[data-toggle='tooltip']").tooltip();
|
61
61
|
|
62
62
|
$("#search-stock").click(function () {
|
63
|
-
let code = $("#stock").val();
|
63
|
+
let code = $("#stock").val().trim();
|
64
64
|
if (code) {
|
65
65
|
if (window.location.pathname === "/status" && $("#word").hasClass('active') && (Util.is_alphabet(code) || Util.is_chinese(code))) {
|
66
66
|
Util.fetch_word_data(0, "", code);
|