sbd-npm 1.4.86 → 1.4.88
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 +18 -8
- package/stock_basics.js +10 -10
- package/summary_daily.js +7 -7
- package/util.js +43 -43
package/package.json
CHANGED
package/status.js
CHANGED
@@ -178,7 +178,7 @@ $(function () {
|
|
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'>" +
|
199
|
+
$("#mysql_access_summary").html(" 共 <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();
|
@@ -1373,7 +1373,10 @@ $(function () {
|
|
1373
1373
|
let ip_address = Status.convert_ip_address(j);
|
1374
1374
|
if (ip_address.length > 0) {
|
1375
1375
|
let map_url = Status.map_url(ip_address, "<i class='glyphicon glyphicon-map-marker'></i>");
|
1376
|
-
let ip_result = Util.pack_html_link(Status.ip_url(j["ip"]), "<b class='text-success'>" + ip_address + "</b>") + " " + map_url;
|
1376
|
+
let ip_result = Util.pack_html_link(Status.ip_url(j["ip"]), "<b class='text-success'>" + ip_address + "</b>") + " " + map_url;
|
1377
|
+
ip_result += " " + Util.pack_html_link("https://apis.map.qq.com/ws/location/v1/ip?output=jsonp&key=SGVBZ-4RO34-NB2US-DQKYK-ZEUVJ-4KFZF&ip=" + j["ip"] + "&callback=Callback&_=" + Util.now(), "1");
|
1378
|
+
ip_result += " " + Util.pack_html_link("https://whois.pconline.com.cn/ipJson.jsp?ip=" + j["ip"] + "&json=true", "2");
|
1379
|
+
ip_result += " " + Util.pack_html_link("http://ip-api.com/json/" + j["ip"] + "?lang=zh-CN", "3");
|
1377
1380
|
if (j["domain"]) {
|
1378
1381
|
ip_result += "<br><br>" + Util.pack_html_link(j["domain"], "<b>" + j["domain"] + "</b>");
|
1379
1382
|
}
|
@@ -1555,12 +1558,12 @@ $(function () {
|
|
1555
1558
|
|
1556
1559
|
map_url: function (location, location_name = "") {
|
1557
1560
|
location_name = location_name === "" ? location : location_name;
|
1558
|
-
let
|
1561
|
+
let location_array = location.split(' ');
|
1559
1562
|
if (/中国|省|市/.test(location)) {
|
1560
|
-
let url = Util.map_url(
|
1561
|
-
return url.replace('>' +
|
1563
|
+
let url = Util.map_url(location_array[0]);
|
1564
|
+
return url.replace('>' + location_array[0] + '</a>', '>' + location_name + '</a>');
|
1562
1565
|
}
|
1563
|
-
return Util.google_map_url(
|
1566
|
+
return Util.google_map_url(location_array[0], location_name);
|
1564
1567
|
}
|
1565
1568
|
|
1566
1569
|
};
|
@@ -1642,6 +1645,7 @@ $(function () {
|
|
1642
1645
|
Status.fetch_mysql_process_data();
|
1643
1646
|
});
|
1644
1647
|
mpm_obj.on('hidden.bs.modal', function () {
|
1648
|
+
$("#mysql_process_summary").html("");
|
1645
1649
|
Util.set_table_loading("mysql_process_modal_body_body");
|
1646
1650
|
});
|
1647
1651
|
|
@@ -1651,7 +1655,7 @@ $(function () {
|
|
1651
1655
|
"element_id": "mysql_access_modal_body",
|
1652
1656
|
"caption": '<caption class="' + (Util.is_mobile() ? "text-left" : "text-right") + '" id="mysql_access_summary"></caption>',
|
1653
1657
|
"head_cols": [
|
1654
|
-
{"name": "
|
1658
|
+
{"name": "", "select_id": "mysql_access_filter", "select_options": [{"key": "0", "val": "全部"},{"key": "1", "val": "正常"},{"key": "2", "val": "屏蔽"}]},
|
1655
1659
|
{"name": "IP", "table_sort": 1, "tooltip": "IP地址(Internet Protocol Address)是指互联网协议地址"},
|
1656
1660
|
{"name": "地址信息", "table_sort": 1},
|
1657
1661
|
{"name": "连接次数", "table_sort": 1},
|
@@ -1659,11 +1663,17 @@ $(function () {
|
|
1659
1663
|
{"name": "最后一次连接时间", "class": "info", "table_sort": 1},
|
1660
1664
|
]
|
1661
1665
|
});
|
1666
|
+
$("#mysql_access_filter").change(function() {
|
1667
|
+
$("#mysql_access_summary").html("");
|
1668
|
+
Util.set_table_loading("mysql_access_modal_body_body");
|
1669
|
+
Status.fetch_mysql_access_data();
|
1670
|
+
});
|
1662
1671
|
let mam_obj = $('#mysql_access_modal');
|
1663
1672
|
mam_obj.on('shown.bs.modal', function (e) {
|
1664
1673
|
Status.fetch_mysql_access_data();
|
1665
1674
|
});
|
1666
1675
|
mam_obj.on('hidden.bs.modal', function () {
|
1676
|
+
$("#mysql_access_summary").html("");
|
1667
1677
|
Util.set_table_loading("mysql_access_modal_body_body");
|
1668
1678
|
});
|
1669
1679
|
|
package/stock_basics.js
CHANGED
@@ -148,9 +148,9 @@ let Stock = {
|
|
148
148
|
|
149
149
|
let concept_obj = $("#concept");
|
150
150
|
if (concept_obj.length > 0) {
|
151
|
-
let
|
151
|
+
let concept_array = concept_obj.html().split(",");
|
152
152
|
html = [];
|
153
|
-
|
153
|
+
concept_array.forEach(function (item) {
|
154
154
|
html.push('<a target="_blank" rel="noopener noreferrer nofollow" href="', Util.get_url("query_list"), '?concept=', item, '" class="btn btn-xs btn-warning">', item, '</a> ');
|
155
155
|
});
|
156
156
|
concept_obj.html(html.join(""));
|
@@ -158,9 +158,9 @@ let Stock = {
|
|
158
158
|
|
159
159
|
let location_obj = $("#location");
|
160
160
|
if (location_obj.length > 0) {
|
161
|
-
let
|
161
|
+
let location_array = location_obj.text().split(/[;;,,]/);
|
162
162
|
html = [];
|
163
|
-
|
163
|
+
location_array.forEach(function (location) {
|
164
164
|
html.push(Util.map_url(location, location) + ' ');
|
165
165
|
});
|
166
166
|
location_obj.html(html.join(""));
|
@@ -985,9 +985,9 @@ let Stock = {
|
|
985
985
|
Stock.hist_end_date = Util.seconds_to_format(date - 1 + 7 * Util.one_day_second, "%Y-%m-%d");
|
986
986
|
} else if (date_type === "month") {
|
987
987
|
Stock.hist_start_date = date;
|
988
|
-
let
|
989
|
-
let year = parseInt(
|
990
|
-
let month = parseInt(
|
988
|
+
let d_array = date.split("-");
|
989
|
+
let year = parseInt(d_array[0]);
|
990
|
+
let month = parseInt(d_array[1]);
|
991
991
|
if (month === 12) {
|
992
992
|
month = 1;
|
993
993
|
year += 1;
|
@@ -997,9 +997,9 @@ let Stock = {
|
|
997
997
|
date = Util.format_to_second(year + "-" + month + "-01");
|
998
998
|
Stock.hist_end_date = Util.seconds_to_format(date - 1, "%Y-%m-%d");
|
999
999
|
} else if (date_type === "quarter") {
|
1000
|
-
let
|
1001
|
-
let year = parseInt(
|
1002
|
-
let quarter =
|
1000
|
+
let d_array = date.split("-");
|
1001
|
+
let year = parseInt(d_array[0]);
|
1002
|
+
let quarter = d_array[1];
|
1003
1003
|
if (quarter === "S1") {
|
1004
1004
|
Stock.hist_start_date = year + "-01-01";
|
1005
1005
|
date = year + "-04-01";
|
package/summary_daily.js
CHANGED
@@ -197,11 +197,11 @@ $(function () {
|
|
197
197
|
pack_hsgt_money_flow: function (hsgt_money_flow_data) {
|
198
198
|
if ($("#hsgt_money_flow_line").length) {
|
199
199
|
DailySummary["hsgt_money_flow_chart"].hideLoading();
|
200
|
-
let
|
200
|
+
let time_array = [], hsmf_data = [], hmf_array = [], smf_array = [], tmf_val = 0, hmf_val = 0, smf_val = 0;
|
201
201
|
hsgt_money_flow_data.forEach(function (d) {
|
202
|
-
|
203
|
-
|
204
|
-
|
202
|
+
time_array.push(d[0]);
|
203
|
+
hmf_array.push(d[1]);
|
204
|
+
smf_array.push(d[2]);
|
205
205
|
let total_mf_val = Util.to_float(parseFloat(d[1]) + parseFloat(d[2]), 2);
|
206
206
|
hsmf_data.push(total_mf_val);
|
207
207
|
if (total_mf_val) {
|
@@ -231,7 +231,7 @@ $(function () {
|
|
231
231
|
legend: {x: 20, y: 20, data: ["总流向", "沪股通", "深股通"]},
|
232
232
|
"grid": {"x": 30, "y": 50, "x2": 5, "y2": 20},
|
233
233
|
calculable: !0,
|
234
|
-
xAxis: [{type: "category", boundaryGap: !1, data:
|
234
|
+
xAxis: [{type: "category", boundaryGap: !1, data: time_array}],
|
235
235
|
yAxis: [{type: "value"}],
|
236
236
|
series: [
|
237
237
|
{
|
@@ -246,14 +246,14 @@ $(function () {
|
|
246
246
|
type: "line",
|
247
247
|
smooth: !0,
|
248
248
|
itemStyle: {normal: {color: "#34495E", areaStyle: {type: "default"}}},
|
249
|
-
data:
|
249
|
+
data: hmf_array
|
250
250
|
},
|
251
251
|
{
|
252
252
|
name: "深股通",
|
253
253
|
type: "line",
|
254
254
|
smooth: !0,
|
255
255
|
itemStyle: {normal: {color: "#BDC3C7", areaStyle: {type: "default"}}},
|
256
|
-
data:
|
256
|
+
data: smf_array
|
257
257
|
}
|
258
258
|
]
|
259
259
|
})
|
package/util.js
CHANGED
@@ -112,7 +112,7 @@ const Util = {
|
|
112
112
|
});
|
113
113
|
|
114
114
|
$("#stock").on("focus keyup", function () {
|
115
|
-
let key_word = $(this).val();
|
115
|
+
let key_word = $(this).val().trim();
|
116
116
|
if (key_word) {
|
117
117
|
if (Util.is_has_chinese(key_word) || (Util.is_alphabet(key_word) && key_word.length >= 2) || ($.isNumeric(key_word) && key_word.length >= 3)) {
|
118
118
|
if (window.location.pathname === "/status" && $("#word").hasClass('active')) {
|
@@ -184,7 +184,7 @@ const Util = {
|
|
184
184
|
request_search: function() {
|
185
185
|
Util.show_loading();
|
186
186
|
Util.post("/action", {action: "search", key_word: $("#stock").val()}, function (j) {
|
187
|
-
let key_word = $("#stock").val();
|
187
|
+
let key_word = $("#stock").val().trim();
|
188
188
|
if (key_word) {
|
189
189
|
if (key_word === j["key_word"]) {
|
190
190
|
let html = [];
|
@@ -397,8 +397,8 @@ const Util = {
|
|
397
397
|
name = item["name"];
|
398
398
|
if (Util.is_us(item["code"])) {
|
399
399
|
if (name.indexOf(' ') !== -1) {
|
400
|
-
let
|
401
|
-
name =
|
400
|
+
let name_array = name.split(' ');
|
401
|
+
name = name_array[0] ? name_array[0] : name;
|
402
402
|
} else {
|
403
403
|
name = name.replace("公司", "").replace("•", "").replace("•", "");
|
404
404
|
}
|
@@ -2078,9 +2078,9 @@ const Util = {
|
|
2078
2078
|
show_profile += " <a class='unfold text-info' data-toggle='modal' data-target='." + modal_id + "' href='#'>展开</a>";
|
2079
2079
|
$("#" + element_id).html(show_profile);
|
2080
2080
|
$('#' + modal_id).on('shown.bs.modal', function () {
|
2081
|
-
let
|
2081
|
+
let p_array = profile.split("。");
|
2082
2082
|
let html = [];
|
2083
|
-
|
2083
|
+
p_array.forEach(function (p) {
|
2084
2084
|
if (p.length > 0) {
|
2085
2085
|
html.push("<p>", p.replace(/,/g, ","), "。</p>");
|
2086
2086
|
}
|
@@ -2260,8 +2260,8 @@ const Util = {
|
|
2260
2260
|
* @returns {undefined}
|
2261
2261
|
*/
|
2262
2262
|
get_cookie: function getCookie(name) {
|
2263
|
-
let
|
2264
|
-
return
|
2263
|
+
let match_array = document.cookie.match("\\b" + name + "=([^;]*)\\b");
|
2264
|
+
return match_array ? match_array[1] : undefined;
|
2265
2265
|
},
|
2266
2266
|
|
2267
2267
|
/**
|
@@ -2656,24 +2656,24 @@ const Util = {
|
|
2656
2656
|
* @param obj_token
|
2657
2657
|
*/
|
2658
2658
|
parse_value_trend: function (obj_token) {
|
2659
|
-
let
|
2659
|
+
let data_array = [], unit = "";
|
2660
2660
|
$("." + obj_token).each(function () {
|
2661
2661
|
let val = $(this).text();
|
2662
2662
|
if (unit === "") {
|
2663
|
-
let
|
2664
|
-
if ($.isArray(
|
2665
|
-
unit =
|
2663
|
+
let match_array = val.match(/[\u4e00-\u9fa5]+/);
|
2664
|
+
if ($.isArray(match_array) && match_array[0]) {
|
2665
|
+
unit = match_array[0];
|
2666
2666
|
}
|
2667
2667
|
}
|
2668
|
-
|
2668
|
+
data_array.push({"obj": $(this), "digit": Util.filter_chinese(val)});
|
2669
2669
|
});
|
2670
|
-
let data_arr_len =
|
2670
|
+
let data_arr_len = data_array.length;
|
2671
2671
|
if (data_arr_len > 0) {
|
2672
2672
|
for (let i = 0; i < data_arr_len; i++) {
|
2673
|
-
if (
|
2674
|
-
let digit =
|
2675
|
-
let next_digit =
|
2676
|
-
let obj =
|
2673
|
+
if (data_array[i + 1]) {
|
2674
|
+
let digit = data_array[i]["digit"];
|
2675
|
+
let next_digit = data_array[i + 1]["digit"];
|
2676
|
+
let obj = data_array[i]["obj"];
|
2677
2677
|
if (digit > next_digit) {
|
2678
2678
|
$(obj).html("<b class='text-danger'>" + digit + unit + " ↑</b>");
|
2679
2679
|
} else if (digit < next_digit) {
|
@@ -2788,9 +2788,9 @@ const Util = {
|
|
2788
2788
|
*/
|
2789
2789
|
sort_table_row: function (td_obj) {
|
2790
2790
|
let table = td_obj.parents('table').eq(0);
|
2791
|
-
let
|
2791
|
+
let row_array = table.find('tr:gt(0)').toArray();
|
2792
2792
|
let td_index = td_obj.index();
|
2793
|
-
|
2793
|
+
row_array.sort(function (row1, row2) {
|
2794
2794
|
let td1_val = Util.get_table_td_value(row1, td_index);
|
2795
2795
|
let td2_val = Util.get_table_td_value(row2, td_index);
|
2796
2796
|
return $.isNumeric(td1_val) && $.isNumeric(td2_val) ? td1_val - td2_val : td1_val.localeCompare(td2_val);
|
@@ -2798,10 +2798,10 @@ const Util = {
|
|
2798
2798
|
let sort_cls = "fa-sort-asc";
|
2799
2799
|
this.asc = !this.asc;
|
2800
2800
|
if (!this.asc) {
|
2801
|
-
|
2801
|
+
row_array = row_array.reverse();
|
2802
2802
|
sort_cls = "fa-sort-desc";
|
2803
2803
|
}
|
2804
|
-
table.children('tbody').empty().html(
|
2804
|
+
table.children('tbody').empty().html(row_array);
|
2805
2805
|
table.children('thead').find("i").each(function () {
|
2806
2806
|
if ($(this).hasClass("fa")) {
|
2807
2807
|
$(this).removeClass("fa-sort-asc");
|
@@ -2838,18 +2838,18 @@ const Util = {
|
|
2838
2838
|
} else {
|
2839
2839
|
// 174.36(+0.79%) 括号里的数字
|
2840
2840
|
let bracket_re = /\(([-+]?\d*\.?\d+|[-+]?\d+|\d+)\%?\)/;
|
2841
|
-
let
|
2842
|
-
if ($.isArray(
|
2843
|
-
if (
|
2844
|
-
return
|
2841
|
+
let match_array = bracket_re.exec(td_val);
|
2842
|
+
if ($.isArray(match_array)) {
|
2843
|
+
if (match_array.length >= 2) {
|
2844
|
+
return match_array[1];
|
2845
2845
|
}
|
2846
2846
|
return 0;
|
2847
2847
|
} else {
|
2848
2848
|
// 匹配数字
|
2849
2849
|
let digit_re = /([-+]?\d*\.?\d+|[-+]?\d+|\d+)/;
|
2850
|
-
|
2851
|
-
if ($.isArray(
|
2852
|
-
return
|
2850
|
+
match_array = digit_re.exec(td_val);
|
2851
|
+
if ($.isArray(match_array) && match_array[0]) {
|
2852
|
+
return match_array[0];
|
2853
2853
|
}
|
2854
2854
|
return td_val.replace("%", "");
|
2855
2855
|
}
|
@@ -2884,9 +2884,9 @@ const Util = {
|
|
2884
2884
|
let url = location.search; //获取url中"?"符后的字串
|
2885
2885
|
let obj = {};
|
2886
2886
|
if (url.indexOf("?") !== -1) {
|
2887
|
-
let
|
2888
|
-
for (let i = 0; i <
|
2889
|
-
let query =
|
2887
|
+
let query_array = url.substring(1).split("&");
|
2888
|
+
for (let i = 0; i < query_array.length; i++) {
|
2889
|
+
let query = query_array[i].split("=");
|
2890
2890
|
obj[query[0]] = query[1];
|
2891
2891
|
}
|
2892
2892
|
}
|
@@ -3626,8 +3626,8 @@ const Util = {
|
|
3626
3626
|
*/
|
3627
3627
|
init_date_range_picker: function (element_id, Obj, callback_func, start_date = 0, end_date = 0) {
|
3628
3628
|
let separator = element_id.indexOf("_start_end") > -1 ? "_start_end" : "_";
|
3629
|
-
let
|
3630
|
-
let prefix =
|
3629
|
+
let element_array = element_id.split(separator);
|
3630
|
+
let prefix = element_array[0];
|
3631
3631
|
let select_id = prefix + "_time_select";
|
3632
3632
|
let start_id = prefix + "_start_date";
|
3633
3633
|
let end_id = prefix + "_end_date";
|
@@ -3864,9 +3864,9 @@ const Util = {
|
|
3864
3864
|
fraction = Math.pow(10, fraction);
|
3865
3865
|
digit = Math.round(digit * fraction) / fraction;
|
3866
3866
|
if (fraction === 100) {
|
3867
|
-
let
|
3868
|
-
if (
|
3869
|
-
if (
|
3867
|
+
let digit_array = digit.toString().split(".");
|
3868
|
+
if (digit_array.length > 1) {
|
3869
|
+
if (digit_array[1].length === 1) {
|
3870
3870
|
return (digit + "0");
|
3871
3871
|
}
|
3872
3872
|
} else {
|
@@ -4016,21 +4016,21 @@ const Util = {
|
|
4016
4016
|
init_time_drop_down: function (metrics, metrics_drop_down_id, date_type, callback_func) {
|
4017
4017
|
let metrics_drop_down_type_id = metrics_drop_down_id + "_date_" + date_type;
|
4018
4018
|
let metrics_drop_down_btn_id = metrics + "_btn_" + date_type;
|
4019
|
-
let
|
4019
|
+
let time_array = ["30周", "52周", "100周", "150周", "200周", "300周"];
|
4020
4020
|
if (date_type === "month") {
|
4021
|
-
|
4021
|
+
time_array = ["30月", "40月", "50月", "60月", "100月", "120月"];
|
4022
4022
|
} else if (date_type === "quarter") {
|
4023
|
-
|
4023
|
+
time_array = ["30季", "40季", "50季"];
|
4024
4024
|
} else if (date_type === "daily") {
|
4025
|
-
|
4025
|
+
time_array = ["20日", "60日", "120日", "200日"];
|
4026
4026
|
}
|
4027
|
-
let default_time = (date_type === "daily" || date_type === "week") ?
|
4027
|
+
let default_time = (date_type === "daily" || date_type === "week") ? time_array[1] : time_array[0];
|
4028
4028
|
let html = [];
|
4029
4029
|
html.push('<div class="btn-group">');
|
4030
4030
|
html.push('<button id="' + metrics_drop_down_btn_id + '" data-val="' + date_type + '" type="button" class="btn btn-default ' + metrics + '_bar_btn">' + default_time + '</button>');
|
4031
4031
|
html.push('<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="caret"></span></button>');
|
4032
4032
|
html.push('<ul style="margin-top: 5px;" class="dropdown-menu" id="' + metrics_drop_down_type_id + '">');
|
4033
|
-
|
4033
|
+
time_array.forEach(function (t) {
|
4034
4034
|
html.push('<li><a href="javacript:void(0);">', t, '</a></li>');
|
4035
4035
|
});
|
4036
4036
|
html.push('</ul></div> ');
|