sbd-npm 1.4.57 → 1.4.59
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 +23 -0
- package/stock_basics.js +1 -1
- package/util.js +13 -5
package/package.json
CHANGED
package/status.js
CHANGED
@@ -740,6 +740,7 @@ $(function () {
|
|
740
740
|
{"name": "状态", "table_sort": 1},
|
741
741
|
{"name": "启动命令"},
|
742
742
|
{"name": "创建时间", "class": "info", "table_sort": 1},
|
743
|
+
{"name": "操作"}
|
743
744
|
]
|
744
745
|
});
|
745
746
|
}
|
@@ -760,11 +761,33 @@ $(function () {
|
|
760
761
|
html.push("<td title='", item["cmdline"], "'>", cmdline, "</td>");
|
761
762
|
}
|
762
763
|
html.push("<td>", Util.seconds_to_format(item["create_time"]), "</td>");
|
764
|
+
html.push("<td><a class='process_kill' href='#'>终止</a></td>");
|
763
765
|
html.push("</tr>");
|
764
766
|
});
|
765
767
|
Util.render_table_html("machine_process_div_body", html);
|
766
768
|
$("#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"]);
|
767
769
|
$("#machines option[value='" + j["machine_id"] + "']").text(j["ip"] + "(" + process_num + ")");
|
770
|
+
$("#machine_process_div_body .process_kill").each(function() {
|
771
|
+
$(this).click(function() {
|
772
|
+
let pid = $(this).parent().parent().children('td').eq(0).text();
|
773
|
+
if (confirm("是否确定要终止进程 [" + pid + "] ?")) {
|
774
|
+
Util.show_loading();
|
775
|
+
let action_content = "kill_" + pid;
|
776
|
+
Util.post(location.pathname, {active_div: "machine_action_add", "machine_id": $("#machines").val(), "content": action_content, action_type: 2}, function (j) {
|
777
|
+
Util.hide_tips();
|
778
|
+
if (j["code"] === 1) {
|
779
|
+
Util.show_tips("进程 [" + pid + "] 已加到终止队列中", 4567, "alert-success");
|
780
|
+
} else if (j["code"] === 2) {
|
781
|
+
Util.show_tips("Machine 不存在!", 4567, "alert-danger");
|
782
|
+
} else if (j["code"] === 3) {
|
783
|
+
Util.show_tips("进程 [" + pid + "] 异常!", 4567, "alert-danger");
|
784
|
+
} else {
|
785
|
+
Util.show_tips("进程值不能为空!", 4567, "alert-danger");
|
786
|
+
}
|
787
|
+
});
|
788
|
+
}
|
789
|
+
});
|
790
|
+
});
|
768
791
|
} else if (is_init === 1) {
|
769
792
|
$('#machines').html('<option value="">暂无Machine</option>');
|
770
793
|
}
|
package/stock_basics.js
CHANGED
@@ -159,7 +159,7 @@ let Stock = {
|
|
159
159
|
|
160
160
|
let location_obj = $("#location");
|
161
161
|
if (location_obj.length > 0) {
|
162
|
-
let location_arr = location_obj.text().split(
|
162
|
+
let location_arr = location_obj.text().split(/[;;,]/);
|
163
163
|
html = [];
|
164
164
|
location_arr.forEach(function (location) {
|
165
165
|
html.push(Util.map_url(location, location) + ' ');
|
package/util.js
CHANGED
@@ -3741,13 +3741,17 @@ const Util = {
|
|
3741
3741
|
let div_id = $(this).attr("id");
|
3742
3742
|
$("#" + tab_token).find("li").each(function () {
|
3743
3743
|
$(this).removeClass("active");
|
3744
|
-
let
|
3745
|
-
if (!
|
3746
|
-
|
3744
|
+
let id_obj = $("#" + $(this).attr("id") + "_div");
|
3745
|
+
if (!id_obj.hasClass("hide")) {
|
3746
|
+
id_obj.addClass("hide");
|
3747
3747
|
}
|
3748
3748
|
});
|
3749
3749
|
$(this).addClass("active");
|
3750
|
-
$("#" + div_id + "_div")
|
3750
|
+
let div_obj = $("#" + div_id + "_div");
|
3751
|
+
div_obj.removeClass("hide");
|
3752
|
+
if (Util.is_mobile() && !div_obj.hasClass("table-responsive")) {
|
3753
|
+
div_obj.addClass("table-responsive");
|
3754
|
+
}
|
3751
3755
|
localStorage[tab_token] = div_id;
|
3752
3756
|
switch_func();
|
3753
3757
|
}
|
@@ -3756,7 +3760,11 @@ const Util = {
|
|
3756
3760
|
});
|
3757
3761
|
$("#" + tab_token + " li").removeClass("active");
|
3758
3762
|
$("#" + localStorage[tab_token]).addClass("active");
|
3759
|
-
$("#" + localStorage[tab_token] + "_div")
|
3763
|
+
let div_obj = $("#" + localStorage[tab_token] + "_div");
|
3764
|
+
div_obj.removeClass("hide");
|
3765
|
+
if (Util.is_mobile() && !div_obj.hasClass("table-responsive")) {
|
3766
|
+
div_obj.addClass("table-responsive");
|
3767
|
+
}
|
3760
3768
|
},
|
3761
3769
|
|
3762
3770
|
/**
|