really try to load stuff
Signed-off-by: Xe Iaso <me@christine.website>
This commit is contained in:
parent
5ff618eee8
commit
a7d06d3513
8
main.py
8
main.py
|
@ -11,8 +11,7 @@ class Plugin:
|
||||||
result = subprocess.run(["/bin/sh", "-c", "systemctl status tailscaled.service | grep active"], stdout=subprocess.PIPE)
|
result = subprocess.run(["/bin/sh", "-c", "systemctl status tailscaled.service | grep active"], stdout=subprocess.PIPE)
|
||||||
return result.stdout.decode("utf-8").split(": ")[1].strip()
|
return result.stdout.decode("utf-8").split(": ")[1].strip()
|
||||||
|
|
||||||
async def install_state(self, *args):
|
def _install_state(self):
|
||||||
print("got here")
|
|
||||||
sysext = subprocess.run(["/usr/bin/systemd-sysext", "list", "--json=short"], stdout=subprocess.PIPE)
|
sysext = subprocess.run(["/usr/bin/systemd-sysext", "list", "--json=short"], stdout=subprocess.PIPE)
|
||||||
sysexts = json.loads(sysext.stdout.decode("utf-8"))
|
sysexts = json.loads(sysext.stdout.decode("utf-8"))
|
||||||
|
|
||||||
|
@ -27,6 +26,11 @@ class Plugin:
|
||||||
|
|
||||||
return "impossible state"
|
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
|
# Asyncio-compatible long-running code, executed in a task when the plugin is loaded
|
||||||
async def _main(self):
|
async def _main(self):
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -19,9 +19,15 @@
|
||||||
|
|
||||||
status.inner_text = install_status;
|
status.inner_text = install_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onReady();
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="onReady()">
|
<body onload="onReady()">
|
||||||
<h3>Status: <span id="status">loading</span></h3>
|
<h3>Status: <span id="status">loading</span></h3>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
onReady();
|
||||||
|
</script>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue