Add more fields to tailscale widget
hostname is the machine name in the admin console. name is the MagicDNS name of the device. clientVersion is the version of the Tailscale client software.
This commit is contained in:
parent
7adfe2ffd9
commit
2368b88eb1
@ -7,7 +7,7 @@ You will need to generate an API access token from the [keys page](https://login
|
|||||||
|
|
||||||
To find your device ID, go to the [machine overview page](https://login.tailscale.com/admin/machines) and select your machine. In the "Machine Details" section, copy your `ID`. It will end with `CNTRL`.
|
To find your device ID, go to the [machine overview page](https://login.tailscale.com/admin/machines) and select your machine. In the "Machine Details" section, copy your `ID`. It will end with `CNTRL`.
|
||||||
|
|
||||||
Allowed fields: `["address", "last_seen", "expires"]`.
|
Allowed fields: `["hostname", "address", "name", "last_seen", "expires", "client_version"]`.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
widget:
|
widget:
|
||||||
|
|||||||
@ -266,7 +266,9 @@
|
|||||||
"total": "Total"
|
"total": "Total"
|
||||||
},
|
},
|
||||||
"tailscale": {
|
"tailscale": {
|
||||||
|
"hostname": "Hostname",
|
||||||
"address": "Address",
|
"address": "Address",
|
||||||
|
"name": "Name",
|
||||||
"expires": "Expires",
|
"expires": "Expires",
|
||||||
"never": "Never",
|
"never": "Never",
|
||||||
"last_seen": "Last Seen",
|
"last_seen": "Last Seen",
|
||||||
@ -277,7 +279,8 @@
|
|||||||
"hours": "{{number}}h",
|
"hours": "{{number}}h",
|
||||||
"minutes": "{{number}}m",
|
"minutes": "{{number}}m",
|
||||||
"seconds": "{{number}}s",
|
"seconds": "{{number}}s",
|
||||||
"ago": "{{value}} Ago"
|
"ago": "{{value}} Ago",
|
||||||
|
"client_version": "Client Version"
|
||||||
},
|
},
|
||||||
"tdarr": {
|
"tdarr": {
|
||||||
"queue": "Queue",
|
"queue": "Queue",
|
||||||
|
|||||||
@ -18,18 +18,24 @@ export default function Component({ service }) {
|
|||||||
if (!statsData) {
|
if (!statsData) {
|
||||||
return (
|
return (
|
||||||
<Container service={service}>
|
<Container service={service}>
|
||||||
|
<Block label="tailscale.hostname" />
|
||||||
<Block label="tailscale.address" />
|
<Block label="tailscale.address" />
|
||||||
|
<Block label="tailscale.name" />
|
||||||
<Block label="tailscale.last_seen" />
|
<Block label="tailscale.last_seen" />
|
||||||
<Block label="tailscale.expires" />
|
<Block label="tailscale.expires" />
|
||||||
|
<Block label="tailscale.client_version" />
|
||||||
</Container>
|
</Container>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
hostname,
|
||||||
addresses: [address],
|
addresses: [address],
|
||||||
|
name,
|
||||||
keyExpiryDisabled,
|
keyExpiryDisabled,
|
||||||
lastSeen,
|
lastSeen,
|
||||||
expires,
|
expires,
|
||||||
|
clientVersion,
|
||||||
} = statsData;
|
} = statsData;
|
||||||
|
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
@ -64,9 +70,12 @@ export default function Component({ service }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Container service={service}>
|
<Container service={service}>
|
||||||
|
<Block label="tailscale.hostname" value={hostname} />
|
||||||
<Block label="tailscale.address" value={address} />
|
<Block label="tailscale.address" value={address} />
|
||||||
|
<Block label="tailscale.name" value={name} />
|
||||||
<Block label="tailscale.last_seen" value={getLastSeen()} />
|
<Block label="tailscale.last_seen" value={getLastSeen()} />
|
||||||
<Block label="tailscale.expires" value={getExpiry()} />
|
<Block label="tailscale.expires" value={getExpiry()} />
|
||||||
|
<Block label="tailscale.client_version" value={clientVersion} />
|
||||||
</Container>
|
</Container>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user