sbd-npm 1.4.94 → 1.4.96

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.4.94",
3
+ "version": "1.4.96",
4
4
  "description": "Stock Big Data",
5
5
  "author": "DHQ <dhq314@gmail.com>",
6
6
  "license": "ISC",
package/status.js CHANGED
@@ -117,8 +117,8 @@ $(function () {
117
117
  }
118
118
  Status.render_ip_daily(j["ip_daily_data"]);
119
119
 
120
- if (j["phone_num"]) {
121
- $("#phone_query_head").attr("title", j["phone_num"]);
120
+ if (j.phone_num) {
121
+ $("#phone_query_head").attr("title", j.phone_num);
122
122
  }
123
123
  if (j["ip_date"]) {
124
124
  let id_obj = $("#ip_date");
@@ -172,7 +172,7 @@ $(function () {
172
172
  Util.show_loading();
173
173
  Util.post(location.pathname, {"active_div": "mysql_process"}, function (j) {
174
174
  let html = [], current_connections = 0;
175
- j["data"].forEach(function (item) {
175
+ j.data.forEach(function (item) {
176
176
  current_connections++;
177
177
  html.push("<tr>");
178
178
  html.push("<td>", item["Id"], "</td>");
@@ -195,7 +195,7 @@ $(function () {
195
195
  Util.show_loading();
196
196
  Util.post(location.pathname, {"active_div": "mysql_access", "filter_type": $("#mysql_access_filter").val()}, function (j) {
197
197
  let html = [], ip_num = 0;
198
- j["data"].forEach(function (item) {
198
+ j.data.forEach(function (item) {
199
199
  ip_num++;
200
200
  if (item["is_block"] === 1) {
201
201
  html.push("<tr class='danger'>");
@@ -296,10 +296,10 @@ $(function () {
296
296
  let html = [], process_num = 0;
297
297
  let screen_pid = j["screen_pid"] ? j["screen_pid"] : 0;
298
298
  let screen_pid_date = j["screen_pid_date"] ? j["screen_pid_date"] : 0;
299
- j["data"].forEach(function (item) {
299
+ j.data.forEach(function (item) {
300
300
  process_num++;
301
301
  let is_screen = 0;
302
- if (screen_pid === item["pid"]) {
302
+ if (screen_pid === item.pid) {
303
303
  is_screen = 1;
304
304
  } else {
305
305
  let parameter = Status.match_cmdline_parameter(item["cmdline"]);
@@ -308,15 +308,15 @@ $(function () {
308
308
  }
309
309
  }
310
310
  html.push("<tr>");
311
- html.push("<td>", item["pid"], "</td>");
312
- html.push("<td>", item["name"], "</td>");
311
+ html.push("<td>", item.pid, "</td>");
312
+ html.push("<td>", item.name, "</td>");
313
313
  html.push("<td>", item["username"], "</td>");
314
314
  html.push("<td>", item["status"], "</td>");
315
315
  html.push("<td data-val='", item["rss"], "'>", Util.trans_byte_size(item["rss"]), "</td>");
316
316
  html.push("<td data-val='", item["vms"], "'>", Util.trans_byte_size(item["vms"]), "</td>");
317
317
  html.push("<td title='", item["cmdline"], "'>", Util.substring(item["cmdline"], 60), "</td>");
318
318
  html.push("<td>", Util.seconds_to_format(item["create_time"]), "</td>");
319
- html.push(Status.pack_screen_html(is_screen, item["pid"], screen_pid, screen_pid_date, item["cmdline"]));
319
+ html.push(Status.pack_screen_html(is_screen, item.pid, screen_pid, screen_pid_date, item["cmdline"]));
320
320
  html.push("</tr>");
321
321
  });
322
322
  Util.render_table_html("process_div_body", html);
@@ -344,7 +344,7 @@ $(function () {
344
344
  Util.post(location.pathname, {active_div: "get_block_ip"}, function (j) {
345
345
  let html = [], ip_num = j["num"];
346
346
  $("#block_ip_num").html("&nbsp;&nbsp;共 <span class='label label-info'>" + ip_num + "</span> 条(" + j["total_ip_num"] + ")&nbsp;");
347
- j["data"].forEach(function (item) {
347
+ j.data.forEach(function (item) {
348
348
  html.push("<tr>");
349
349
  html.push("<td>", ip_num, "</td>");
350
350
  html.push("<td>", Util.pack_html_link(Status.ip_url(item["ip"]), item["ip"]), "</td>");
@@ -374,16 +374,15 @@ $(function () {
374
374
  }
375
375
  Util.post(location.pathname, {active_div: localStorage[Status.tab_token]}, function (j) {
376
376
  let html = [], login_num = 0;
377
- j["data"].forEach(function (item) {
377
+ j.data.forEach(function (item) {
378
378
  login_num++;
379
- let cls = item["date"].indexOf('logged in') > -1 ? "danger" : "";
380
- html.push("<tr class='", cls, "'>");
379
+ html.push("<tr", (item.date.includes('logged in') ? " class='danger'" : ""), ">");
381
380
  html.push("<td>", login_num, "</td>");
382
381
  html.push("<td>", item["user"], "</td>");
383
382
  html.push("<td>", item["terminal"], "</td>");
384
383
  html.push("<td>", Status.pack_ip_link(item["ip"]), "</td>");
385
384
  html.push("<td>", Status.map_url(Status.convert_ip_address(item)), "</td>");
386
- html.push("<td>", item["date"], "</td>");
385
+ html.push("<td>", item.date, "</td>");
387
386
  html.push("</tr>");
388
387
  });
389
388
  Util.render_table_html("login_log_div_body", html);
@@ -413,7 +412,7 @@ $(function () {
413
412
  }
414
413
  Util.post(location.pathname, {active_div: localStorage[Status.tab_token]}, function (j) {
415
414
  let html = [], table_num = 0;
416
- j["data"].forEach(function (item) {
415
+ j.data.forEach(function (item) {
417
416
  table_num++;
418
417
  html.push("<tr>");
419
418
  html.push("<td>", table_num, "</td>");
@@ -458,19 +457,19 @@ $(function () {
458
457
  }
459
458
  Util.post(location.pathname, {active_div: localStorage[Status.tab_token]}, function (j) {
460
459
  let html = [], database_variable_num = 0;
461
- j["data"].forEach(function (item) {
460
+ j.data.forEach(function (item) {
462
461
  database_variable_num++;
463
462
  html.push("<tr>");
464
463
  if (is_mobile) {
465
- html.push("<td class='text-left' style='word-break: break-all'>", item["key"], "</td>");
464
+ html.push("<td class='text-left' style='word-break: break-all'>", item.key, "</td>");
466
465
  } else {
467
466
  html.push("<td>", database_variable_num, "</td>");
468
- html.push("<td class='text-right'>", item["key"], "</td>");
467
+ html.push("<td class='text-right'>", item.key, "</td>");
469
468
  }
470
- if (item["key"] === "innodb_buffer_pool_size") {
471
- item["val"] += " (" + Util.trans_byte_size(item["val"]) + ")";
469
+ if (item.key === "innodb_buffer_pool_size") {
470
+ item.val += " (" + Util.trans_byte_size(item.val) + ")";
472
471
  }
473
- html.push("<td class='text-left' style='word-break: break-all'>", item["val"], "</td>");
472
+ html.push("<td class='text-left' style='word-break: break-all'>", item.val, "</td>");
474
473
  html.push("</tr>");
475
474
  });
476
475
  Util.render_table_html("database_variable_div_body", html);
@@ -526,11 +525,11 @@ $(function () {
526
525
  }
527
526
  Util.post(location.pathname, {active_div: localStorage[Status.tab_token]}, function (j) {
528
527
  let html = [], environment_num = 0;
529
- j["data"].forEach(function (item) {
528
+ j.data.forEach(function (item) {
530
529
  environment_num++;
531
530
  html.push("<tr>");
532
- html.push("<td class='text-right'>", item["key"], "</td>");
533
- html.push("<td class='text-left' style='word-break: break-all'>", item["val"], "</td>");
531
+ html.push("<td class='text-right'>", item.key, "</td>");
532
+ html.push("<td class='text-left' style='word-break: break-all'>", item.val, "</td>");
534
533
  html.push("</tr>");
535
534
  });
536
535
  Util.render_table_html("environment_div_body", html);
@@ -563,7 +562,7 @@ $(function () {
563
562
  }
564
563
  Util.post(location.pathname, {active_div: localStorage[Status.tab_token]}, function (j) {
565
564
  let html = [], sysctl_num = 0;
566
- j["data"].forEach(function (item) {
565
+ j.data.forEach(function (item) {
567
566
  sysctl_num++;
568
567
  html.push("<tr>");
569
568
  if (is_mobile) {
@@ -836,7 +835,7 @@ $(function () {
836
835
  is_xmr = 1;
837
836
  is_screen = 1;
838
837
  } else {
839
- if (screen_pid === item["pid"]) {
838
+ if (screen_pid === item.pid) {
840
839
  is_screen = 1;
841
840
  } else {
842
841
  let parameter = Status.match_cmdline_parameter(item["cmdline"]);
@@ -850,7 +849,7 @@ $(function () {
850
849
  } else {
851
850
  html.push("<tr>");
852
851
  }
853
- html.push("<td>", item["pid"], "</td>");
852
+ html.push("<td>", item.pid, "</td>");
854
853
  html.push("<td>", item["status"], "</td>");
855
854
  let cmdline = Util.substring(item["cmdline"], 100);
856
855
  if (is_xmr === 1) {
@@ -859,11 +858,11 @@ $(function () {
859
858
  html.push("<td title='", item["cmdline"], "'>", cmdline, "</td>");
860
859
  }
861
860
  html.push("<td>", Util.seconds_to_format(item["create_time"]), "</td>");
862
- html.push(Status.pack_screen_html(is_screen, item["pid"], screen_pid, screen_pid_date, item["cmdline"]));
861
+ html.push(Status.pack_screen_html(is_screen, item.pid, screen_pid, screen_pid_date, item["cmdline"]));
863
862
  html.push("</tr>");
864
863
  });
865
864
  Util.render_table_html("machine_process_div_body", html);
866
- $("#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"]);
865
+ $("#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"]);
867
866
  $("#machines option[value='" + j["machine_id"] + "']").text(j["ip"] + "(" + process_num + ")");
868
867
  // 终止进程
869
868
  Status.handle_process_kill("machine_process_div_body", 2);
@@ -921,8 +920,8 @@ $(function () {
921
920
  let machine_id = action_type === 2 ? $("#machines").val() : "";
922
921
  Util.post(location.pathname, {active_div: "machine_screen", "machine_id": machine_id, "pid": pid, "instruction": instruction}, function (j) {
923
922
  Util.hide_tips();
924
- if (j["data"]) {
925
- Util.showAlert(j["data"]);
923
+ if (j.data) {
924
+ Util.showAlert(j.data);
926
925
  } else {
927
926
  Util.show_tips("数据异常!", 4567, "alert-danger");
928
927
  }
@@ -1121,7 +1120,7 @@ $(function () {
1121
1120
  Status.pack_machine_component("machine_instruction_machine", j["machines"]);
1122
1121
  let machine = $("#machines").val();
1123
1122
  if (machine) {
1124
- $("#machine_instruction_machine").find("option[value='" + machine + "']").attr("selected", true);
1123
+ $("#machine_instruction_machine").val(machine);
1125
1124
  }
1126
1125
  }
1127
1126
  if (j["instructions"]) {
@@ -1210,7 +1209,7 @@ $(function () {
1210
1209
  Status.pack_machine_component("machine_cookie_machine", j["machines"]);
1211
1210
  let machine = $("#machines").val();
1212
1211
  if (machine) {
1213
- $("#machine_cookie_machine").find("option[value='" + machine + "']").attr("selected", true);
1212
+ $("#machine_cookie_machine").val(machine);
1214
1213
  }
1215
1214
  }
1216
1215
  Util.hide_tips();
@@ -1296,7 +1295,7 @@ $(function () {
1296
1295
  if (j["word"]) {
1297
1296
  $("#word_value").val(j["word"]);
1298
1297
  $("#word_chinese").val(j["chinese"]);
1299
- $("#word_modal_title").html(Util.pack_html_link("https://cn.bing.com/dict/search?q=" + j["word"], "随机单词") + " <span style='color: #BDBDBD;'>(" + Util.seconds_to_format(j["date"]) + ")</span>");
1298
+ $("#word_modal_title").html(Util.pack_html_link("https://cn.bing.com/dict/search?q=" + j["word"], "随机单词") + " <span style='color: #BDBDBD;'>(" + Util.seconds_to_format(j.date) + ")</span>");
1300
1299
  }
1301
1300
  });
1302
1301
  } else {