really try to load stuff

Signed-off-by: Xe Iaso <me@christine.website>
This commit is contained in:
Cadey Ratio 2022-05-09 18:08:12 +00:00
parent 5ff618eee8
commit a7d06d3513
2 changed files with 12 additions and 2 deletions

View File

@ -11,8 +11,7 @@ class Plugin:
result = subprocess.run(["/bin/sh", "-c", "systemctl status tailscaled.service | grep active"], stdout=subprocess.PIPE)
return result.stdout.decode("utf-8").split(": ")[1].strip()
async def install_state(self, *args):
print("got here")
def _install_state(self):
sysext = subprocess.run(["/usr/bin/systemd-sysext", "list", "--json=short"], stdout=subprocess.PIPE)
sysexts = json.loads(sysext.stdout.decode("utf-8"))
@ -27,6 +26,11 @@ class Plugin:
return "impossible state"
async def install_state(self, *args):
result = await self.install_state()
print("status: " + result)
return result
# Asyncio-compatible long-running code, executed in a task when the plugin is loaded
async def _main(self):
pass

View File

@ -19,9 +19,15 @@
status.inner_text = install_status;
}
onReady();
</script>
</head>
<body onload="onReady()">
<h3>Status: <span id="status">loading</span></h3>
</body>
<script>
onReady();
</script>
</html>