sbd-npm 1.4.58 → 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/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) + ' ');
|