sbd-npm 1.4.21 → 1.4.23
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/constant.js +2 -1
- package/package.json +2 -2
- package/status.js +85 -85
- package/stock_basics.js +143 -143
- package/summary_daily.js +56 -56
- package/util.js +295 -293
package/constant.js
CHANGED
@@ -23,6 +23,8 @@ const MenuList = [
|
|
23
23
|
'name': '趋势分析',
|
24
24
|
'icon': 'edit',
|
25
25
|
'menu': [
|
26
|
+
{'key': 'trend_boll_breakthrough', 'name': '布林中轨突破', 'url': '/0x948dafbd3c218b21bb8a63e75ba0dcf01c48cf05'},
|
27
|
+
{'key': 'trend_boll_lower_band', 'name': '布林下轨统计分析', 'url': '/0x3b8132154797a6971a73da743122cb1e8a3c22ca', 'is_hide': 1},
|
26
28
|
{'key': 'trend_price', 'name': '股价阶段涨跌幅度', 'url': '/0x84527c7c3487b39afd820f2b309355cd75c01653'},
|
27
29
|
{'key': 'trend_day3_stabilize', 'name': '连续三日收涨', 'url': '/0x7e9df652521f334030e0be383f5fe10f01a67243'},
|
28
30
|
{'key': 'trend_contra_trade', 'name': '反包', 'url': '/0xa3645ec3bf460f8c0c2ce35d22ab3f50bdd87c5f'},
|
@@ -32,7 +34,6 @@ const MenuList = [
|
|
32
34
|
{'key': 'trend_bull_trend', 'name': '多头趋势', 'url': '/0x37b24777154ee090926e57bfa5602efa5c89b8a8'},
|
33
35
|
{'key': 'trend_fund_hold', 'name': '基金持股变化', 'url': '/0x706c0e77ca3e314b5186c763e6ee857b744e9880'},
|
34
36
|
{'key': 'trend_money_inflow', 'name': '资金流入历史最高', 'url': '/0xfbfc92be1eebe9ccf5b2f14b9a2ea25f2cc941b8'},
|
35
|
-
{'key': 'trend_boll', 'name': '布林线', 'url': '/0x7f2c6b9542ce7626669ab4910cbf7e8812883fea'},
|
36
37
|
{'key': 'trend_holder_minimum', 'name': '股东数历史最少', 'url': '/0xf0c0c360a283689c83ae216c6bbb03777d8068ca'},
|
37
38
|
{'key': 'trend_down_maximum', 'name': '历史高位最大跌幅', 'url': '/0x8d7b8abeec94e2ebe4b25115272d9d5899355c43'},
|
38
39
|
{'key': 'trend_week_minimum', 'name': '周成交低点', 'url': '/0xa9dfc159b157ae3b694a12dc42fb8feaa75bcf51'},
|
package/package.json
CHANGED
package/status.js
CHANGED
@@ -53,15 +53,15 @@ $(function () {
|
|
53
53
|
|
54
54
|
handle_status: function () {
|
55
55
|
Util.post(location.pathname, {active_div: localStorage[Status.tab_token], date: $("#ip_date").val()}, function (j) {
|
56
|
-
let
|
56
|
+
let html = [];
|
57
57
|
if (!$("#start_time").length) {
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
$("#status_head").prepend(
|
58
|
+
html.push("<tr><th id='start_time' width='25%'>系统时区:</th><td>", Status.map_url(j["timezone"]), "</td>");
|
59
|
+
html.push("<th id='start_time' width='25%'>服务器运行时间:</th><td colspan='3'>", Util.seconds_to_format(j["start_time"]), "(" + j["up_time"] + ")</td></tr>");
|
60
|
+
html.push("<tr><th width='25%'>数据库最后同步时间:</th><td>", Util.seconds_to_format(j["sync_end_time"]), "</td>");
|
61
|
+
html.push("<th width='20%'>数据库句柄更新时间:</th><td colspan='3'>", Util.seconds_to_format(j["db_time"]), "</td></tr>");
|
62
|
+
html.push("<tr><th width='25%'>成交量最后同步时间:</th><td>", Util.seconds_to_format(j["sync_amount_time"]), "</td>");
|
63
|
+
html.push("<th width='20%'>位置数据最后同步时间:</th><td colspan='3'>", Util.seconds_to_format(j["location_time"]), "</td></tr>");
|
64
|
+
$("#status_head").prepend(html.join(""));
|
65
65
|
}
|
66
66
|
Status.render_ip_daily(j["ip_daily_data"]);
|
67
67
|
// 数据库
|
@@ -81,7 +81,7 @@ $(function () {
|
|
81
81
|
});
|
82
82
|
$("#mysql_remote_ip").html(mysql_remote_ip.join("、"));
|
83
83
|
}
|
84
|
-
|
84
|
+
html = [];
|
85
85
|
let current_connections = 0, db_ip_array = [];
|
86
86
|
j["process_list"].forEach(function (item) {
|
87
87
|
let match_ip_data = Util.regexp_match_ip(item["Host"]);
|
@@ -89,20 +89,20 @@ $(function () {
|
|
89
89
|
db_ip_array.push(match_ip_data[0]);
|
90
90
|
}
|
91
91
|
current_connections++;
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
92
|
+
html.push("<tr>");
|
93
|
+
html.push("<td>", item["Id"], "</td>");
|
94
|
+
html.push("<td>", item["User"], "</td>");
|
95
|
+
html.push("<td>", Status.pack_ip_link(item["Host"]), "</td>");
|
96
|
+
html.push("<td>", item["db"], "</td>");
|
97
|
+
html.push("<td>", item["Command"], "</td>");
|
98
|
+
html.push("<td>", item["Time"], "</td>");
|
99
|
+
html.push("<td>", item["State"], "</td>");
|
100
|
+
html.push("<td>", item["Info"], "</td>");
|
101
|
+
html.push("</tr>");
|
102
102
|
});
|
103
103
|
$("#max_connections").html("<span class='label label-info'>" + current_connections + "</span> / " + j["max_connections"]);
|
104
104
|
$("#hard_disk").html(j["disk_available_size"] + " / " + j["disk_total_size"]);
|
105
|
-
Util.render_table_html("process_list",
|
105
|
+
Util.render_table_html("process_list", html);
|
106
106
|
if (db_ip_array.length > 0) {
|
107
107
|
let din_obj = $("#db_ip_num");
|
108
108
|
din_obj.html("(" + db_ip_array.length + ")");
|
@@ -128,26 +128,26 @@ $(function () {
|
|
128
128
|
},
|
129
129
|
|
130
130
|
render_ip_daily: function(ip_daily_data) {
|
131
|
-
let
|
131
|
+
let html = [], referer_search = "", referer_replacement = "";
|
132
132
|
let u = new URL(window.location.href);
|
133
133
|
if (u.hostname && u.port) {
|
134
134
|
referer_search = u.hostname + "/";
|
135
135
|
referer_replacement = u.hostname + ":" + u.port + "/";
|
136
136
|
}
|
137
137
|
ip_daily_data.forEach(function (item) {
|
138
|
-
|
139
|
-
|
140
|
-
|
138
|
+
html.push("<tr>");
|
139
|
+
html.push("<td>", Status.pack_ip_link(item["ip"]), "</td>");
|
140
|
+
html.push("<td>", Status.map_url(item['location']), "</td>");
|
141
141
|
item["referer"] = item["referer"].replace("?", "?");
|
142
142
|
if (referer_search && referer_replacement) {
|
143
143
|
item["referer"] = item["referer"].replace(referer_search, referer_replacement);
|
144
144
|
}
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
145
|
+
html.push("<td title='", item["referer"], "'>", Util.pack_html_link("http://" + item["referer"], Util.substring(item["referer"], 50)), "</td>");
|
146
|
+
html.push("<td>", item["visit"], "</td>");
|
147
|
+
html.push("<td>", Util.seconds_to_format(item["time"]), "</td>");
|
148
|
+
html.push("</tr>");
|
149
149
|
});
|
150
|
-
Util.render_table_html("ip_daily_data",
|
150
|
+
Util.render_table_html("ip_daily_data", html);
|
151
151
|
},
|
152
152
|
|
153
153
|
pack_ip_link: function(ip) {
|
@@ -228,17 +228,17 @@ $(function () {
|
|
228
228
|
});
|
229
229
|
}
|
230
230
|
Util.post(location.pathname, {active_div: localStorage[Status.tab_token]}, function (j) {
|
231
|
-
let
|
231
|
+
let html = [], ip_num = j["num"];
|
232
232
|
$("#ip_num").html("共 <span class='label label-info'>" + j["num"] + "</span> 条");
|
233
233
|
j["data"].forEach(function (item) {
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
234
|
+
html.push("<tr>");
|
235
|
+
html.push("<td>", ip_num, "</td>");
|
236
|
+
html.push("<td>", Util.pack_html_link(Status.ip_url(item["ip"]), item["ip"]), "</td>");
|
237
|
+
html.push("<td>", Status.map_url(Status.convert_ip_address(item)), "</td>");
|
238
|
+
html.push("</tr>");
|
239
239
|
ip_num--;
|
240
240
|
});
|
241
|
-
Util.render_table_html("block_ip_div_body",
|
241
|
+
Util.render_table_html("block_ip_div_body", html);
|
242
242
|
Util.hide_tips();
|
243
243
|
});
|
244
244
|
},
|
@@ -259,20 +259,20 @@ $(function () {
|
|
259
259
|
});
|
260
260
|
}
|
261
261
|
Util.post(location.pathname, {active_div: localStorage[Status.tab_token]}, function (j) {
|
262
|
-
let
|
262
|
+
let html = [], login_num = 0;
|
263
263
|
j["data"].forEach(function (item) {
|
264
264
|
login_num++;
|
265
265
|
let cls = item["date"].indexOf('logged in') > -1 ? "danger" : "";
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
266
|
+
html.push("<tr class='", cls, "'>");
|
267
|
+
html.push("<td>", login_num, "</td>");
|
268
|
+
html.push("<td>", item["user"], "</td>");
|
269
|
+
html.push("<td>", item["terminal"], "</td>");
|
270
|
+
html.push("<td>", Status.pack_ip_link(item["ip"]), "</td>");
|
271
|
+
html.push("<td>", Status.map_url(Status.convert_ip_address(item)), "</td>");
|
272
|
+
html.push("<td>", item["date"], "</td>");
|
273
|
+
html.push("</tr>");
|
274
274
|
});
|
275
|
-
Util.render_table_html("login_log_div_body",
|
275
|
+
Util.render_table_html("login_log_div_body", html);
|
276
276
|
$("#login_log_num").html("共 <span class='label label-info'>" + login_num + "</span> 条");
|
277
277
|
Util.hide_tips();
|
278
278
|
});
|
@@ -298,23 +298,23 @@ $(function () {
|
|
298
298
|
});
|
299
299
|
}
|
300
300
|
Util.post(location.pathname, {active_div: localStorage[Status.tab_token]}, function (j) {
|
301
|
-
let
|
301
|
+
let html = [], table_num = 0;
|
302
302
|
j["data"].forEach(function (item) {
|
303
303
|
table_num++;
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
304
|
+
html.push("<tr>");
|
305
|
+
html.push("<td>", table_num, "</td>");
|
306
|
+
html.push("<td>", item["TABLE_NAME"], "</td>");
|
307
|
+
html.push("<td>", item["ENGINE"], "</td>");
|
308
|
+
html.push("<td>", item["ROW_FORMAT"], "</td>");
|
309
|
+
html.push("<td>", item["TABLE_ROWS"], "</td>");
|
310
|
+
html.push("<td>", item["data_size"], "</td>");
|
311
|
+
html.push("<td>", item["index_size"], "</td>");
|
312
|
+
html.push("<td>", item["UPDATE_TIME"], "</td>");
|
313
|
+
html.push("<td>", item["CREATE_TIME"], "</td>");
|
314
|
+
html.push("<td>", item["TABLE_COMMENT"], "</td>");
|
315
|
+
html.push("</tr>");
|
316
316
|
});
|
317
|
-
Util.render_table_html("database_table_div_body",
|
317
|
+
Util.render_table_html("database_table_div_body", html);
|
318
318
|
$("#table_num").html("共 <span class='label label-info'>" + table_num + "</span> 条");
|
319
319
|
Util.hide_tips();
|
320
320
|
});
|
@@ -360,24 +360,24 @@ $(function () {
|
|
360
360
|
});
|
361
361
|
}
|
362
362
|
$.get("/action?action=request_headers", {}, function (j) {
|
363
|
-
let
|
363
|
+
let html = [];
|
364
364
|
for (let key in j) {
|
365
365
|
if (j.hasOwnProperty(key)) {
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
366
|
+
html.push("<tr>");
|
367
|
+
html.push("<td class='text-right'>", key, "</td>");
|
368
|
+
html.push("<td class='text-left' style='word-break: break-all'>", j[key], "</td>");
|
369
|
+
html.push("</tr>");
|
370
370
|
}
|
371
371
|
}
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
372
|
+
html.push("<tr><td class='text-right'>浏览器代号</td><td class='text-left' style='word-break: break-all'>" + navigator.appCodeName + "</td></tr>");
|
373
|
+
html.push("<tr><td class='text-right'>浏览器名称</td><td class='text-left' style='word-break: break-all'>" + navigator.appName + "</td></tr>");
|
374
|
+
html.push("<tr><td class='text-right'>浏览器版本</td><td class='text-left' style='word-break: break-all'>" + navigator.appVersion + "</td></tr>");
|
375
|
+
html.push("<tr><td class='text-right'>启用Cookies</td><td class='text-left' style='word-break: break-all'>" + navigator.cookieEnabled + "</td></tr>");
|
376
|
+
html.push("<tr><td class='text-right'>硬件平台</td><td class='text-left' style='word-break: break-all'>" + navigator.platform + "</td></tr>");
|
377
377
|
if (navigator.systemLanguage) {
|
378
|
-
|
378
|
+
html.push("<tr><td class='text-right'>系统语言</td><td class='text-left' style='word-break: break-all'>" + navigator.systemLanguage + "</td></tr>");
|
379
379
|
}
|
380
|
-
Util.render_table_html("request_headers_div_body",
|
380
|
+
Util.render_table_html("request_headers_div_body", html);
|
381
381
|
Util.hide_tips();
|
382
382
|
});
|
383
383
|
},
|
@@ -547,18 +547,18 @@ $(function () {
|
|
547
547
|
Status.init_client_cookie_modal();
|
548
548
|
}
|
549
549
|
}
|
550
|
-
Util.post(location.pathname, {active_div: localStorage[Status.tab_token], is_init: is_init,
|
550
|
+
Util.post(location.pathname, {active_div: localStorage[Status.tab_token], is_init: is_init, machine_id: $("#workers").val()}, function (j) {
|
551
551
|
if (j["workers"]) {
|
552
552
|
let select_html = [];
|
553
553
|
select_html.push("<option value=''>共 ", j["workers"].length, " 个Worker</option>");
|
554
554
|
j["workers"].forEach(function (w) {
|
555
|
-
select_html.push("<option value='", w["
|
555
|
+
select_html.push("<option value='", w["machine_id"], "'>", w["ip"], "(", w["num"], ")</option>");
|
556
556
|
});
|
557
557
|
$("#workers").html(select_html.join(""));
|
558
558
|
if (j["workers"].length > 0) {
|
559
559
|
$("#workers").change(function() {
|
560
|
-
let
|
561
|
-
if (
|
560
|
+
let machine_id = $(this).val();
|
561
|
+
if (machine_id) {
|
562
562
|
Util.show_loading();
|
563
563
|
Util.set_table_loading("worker_process_div_body");
|
564
564
|
Status.handle_worker();
|
@@ -655,7 +655,7 @@ $(function () {
|
|
655
655
|
if (j["workers"]) {
|
656
656
|
let worker_html = [];
|
657
657
|
j["workers"].forEach(function (w) {
|
658
|
-
worker_html.push("<option value='", w["
|
658
|
+
worker_html.push("<option value='", w["machine_id"], "'>", w["ip"], "(", w["num"], ")</option>");
|
659
659
|
});
|
660
660
|
let caw_obj = $("#client_action_worker");
|
661
661
|
caw_obj.html(worker_html.join(""));
|
@@ -679,18 +679,18 @@ $(function () {
|
|
679
679
|
Util.hide_tips();
|
680
680
|
});
|
681
681
|
$("#client_action_add").click(function() {
|
682
|
-
let action_type = 1,
|
682
|
+
let action_type = 1, machine_id = "1";
|
683
683
|
if ($("#action_worker_div").css("display") === "block") {
|
684
684
|
action_type = 2;
|
685
|
-
|
685
|
+
machine_id = $("#client_action_worker").val();
|
686
686
|
}
|
687
|
-
if (
|
687
|
+
if (machine_id) {
|
688
688
|
let action_content = $("#client_action_content").val();
|
689
689
|
if (action_content) {
|
690
690
|
Util.show_loading();
|
691
691
|
$("#client_action_tips").html("");
|
692
692
|
$("#client_action_add").attr("disabled", true);
|
693
|
-
Util.post(location.pathname, {active_div: "client_action_add", "
|
693
|
+
Util.post(location.pathname, {active_div: "client_action_add", "machine_id": machine_id, "content": action_content, action_type: action_type}, function (j) {
|
694
694
|
$("#client_action_add").attr("disabled", false);
|
695
695
|
if (j["code"] && j["code"] === 1) {
|
696
696
|
$("#client_action_tips").html("<b class='text-success'>任务`" + action_content + "`添加成功!</b>");
|
@@ -749,7 +749,7 @@ $(function () {
|
|
749
749
|
if (j["workers"]) {
|
750
750
|
let worker_html = [];
|
751
751
|
j["workers"].forEach(function (w) {
|
752
|
-
worker_html.push("<option value='", w["
|
752
|
+
worker_html.push("<option value='", w["machine_id"], "'>", w["ip"], "(", w["num"], ")</option>");
|
753
753
|
});
|
754
754
|
let caw_obj = $("#client_cookie_worker");
|
755
755
|
caw_obj.html(worker_html.join(""));
|
@@ -767,14 +767,14 @@ $(function () {
|
|
767
767
|
Util.hide_tips();
|
768
768
|
});
|
769
769
|
$("#client_cookie_add").click(function() {
|
770
|
-
let
|
771
|
-
if (
|
770
|
+
let machine_id = $("#client_cookie_worker").val();
|
771
|
+
if (machine_id) {
|
772
772
|
let client_cookie = $("#client_cookie_content").val();
|
773
773
|
if (client_cookie) {
|
774
774
|
Util.show_loading();
|
775
775
|
$("#client_cookie_tips").html("");
|
776
776
|
$("#client_cookie_add").attr("disabled", true);
|
777
|
-
Util.post(location.pathname, {active_div: "client_cookie_add", "
|
777
|
+
Util.post(location.pathname, {active_div: "client_cookie_add", "machine_id": machine_id, "cookie": client_cookie}, function (j) {
|
778
778
|
$("#client_cookie_add").attr("disabled", false);
|
779
779
|
if (j["code"] && j["code"] === 1) {
|
780
780
|
$("#client_cookie_tips").html("<b class='text-success'>Cookie添加成功!</b>");
|