summaryrefslogtreecommitdiffstats
path: root/dmt
diff options
context:
space:
mode:
authorMalfurious <m@lfurio.us>2023-11-18 06:55:24 -0500
committerMalfurious <m@lfurio.us>2023-11-20 05:04:57 -0500
commitc2740abc5e7e6e7c0eee07eb34377ba15e95d93d (patch)
treef8df6527d6658a8fc46eb6ddb564878432bbf8f7 /dmt
parente63a11dcd7f349077f09cac5012e52ec271516e9 (diff)
downloadcychedelic-c2740abc5e7e6e7c0eee07eb34377ba15e95d93d.tar.gz
cychedelic-c2740abc5e7e6e7c0eee07eb34377ba15e95d93d.zip
dmt: Add stats page
Signed-off-by: Malfurious <m@lfurio.us>
Diffstat (limited to 'dmt')
-rwxr-xr-xdmt/dmt5
-rw-r--r--dmt/html/master.html1
-rw-r--r--dmt/html/stats.html17
3 files changed, 23 insertions, 0 deletions
diff --git a/dmt/dmt b/dmt/dmt
index 3ea36c7..0544596 100755
--- a/dmt/dmt
+++ b/dmt/dmt
@@ -116,6 +116,11 @@ case ${route[0]} in
template "html/master.html" text/html
;;
+ "stats")
+ page_template="html/stats.html"
+ template "html/master.html" text/html
+ ;;
+
"style.css")
template "style.css" text/css
;;
diff --git a/dmt/html/master.html b/dmt/html/master.html
index dfeeef3..42f77f7 100644
--- a/dmt/html/master.html
+++ b/dmt/html/master.html
@@ -11,6 +11,7 @@
<nav class="links">
<a href="/">jobs</a>
| <a href="/services">services</a>
+ | <a href="/stats">stats</a>
<span class="right">
%{ echo -n "$CYCHE_SITE_NAME" | escape_html %}
diff --git a/dmt/html/stats.html b/dmt/html/stats.html
new file mode 100644
index 0000000..8d03762
--- /dev/null
+++ b/dmt/html/stats.html
@@ -0,0 +1,17 @@
+<h1>Daemon Stats</h1>
+
+% fmt='table {{.ID}}\t{{.Image}}\t{{.RunningFor}}\t{{.Status}}'
+
+<div class="box">
+ <div class="box-title">Containers</div>
+ <div class="box-text">
+ <pre>%{ docker ps --all --format "$fmt" %}</pre>
+ </div>
+</div>
+
+<div class="box">
+ <div class="box-title">Usage</div>
+ <div class="box-text">
+ <pre>%{ docker system df %}</pre>
+ </div>
+</div>