sbd-npm 1.5.1 → 1.5.3

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 (3) hide show
  1. package/package.json +1 -1
  2. package/status.js +9 -3
  3. package/util.js +7 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.5.1",
3
+ "version": "1.5.3",
4
4
  "description": "Stock Big Data",
5
5
  "author": "DHQ <dhq314@gmail.com>",
6
6
  "license": "ISC",
package/status.js CHANGED
@@ -911,9 +911,15 @@ $(function () {
911
911
  $("#" + element_id + " .process_screen").each(function() {
912
912
  $(this).click(function() {
913
913
  Util.show_loading();
914
- let pid = $(this).parent().parent().children('td').eq(0).text();
915
- let cmdline_index = action_type === 2 ? 2 : 6;
916
- let cmdline_obj = $(this).parent().parent().children('td').eq(cmdline_index);
914
+ let tr_obj = $(this).parent().parent();
915
+ let pid = tr_obj.children('td').eq(0).text();
916
+ let cmdline_index = tr_obj.parent().parent().find('thead td').filter(function () {
917
+ return $(this).text().includes('启动命令');
918
+ }).index();
919
+ if (cmdline_index < 0) {
920
+ cmdline_index = action_type === 2 ? 3 : 6;
921
+ }
922
+ let cmdline_obj = tr_obj.children('td').eq(cmdline_index);
917
923
  let cmdline = cmdline_obj.attr('title') ? cmdline_obj.attr('title') : cmdline_obj.text();
918
924
  let action = Status.parse_machine_action(cmdline);
919
925
  let is_fetch_screen = $(this).attr("data-screen");
package/util.js CHANGED
@@ -191,8 +191,14 @@ const Util = {
191
191
  html.push('<div class="list-group">');
192
192
  if (j.data && j.data.length > 0) {
193
193
  j.data.forEach(function (item) {
194
+ let href = "";
194
195
  let upper_code = item.code.toUpperCase();
195
- html.push('<a target="_blank" rel="noopener noreferrer nofollow" class="list-group-item" href="/stock/', upper_code, '">', (item.name ? item.name : upper_code), '(', upper_code, ')</a>');
196
+ if (item.type && item.type === 1) {
197
+ href = Util.get_url("fund_public") + "?fund_code=" + upper_code;
198
+ } else {
199
+ href = "/stock/" + upper_code;
200
+ }
201
+ html.push('<a target="_blank" rel="noopener noreferrer nofollow" class="list-group-item" href="', href, '">', (item.name ? item.name : upper_code), '(', upper_code, ')</a>');
196
202
  });
197
203
  } else {
198
204
  html.push('<a href="#" class="list-group-item disabled">无数据</a>');