sbd-npm 1.3.74 → 1.3.75

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.3.74",
3
+ "version": "1.3.75",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/status.js CHANGED
@@ -24,6 +24,9 @@ $(function () {
24
24
  case "database_table":
25
25
  Status.handle_database_table();
26
26
  break;
27
+ case "database_variable":
28
+ Status.handle_database_variable();
29
+ break;
27
30
  case "request_headers":
28
31
  Status.handle_request_headers();
29
32
  break;
@@ -246,7 +249,7 @@ $(function () {
246
249
  {"name": "序号", "table_sort": 1},
247
250
  {"name": "表名", "table_sort": 1},
248
251
  {"name": "表引擎", "table_sort": 1},
249
- {"name": "行记录格式"},
252
+ {"name": "行格式", "table_sort": 1},
250
253
  {"name": "数据量", "table_sort": 1},
251
254
  {"name": "数据大小", "table_sort": 1, "class": "info"},
252
255
  {"name": "索引大小", "table_sort": 1},
@@ -279,6 +282,34 @@ $(function () {
279
282
  });
280
283
  },
281
284
 
285
+ handle_database_variable: function () {
286
+ if (!document.getElementById("database_variable_div_body")) {
287
+ Util.init_table_skeleton({
288
+ "element_id": "database_variable_div",
289
+ "caption": '<caption class="text-right" id="database_variable_num"></caption>',
290
+ "head_cols": [
291
+ {"name": "序号", "style": "width: 100px;", "table_sort": 1},
292
+ {"name": "键", "table_sort": 1},
293
+ {"name": "值", "table_sort": 1},
294
+ ]
295
+ });
296
+ }
297
+ Util.post(location.pathname, {active_div: localStorage[Status.tab_token]}, function (j) {
298
+ let html = [], database_variable_num = 0;
299
+ j["data"].forEach(function (item) {
300
+ database_variable_num++;
301
+ html.push("<tr>");
302
+ html.push("<td>", database_variable_num, "</td>");
303
+ html.push("<td class='text-right'>", item["key"], "</td>");
304
+ html.push("<td class='text-left' style='word-break: break-all'>", item["val"], "</td>");
305
+ html.push("</tr>");
306
+ });
307
+ Util.render_table_html("database_variable_div_body", html);
308
+ $("#database_variable_num").html("共 <span class='label label-info'>" + database_variable_num + "</span> 条");
309
+ Util.hide_tips();
310
+ });
311
+ },
312
+
282
313
  handle_request_headers: function () {
283
314
  if (!document.getElementById("request_headers_div_body")) {
284
315
  Util.init_table_skeleton({
@@ -519,6 +550,9 @@ $(function () {
519
550
  let city = data["city"] ? data["city"] : "";
520
551
  let district = data["district"] ? data["district"] : "";
521
552
  let isp = data["isp"] ? (" - " + data["isp"]) : "";
553
+ if (country === city) {
554
+ country = "";
555
+ }
522
556
  if (country === province || province === city) {
523
557
  province = "";
524
558
  }
package/summary_daily.js CHANGED
@@ -299,25 +299,28 @@ $(function () {
299
299
  pack_market_overview: function (market_overview_dict) {
300
300
  let _html = [], previous_mo_amount = 0, mo_amount = 0, mo_amount_cls = "", mo_amount_sign = "";
301
301
  for (let market_type in market_overview_dict) {
302
- if (market_overview_dict.hasOwnProperty(market_type)) {
303
- let market = market_overview_dict[market_type];
302
+ if (market_overview_dict.hasOwnProperty(market_type) && market_overview_dict[market_type]["name"]) {
303
+ let market_capital = "--", pe = "--", volume = "--", amount = "--", market = market_overview_dict[market_type];
304
+ _html.push("<tr>");
305
+ _html.push("<td style='padding: 18px 0;'>", Util.pack_html_link(market["url"], market["name"]), "</td>");
304
306
  if (market["item"]) {
305
307
  if (market_type !== 5 && market["item"]) {
306
308
  previous_mo_amount += market["item"]["prev_amount"];
307
309
  mo_amount += market["item"]["amount"];
308
310
  }
309
- _html.push("<tr>");
310
- _html.push("<td style='padding: 18px 0;'>", Util.pack_html_link(market["url"], market["name"]), "</td>");
311
- if (!market["item"]["market_capital"] && market["item"]["prev_market_capital"]) {
312
- market["item"]["market_capital"] = market["item"]["prev_market_capital"];
311
+ if (market["item"]["market_capital"] && market["item"]["market_capital"] > 0) {
312
+ market_capital = market["item"]["market_capital"] + "万亿";
313
+ } else if (market["item"]["prev_market_capital"] && market["item"]["prev_market_capital"] > 0) {
314
+ market_capital = market["item"]["prev_market_capital"] + "万亿";
315
+ }
316
+ if (market["item"]["pe"]) {
317
+ pe = market["item"]["pe"];
318
+ } else if (market["item"]["prev_pe"]) {
319
+ pe = market["item"]["prev_pe"];
313
320
  }
314
- _html.push("<td style='padding: 18px 0;'>", (market["item"]["market_capital"] ? (market["item"]["market_capital"] + "万亿") : "--"), "</td>");
315
- if (!market["item"]["pe"] && market["item"]["prev_pe"]) {
316
- market["item"]["pe"] = market["item"]["prev_pe"];
321
+ if (market["item"]["volume"] && market["item"]["volume"] > 0) {
322
+ volume = market["item"]["volume"] + "亿股";
317
323
  }
318
- _html.push("<td style='padding: 18px 0;'>", (market["item"]["pe"] ? market["item"]["pe"] : "--"), "</td>");
319
- _html.push("<td style='padding: 18px 0;'>", (market["item"]["volume"] ? (market["item"]["volume"] + "亿股") : "--"), "</td>");
320
- let amount = "--";
321
324
  if (market["item"]["amount"] && market["item"]["amount"] > 0) {
322
325
  if (market["item"]["prev_amount"] && market["item"]["prev_amount"] > 0 && market["item"]["amount"] !== market["item"]["prev_amount"]) {
323
326
  if (market["item"]["amount"] > market["item"]["prev_amount"]) {
@@ -329,9 +332,12 @@ $(function () {
329
332
  amount = market["item"]["amount"] + "亿";
330
333
  }
331
334
  }
332
- _html.push("<td style='padding: 18px 0;'>", amount, "</td>");
333
- _html.push("</tr>");
334
335
  }
336
+ _html.push("<td style='padding: 18px 0;'>", market_capital, "</td>");
337
+ _html.push("<td style='padding: 18px 0;'>", pe, "</td>");
338
+ _html.push("<td style='padding: 18px 0;'>", volume, "</td>");
339
+ _html.push("<td style='padding: 18px 0;'>", amount, "</td>");
340
+ _html.push("</tr>");
335
341
  }
336
342
  }
337
343
  $("#market_overview_zone").html(_html.join(""));
package/util.js CHANGED
@@ -674,7 +674,15 @@ const Util = {
674
674
  let weekday = date.getDay();
675
675
  if (weekday > 0 && weekday < 6) {
676
676
  let hour = date.getHours();
677
- return hour >= 9 && hour < 15 && hour !== 12;
677
+ if (hour === 9) {
678
+ let minute = date.getMinutes();
679
+ return minute >= 30;
680
+ } else if (hour === 11) {
681
+ let minute = date.getMinutes();
682
+ return minute <= 30;
683
+ } else {
684
+ return hour > 9 && hour < 15 && hour !== 12;
685
+ }
678
686
  }
679
687
  return false;
680
688
  },