Browse Source

add cache time to api stats

master
filesite 7 months ago
parent
commit
fc25fc5e5a
  1. 1
      heroUnion.mjs
  2. 5
      public/index.html

1
heroUnion.mjs

@ -551,6 +551,7 @@ class HeroUnion {
this.stats.taskNotifyStatus = this.taskNotifyStatus; this.stats.taskNotifyStatus = this.taskNotifyStatus;
this.stats.heroStatus = this.heroStatus; this.stats.heroStatus = this.heroStatus;
this.stats.run_seconds = common.getTimestampInSeconds() - this.stats.start_time; this.stats.run_seconds = common.getTimestampInSeconds() - this.stats.start_time;
this.stats.cache_time = this.task_cache_time;
return this.stats; return this.stats;
} }

5
public/index.html

@ -49,7 +49,7 @@
<p><a href="https://git.filesite.io/filesite/machete_hero" target="_blank">https://git.filesite.io/filesite/machete_hero</a></p> <p><a href="https://git.filesite.io/filesite/machete_hero" target="_blank">https://git.filesite.io/filesite/machete_hero</a></p>
<h3 class="mt-1">HeroUnion联盟状态 - 已运行<span class="run_time">...</span></h3> <h3 class="mt-1">HeroUnion联盟状态 - 已运行<span class="run_time">...</span></h3>
<h4 class="mt-d5">任务状态(最近 24 小时</h4> <h4 class="mt-d5">任务状态(最近<span class="cache_time">...</span></h4>
<div class="stats taskStatus"> <div class="stats taskStatus">
<span class="col"> <span class="col">
<strong class="total">...</strong> <strong class="total">...</strong>
@ -73,7 +73,7 @@
</span> </span>
</div> </div>
<h4 class="mt-d5">任务通知状态(最近 24 小时</h4> <h4 class="mt-d5">任务通知状态(最近<span class="cache_time">...</span></h4>
<div class="stats taskNotifyStatus"> <div class="stats taskNotifyStatus">
<span class="col"> <span class="col">
<strong class="total">...</strong> <strong class="total">...</strong>
@ -189,6 +189,7 @@
}).done(function(data) { }).done(function(data) {
$('#herounion_stats').text(JSON.stringify(data, null, 4)); $('#herounion_stats').text(JSON.stringify(data, null, 4));
$('.run_time').text( formatSeconds(data.run_seconds) ); $('.run_time').text( formatSeconds(data.run_seconds) );
$('.cache_time').text( formatSeconds(data.cache_time) );
renderStats('taskStatus', data.taskStatus); renderStats('taskStatus', data.taskStatus);
renderStats('taskNotifyStatus', data.taskNotifyStatus); renderStats('taskNotifyStatus', data.taskNotifyStatus);
renderStats('heroStatus', data.heroStatus); renderStats('heroStatus', data.heroStatus);

Loading…
Cancel
Save