sbd-npm 1.4.85 → 1.4.87

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 +17 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.4.85",
3
+ "version": "1.4.87",
4
4
  "description": "Stock Big Data",
5
5
  "author": "DHQ <dhq314@gmail.com>",
6
6
  "license": "ISC",
package/status.js CHANGED
@@ -171,14 +171,14 @@ $(function () {
171
171
  html.push("</tr>");
172
172
  });
173
173
  Util.render_table_html("mysql_process_modal_body_body", html);
174
- $("#mysql_process_summary").html(" <span class='label label-info'>" + current_connections + "</span> 条");
174
+ $("#mysql_process_summary").html("&nbsp;&nbsp;共 <span class='label label-info'>" + current_connections + "</span> 条");
175
175
  Util.hide_tips();
176
176
  });
177
177
  },
178
178
 
179
179
  fetch_mysql_access_data: function() {
180
180
  Util.show_loading();
181
- Util.post(location.pathname, {"active_div": "mysql_access"}, function (j) {
181
+ Util.post(location.pathname, {"active_div": "mysql_access", "filter_type": $("#mysql_access_filter").val()}, function (j) {
182
182
  let html = [], ip_num = 0;
183
183
  j["data"].forEach(function (item) {
184
184
  ip_num++;
@@ -196,7 +196,7 @@ $(function () {
196
196
  html.push("</tr>");
197
197
  });
198
198
  Util.render_table_html("mysql_access_modal_body_body", html);
199
- $("#mysql_access_summary").html(" <span class='label label-info'>" + ip_num + "</span> 条");
199
+ $("#mysql_access_summary").html("&nbsp;&nbsp;共 <span class='label label-info'>" + j["total_len"] + "</span> 条,屏蔽 <span class='label label-danger'>" + j["block_len"] + "</span> 条");
200
200
  $("#mysql_access_modal_body_body .block_ip").each(function() {
201
201
  $(this).click(function() {
202
202
  let ip = $(this).parent().parent().children('td').eq(1).text();
@@ -227,6 +227,8 @@ $(function () {
227
227
  }
228
228
  });
229
229
  }
230
+ } else {
231
+ Util.show_tips("IP值异常:" + ip, 4567, "alert-danger");
230
232
  }
231
233
  },
232
234
 
@@ -326,7 +328,7 @@ $(function () {
326
328
  }
327
329
  Util.post(location.pathname, {active_div: "get_block_ip"}, function (j) {
328
330
  let html = [], ip_num = j["num"];
329
- $("#block_ip_num").html(" <span class='label label-info'>" + ip_num + "</span> 条(" + j["total_ip_num"] + ")&nbsp;");
331
+ $("#block_ip_num").html("&nbsp;&nbsp;共 <span class='label label-info'>" + ip_num + "</span> 条(" + j["total_ip_num"] + ")&nbsp;");
330
332
  j["data"].forEach(function (item) {
331
333
  html.push("<tr>");
332
334
  html.push("<td>", ip_num, "</td>");
@@ -457,7 +459,7 @@ $(function () {
457
459
  html.push("</tr>");
458
460
  });
459
461
  Util.render_table_html("database_variable_div_body", html);
460
- $("#database_variable_num").html(" <span class='label label-info'>" + database_variable_num + "</span> 条&nbsp;&nbsp;");
462
+ $("#database_variable_num").html("&nbsp;&nbsp;共 <span class='label label-info'>" + database_variable_num + "</span> 条&nbsp;&nbsp;");
461
463
  Util.hide_tips();
462
464
  });
463
465
  },
@@ -517,7 +519,7 @@ $(function () {
517
519
  html.push("</tr>");
518
520
  });
519
521
  Util.render_table_html("environment_div_body", html);
520
- $("#environment_num").html(" <span class='label label-info'>" + environment_num + "</span> 条&nbsp;&nbsp;");
522
+ $("#environment_num").html("&nbsp;&nbsp;共 <span class='label label-info'>" + environment_num + "</span> 条&nbsp;&nbsp;");
521
523
  Util.hide_tips();
522
524
  });
523
525
  },
@@ -559,7 +561,7 @@ $(function () {
559
561
  html.push("</tr>");
560
562
  });
561
563
  Util.render_table_html("sysctl_div_body", html);
562
- $("#sysctl_num").html(" <span class='label label-info'>" + sysctl_num + "</span> 条&nbsp;&nbsp;");
564
+ $("#sysctl_num").html("&nbsp;&nbsp;共 <span class='label label-info'>" + sysctl_num + "</span> 条&nbsp;&nbsp;");
563
565
  Util.hide_tips();
564
566
  });
565
567
  },
@@ -1640,6 +1642,7 @@ $(function () {
1640
1642
  Status.fetch_mysql_process_data();
1641
1643
  });
1642
1644
  mpm_obj.on('hidden.bs.modal', function () {
1645
+ $("#mysql_process_summary").html("");
1643
1646
  Util.set_table_loading("mysql_process_modal_body_body");
1644
1647
  });
1645
1648
 
@@ -1649,7 +1652,7 @@ $(function () {
1649
1652
  "element_id": "mysql_access_modal_body",
1650
1653
  "caption": '<caption class="' + (Util.is_mobile() ? "text-left" : "text-right") + '" id="mysql_access_summary"></caption>',
1651
1654
  "head_cols": [
1652
- {"name": "序号", "table_sort": 1},
1655
+ {"name": "", "select_id": "mysql_access_filter", "select_options": [{"key": "0", "val": "全部"},{"key": "1", "val": "正常"},{"key": "2", "val": "屏蔽"}]},
1653
1656
  {"name": "IP", "table_sort": 1, "tooltip": "IP地址(Internet Protocol Address)是指互联网协议地址"},
1654
1657
  {"name": "地址信息", "table_sort": 1},
1655
1658
  {"name": "连接次数", "table_sort": 1},
@@ -1657,11 +1660,17 @@ $(function () {
1657
1660
  {"name": "最后一次连接时间", "class": "info", "table_sort": 1},
1658
1661
  ]
1659
1662
  });
1663
+ $("#mysql_access_filter").change(function() {
1664
+ $("#mysql_access_summary").html("");
1665
+ Util.set_table_loading("mysql_access_modal_body_body");
1666
+ Status.fetch_mysql_access_data();
1667
+ });
1660
1668
  let mam_obj = $('#mysql_access_modal');
1661
1669
  mam_obj.on('shown.bs.modal', function (e) {
1662
1670
  Status.fetch_mysql_access_data();
1663
1671
  });
1664
1672
  mam_obj.on('hidden.bs.modal', function () {
1673
+ $("#mysql_access_summary").html("");
1665
1674
  Util.set_table_loading("mysql_access_modal_body_body");
1666
1675
  });
1667
1676