summaryrefslogtreecommitdiff
path: root/pages/home.luax
diff options
context:
space:
mode:
authorDuckonaut <duckonaut@#gmail.com>2026-11-10 23:35:39 +0100
committerDuckonaut <duckonaut@#gmail.com>2026-11-10 23:35:39 +0100
commitf2eaf111c56922a138604743a57726ac389196eb (patch)
tree8793e437e8266af2a06338fa2244f31413f466b9 /pages/home.luax
parente5c378a13548d8f7ef7e1f883e7a98fd0e9207b4 (diff)
add statuses
Diffstat (limited to 'pages/home.luax')
-rw-r--r--pages/home.luax45
1 files changed, 39 insertions, 6 deletions
diff --git a/pages/home.luax b/pages/home.luax
index 002d9bf..6ab86bc 100644
--- a/pages/home.luax
+++ b/pages/home.luax
@@ -13,6 +13,38 @@ local art = [[
__| |__
]]
+local function is_service_live(service, is_user)
+ local opt = ''
+ if is_user then
+ opt = '-U '
+ end
+ local handle = io.popen('rc-service ' .. opt .. service .. ' status 2>&1')
+ local output = handle:read('*a')
+
+
+ local is_dummy = string.match(output, "not found")
+ if is_dummy then
+ return "unknown"
+ end
+ local is_running = string.match(output, "started")
+ if is_running then
+ return "online"
+ else
+ return "offline"
+ end
+end
+
+local function Service(props)
+ return <div class="service-info">
+ <div class="service-name">
+ {$ props.attrs.service $}
+ </div>
+ <div class={"service-status service-status-" .. is_service_live(props.attrs.service, props.attrs.is_user)}>
+ {$ is_service_live(props.attrs.service, props.attrs.is_user) $}
+ </div>
+ </div>
+end
+
return function(props)
return <div class="main-info">
<div class="main-info-title">
@@ -21,12 +53,13 @@ return function(props)
<div class="ascii-art">
{$ art $}
</div>
- <div class="main-info-subtitle">
- apparently like
- <div class="main-info-highlight">
- {$ tostring(props.attrs.visits) $}
- </div>
- people saw this
+ <div class="service-group">
+ <Service service="tailscale" is_user={true} />
+ <Service service="reluax" />
+ <Service service="nginx" />
+ <Service service="fcgiwrap" />
+ <Service service="sshd" />
+ <Service service="git-daemon" />
</div>
</div>
end