Add gethomepage as dashboard
This commit is contained in:
parent
2a86c1bd88
commit
ad52cec21e
4 changed files with 208 additions and 0 deletions
filter_plugins
24
filter_plugins/tailscale_to_dashboard.py
Normal file
24
filter_plugins/tailscale_to_dashboard.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
class FilterModule(object):
|
||||
def filters(self):
|
||||
return {
|
||||
'tailscale_to_dashboard': self.tailscale_to_dashboard,
|
||||
}
|
||||
|
||||
def tailscale_to_dashboard(self, tailscale):
|
||||
ts_key = tailscale["key"]
|
||||
machines = tailscale["machines"]
|
||||
|
||||
result = []
|
||||
for (key, props) in machines.items():
|
||||
result.append({
|
||||
key: {
|
||||
"href": "https://login.tailscale.com/admin/machines/" + props["ip"],
|
||||
"widget": {
|
||||
"type": "tailscale",
|
||||
"deviceid": props["id"],
|
||||
"key": ts_key
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
return result
|
Reference in a new issue