Add stats page

This commit is contained in:
Citlali del Rey 2023-01-03 21:40:17 -08:00
parent cf7fd42983
commit b6b82b88f7
Signed by: nullobsi
GPG Key ID: 933A1F44222C2634
6 changed files with 24 additions and 2 deletions

View File

@ -38,6 +38,8 @@ sub startup ($self) {
$r->get('/announcements')->to('Main#announcements');
$r->get('/announcements.rss')->to('Main#announcement_feed');
$r->get('/announcement/#filename')->to('Main#get_announcement');
$r->get('/stats')->to('Main#get_stats');
}
1;

View File

@ -232,4 +232,8 @@ sub get_entry($fullpath) {
};
}
sub get_stats($self) {
return $self->render('main/statsPage');
}
1;

View File

@ -160,3 +160,9 @@ pre {
label.field-with-error {
color: red;
}
img.stats {
width: 100%;
image-rendering: pixelated;
display: block;
}

View File

@ -40,5 +40,4 @@
Please follow <a href="/rules">all rules</a> while using these services.
</footer>
</body>
</html>

View File

@ -58,5 +58,5 @@
<a href="https://keithhacks.cyou/">~keith</a>
</p>
</section>
<a href="/stats">View live system stats!</a>
</article>

View File

@ -0,0 +1,11 @@
% title 'UNIX.dog Stats';
% layout 'default';
<article>
<h1>Stats</h1>
<p>Current UNIX.dog system statistics for woofer.unix.dog.</p>
<a href="/vnstat-summary.txt"><img class="stats" alt="Network usage summary" src="/vnstat-summary.png"></a>
<a href="/vnstat-top5.txt"><img class="stats" alt="Network usage top 5 days" src="/vnstat-top5.png"></a>
<a href="/vnstat-5m.txt"><img class="stats" alt="Network usage in 5m intervals" src="/vnstat-5m.png"></a>
<a href="/vmstat-cpu.txt"><img class="stats" alt="CPU usage graph" src="/vmstat-cpu.png"></a>
<a href="/vmstat-mem.txt"><img class="stats" alt="Memory usage graph" src="/vmstat-mem.png"></a>
</article>