sbd-npm 1.5.35 → 1.5.37
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 +28 -23
- package/util.js +11 -11
package/package.json
CHANGED
package/status.js
CHANGED
|
@@ -77,9 +77,9 @@ $(function () {
|
|
|
77
77
|
let html = [];
|
|
78
78
|
if (!document.getElementById("start_time")) {
|
|
79
79
|
let error_tips = j.error_num > 0 ? ("class='danger' title='" + j.error_num + "' ") : "";
|
|
80
|
-
html.push("<tr><th ", error_tips, "width='25%'>系统时区</th><td>", Status.map_url(j.timezone), "</td>");
|
|
81
|
-
html.push("<th id='start_time' width='25%'>服务器运行时间</th><td colspan='3'>", Util.seconds_to_format(j.start_time), "(" + j.
|
|
82
|
-
html.push("<tr><th
|
|
80
|
+
html.push("<tr><th ", error_tips, "width='25%'>系统时区</th><td>", Status.map_url(j.timezone), " (", j.timestamp_server, ")</td>");
|
|
81
|
+
html.push("<th id='start_time' width='25%'>服务器运行时间</th><td colspan='3'>", Util.seconds_to_format(j.start_time), " (" + j.uptime + ")</td></tr>");
|
|
82
|
+
html.push("<tr><th>凌晨ALL任务完成时间</th><td>", Util.seconds_to_format(j.sync_end_time), "</td>");
|
|
83
83
|
html.push("<th>数据库句柄更新时间</th><td colspan='3'>", Util.seconds_to_format(j.db_time), "</td></tr>");
|
|
84
84
|
// 数据库
|
|
85
85
|
html.push("<tr><th>数据库版本</th><td>", j.db_version, "</td>");
|
|
@@ -93,7 +93,7 @@ $(function () {
|
|
|
93
93
|
});
|
|
94
94
|
mysql_remote_ip = mri_html.join("、");
|
|
95
95
|
}
|
|
96
|
-
html.push("<tr><th><a data-toggle='modal' data-target='.
|
|
96
|
+
html.push("<tr><th><a data-toggle='modal' data-target='.mysql_ssh_modal'>数据库正在连接的IP</a></th><td colspan='5'>", mysql_remote_ip, "</td></tr>");
|
|
97
97
|
|
|
98
98
|
let max_files_tips = "系统允许打开的最大文件描述符数量(即每个进程最多能打开多少个文件,包括网络连接、管道、实际文件等)";
|
|
99
99
|
html.push("<tr><th>最大文件描述符数量 <i class='glyphicon glyphicon-info-sign' data-toggle='tooltip' data-original-title='", max_files_tips, "'></i></th><td>", (j.max_files == "None" ? "--" : j.max_files), "</td>");
|
|
@@ -190,9 +190,9 @@ $(function () {
|
|
|
190
190
|
});
|
|
191
191
|
},
|
|
192
192
|
|
|
193
|
-
|
|
193
|
+
fetch_mysql_ssh_ip_data: function() {
|
|
194
194
|
Util.show_loading();
|
|
195
|
-
Util.post(location.pathname, {"active_div": "
|
|
195
|
+
Util.post(location.pathname, {"active_div": "mysql_ssh_ip", "data_type": $("#mysql_ssh_type").val(), "filter_type": $("#mysql_ssh_filter").val()}, function (j) {
|
|
196
196
|
let html = [], ip_num = 0;
|
|
197
197
|
j.data.forEach(function (item) {
|
|
198
198
|
ip_num++;
|
|
@@ -209,9 +209,9 @@ $(function () {
|
|
|
209
209
|
html.push("<td>", Util.seconds_to_format(item.latest_time), "</td>");
|
|
210
210
|
html.push("</tr>");
|
|
211
211
|
});
|
|
212
|
-
Util.render_table_html("
|
|
213
|
-
$("#
|
|
214
|
-
$("#
|
|
212
|
+
Util.render_table_html("mysql_ssh_modal_body_body", html);
|
|
213
|
+
$("#mysql_ssh_summary").html(" 共 <span class='label label-info'>" + j.total_len + "</span> 条,屏蔽 <span class='label label-danger'>" + j.block_len + "</span> 条");
|
|
214
|
+
$("#mysql_ssh_modal_body_body .block_ip").each(function() {
|
|
215
215
|
$(this).click(function() {
|
|
216
216
|
let ip = $(this).parent().parent().children('td').eq(1).text();
|
|
217
217
|
let ip_address = $(this).parent().parent().children('td').eq(2).text();
|
|
@@ -1716,13 +1716,13 @@ $(function () {
|
|
|
1716
1716
|
Util.set_table_loading("mysql_process_modal_body_body");
|
|
1717
1717
|
});
|
|
1718
1718
|
|
|
1719
|
-
Util.init_modal_skeleton("
|
|
1720
|
-
$("#
|
|
1719
|
+
Util.init_modal_skeleton("mysql_ssh_modal");
|
|
1720
|
+
$("#mysql_ssh_modal_title").html("连接 <select id='mysql_ssh_type'><option value='1'>MySQL</option><option value='2'>SSH</option></select> 的IP日志统计数据");
|
|
1721
1721
|
Util.init_table_skeleton({
|
|
1722
|
-
"element_id": "
|
|
1723
|
-
"caption": '<caption class="' + (Util.is_mobile() ? "text-left" : "text-right") + '" id="
|
|
1722
|
+
"element_id": "mysql_ssh_modal_body",
|
|
1723
|
+
"caption": '<caption class="' + (Util.is_mobile() ? "text-left" : "text-right") + '" id="mysql_ssh_summary"></caption>',
|
|
1724
1724
|
"head_columns": [
|
|
1725
|
-
{"name": "", "select_id": "
|
|
1725
|
+
{"name": "", "select_id": "mysql_ssh_filter", "select_options": [{"key": "0", "val": "全部"},{"key": "1", "val": "正常"},{"key": "2", "val": "屏蔽"},{"key": "3", "val": "异常"}]},
|
|
1726
1726
|
{"name": "IP", "table_sort": 1, "tooltip": "IP地址(Internet Protocol Address)是指互联网协议地址"},
|
|
1727
1727
|
{"name": "地址信息", "table_sort": 1},
|
|
1728
1728
|
{"name": "连接次数", "table_sort": 1},
|
|
@@ -1730,19 +1730,24 @@ $(function () {
|
|
|
1730
1730
|
{"name": "最后一次连接时间", "class": "info", "table_sort": 1},
|
|
1731
1731
|
]
|
|
1732
1732
|
});
|
|
1733
|
-
$("#
|
|
1734
|
-
$("#
|
|
1735
|
-
Util.set_table_loading("
|
|
1736
|
-
Status.
|
|
1733
|
+
$("#mysql_ssh_type").change(function() {
|
|
1734
|
+
$("#mysql_ssh_summary").html("");
|
|
1735
|
+
Util.set_table_loading("mysql_ssh_modal_body_body");
|
|
1736
|
+
Status.fetch_mysql_ssh_ip_data();
|
|
1737
1737
|
});
|
|
1738
|
-
|
|
1738
|
+
$("#mysql_ssh_filter").change(function() {
|
|
1739
|
+
$("#mysql_ssh_summary").html("");
|
|
1740
|
+
Util.set_table_loading("mysql_ssh_modal_body_body");
|
|
1741
|
+
Status.fetch_mysql_ssh_ip_data();
|
|
1742
|
+
});
|
|
1743
|
+
let mam_object = $('#mysql_ssh_modal');
|
|
1739
1744
|
mam_object.on('shown.bs.modal', function (e) {
|
|
1740
|
-
$("#
|
|
1741
|
-
Status.
|
|
1745
|
+
$("#mysql_ssh_filter").val("0");
|
|
1746
|
+
Status.fetch_mysql_ssh_ip_data();
|
|
1742
1747
|
});
|
|
1743
1748
|
mam_object.on('hidden.bs.modal', function () {
|
|
1744
|
-
$("#
|
|
1745
|
-
Util.set_table_loading("
|
|
1749
|
+
$("#mysql_ssh_summary").html("");
|
|
1750
|
+
Util.set_table_loading("mysql_ssh_modal_body_body");
|
|
1746
1751
|
});
|
|
1747
1752
|
|
|
1748
1753
|
let request_arguments = Util.request_arguments();
|
package/util.js
CHANGED
|
@@ -2901,27 +2901,27 @@ const Util = {
|
|
|
2901
2901
|
|
|
2902
2902
|
/**
|
|
2903
2903
|
* 提示信息显示
|
|
2904
|
-
* @param
|
|
2904
|
+
* @param message
|
|
2905
2905
|
* @param interval 信息持续的时间(毫秒,到期则关闭)
|
|
2906
2906
|
* @param cls 样式:alert-warning | alert-danger
|
|
2907
2907
|
* @param loading 设置加载状态效果表现
|
|
2908
2908
|
*/
|
|
2909
|
-
show_tips: function (
|
|
2909
|
+
show_tips: function (message, interval = 0, cls = "", loading = 0) {
|
|
2910
2910
|
let tips_object = document.getElementById(Util.tips_token);
|
|
2911
2911
|
if (tips_object) {
|
|
2912
2912
|
if (loading > 0) {
|
|
2913
|
-
let
|
|
2913
|
+
let origin_message = message.replace(/\./g, '');
|
|
2914
2914
|
let origin_txt = tips_object.innerText.replace(/\./g, '');
|
|
2915
|
-
if (
|
|
2915
|
+
if (origin_message === origin_txt) {
|
|
2916
2916
|
loading = loading < 5 ? (loading + 1) : 1;
|
|
2917
2917
|
let load_string = ".".repeat(loading);
|
|
2918
|
-
tips_object.innerHTML =
|
|
2918
|
+
tips_object.innerHTML = origin_message + load_string;
|
|
2919
2919
|
setTimeout(() => {
|
|
2920
|
-
Util.show_tips(
|
|
2920
|
+
Util.show_tips(message, interval, cls, loading);
|
|
2921
2921
|
}, 300);
|
|
2922
2922
|
}
|
|
2923
2923
|
} else {
|
|
2924
|
-
tips_object.innerHTML =
|
|
2924
|
+
tips_object.innerHTML = message;
|
|
2925
2925
|
}
|
|
2926
2926
|
} else {
|
|
2927
2927
|
if (loading === 0) {
|
|
@@ -2929,15 +2929,15 @@ const Util = {
|
|
|
2929
2929
|
tips_object.id = Util.tips_token;
|
|
2930
2930
|
tips_object.className = "alert " + (cls === "" ? "alert-warning" : cls);
|
|
2931
2931
|
tips_object.style = "position: fixed; right: 0; top: 0; z-index: 999;";
|
|
2932
|
-
tips_object.innerHTML =
|
|
2932
|
+
tips_object.innerHTML = message;
|
|
2933
2933
|
document.getElementsByTagName('body')[0].appendChild(tips_object);
|
|
2934
2934
|
if (interval > 0) {
|
|
2935
2935
|
setTimeout(Util.hide_tips, interval);
|
|
2936
2936
|
}
|
|
2937
|
-
if (
|
|
2938
|
-
loading =
|
|
2937
|
+
if (message.endsWith('.')) {
|
|
2938
|
+
loading = message.replace(/[^.]/g, '').length;
|
|
2939
2939
|
setTimeout(() => {
|
|
2940
|
-
Util.show_tips(
|
|
2940
|
+
Util.show_tips(message, interval, cls, loading);
|
|
2941
2941
|
}, 200);
|
|
2942
2942
|
}
|
|
2943
2943
|
}
|