mirror of
https://git.wownero.com/wownero/onion-wownero-blockchain-explorer.git
synced 2024-08-15 00:33:12 +00:00
resolution info added to time scale
This commit is contained in:
parent
df4a9b9f3f
commit
1f7eede2b6
4 changed files with 38 additions and 29 deletions
13
src/page.h
13
src/page.h
|
@ -582,6 +582,7 @@ namespace xmreg {
|
|||
mstch::array inputs = mstch::array{};
|
||||
|
||||
mstch::array mixins_timescales;
|
||||
double timescale_scale {0.0}; // size of one '_' in days
|
||||
|
||||
// make timescale maps for mixins in input
|
||||
for (const txin_to_key& in_key: txd.input_key_imgs)
|
||||
|
@ -651,19 +652,25 @@ namespace xmreg {
|
|||
}
|
||||
|
||||
// get mixins in time scale for visual representation
|
||||
string mixin_times_scale = xmreg::timestamps_time_scale(mixin_timestamps,
|
||||
server_timestamp, 80);
|
||||
pair<string, double> mixin_times_scale = xmreg::timestamps_time_scale(
|
||||
mixin_timestamps,
|
||||
server_timestamp, 100);
|
||||
|
||||
// add beginning and end to the mixin_times_scale
|
||||
string timescale_str = string("Genesis<")
|
||||
+ mixin_times_scale
|
||||
+ mixin_times_scale.first
|
||||
+ string(">") + server_time_str;
|
||||
|
||||
timescale_scale = mixin_times_scale.second ;
|
||||
|
||||
// save the string timescales for later to show
|
||||
mixins_timescales.push_back(mstch::map {{"timescale", timescale_str}});
|
||||
}
|
||||
|
||||
context["inputs"] = inputs;
|
||||
context["timescales"] = mixins_timescales;
|
||||
context["timescales_scale"] = fmt::format("{:0.2f}",
|
||||
timescale_scale / 3600.0 / 24.0); // in days
|
||||
|
||||
mstch::array outputs;
|
||||
|
||||
|
|
|
@ -73,12 +73,14 @@
|
|||
|
||||
|
||||
|
||||
<h3>Mixins time scale</h3>
|
||||
<h3>Mixins time scale (resolution: {{timescales_scale}} days)</h3>
|
||||
<div class="center">
|
||||
<ul class="center">
|
||||
{{#timescales}}
|
||||
<li class="center" style="list-style-type: none;">{{timescale}}</li>
|
||||
{{/timescales}}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<h3>Outputs</h3>
|
||||
|
|
|
@ -527,7 +527,7 @@ namespace xmreg
|
|||
std::istreambuf_iterator<char>());
|
||||
}
|
||||
|
||||
string
|
||||
pair<string, double>
|
||||
timestamps_time_scale(const vector<uint64_t>& timestamps,
|
||||
uint64_t timeN, uint64_t resolution, uint64_t time0)
|
||||
{
|
||||
|
@ -553,7 +553,7 @@ namespace xmreg
|
|||
empty_time[timestamp_place + 1] = '*';
|
||||
}
|
||||
|
||||
return empty_time;
|
||||
return make_pair(empty_time, scale);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -199,7 +199,7 @@ namespace xmreg
|
|||
std::cout << "]" << std::endl;
|
||||
}
|
||||
|
||||
string
|
||||
pair<string, double>
|
||||
timestamps_time_scale(const vector<uint64_t>& timestamps,
|
||||
uint64_t timeN, uint64_t resolution = 80,
|
||||
uint64_t time0 = 1397818193 /* timestamp of the second block */);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue