client/web: add additional web client metrics logging (#10462)
Add additional web client metric logging. Namely, add logging events for auth / deauth, enable / disable using exit node, enable / disable SSH, enable / disable advertise routes, and click events on the device details button. Updates https://github.com/tailscale/tailscale/issues/10261 Signed-off-by: Mario Minardi <mario@tailscale.com>
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
import cx from "classnames"
|
||||
import React from "react"
|
||||
import { apiFetch } from "src/api"
|
||||
import { apiFetch, incrementMetric } from "src/api"
|
||||
import ACLTag from "src/components/acl-tag"
|
||||
import * as Control from "src/components/control-components"
|
||||
import NiceIP from "src/components/nice-ip"
|
||||
@@ -40,11 +40,13 @@ export default function DeviceDetailsView({
|
||||
{!readonly && (
|
||||
<Button
|
||||
sizeVariant="small"
|
||||
onClick={() =>
|
||||
onClick={() => {
|
||||
// increment metrics before logout as we don't gracefully handle disconnect currently
|
||||
incrementMetric("web_client_node_disconnect")
|
||||
apiFetch("/local/v0/logout", "POST")
|
||||
.then(() => setLocation("/"))
|
||||
.catch((err) => alert("Logout failed: " + err.message))
|
||||
}
|
||||
}}
|
||||
>
|
||||
Disconnect…
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user