From 7df29cbce357eec56ceaacfc00c4d9a05b053bd7 Mon Sep 17 00:00:00 2001 From: Gerard Braad Date: Fri, 23 Jun 2023 02:13:36 +0800 Subject: [PATCH] Filter for shared-to/shareenode --- src/app.tsx | 54 +++++++++++++++++++++++++++++----------------------- src/types.ts | 1 + 2 files changed, 31 insertions(+), 24 deletions(-) diff --git a/src/app.tsx b/src/app.tsx index b77bb19..e920b2f 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -34,16 +34,20 @@ export class Application extends React.Component { this.state.Status != null ? + aria-label="Tailscale peers" + variant='compact' borders={false}> - + @@ -59,9 +63,11 @@ export class Application extends React.Component { - Object.entries(this.state.Status.Peer).map(peer => { - return - } + Object.values(this.state.Status.Peer) + .filter(isNotSharee) + .map(peer => { + return + } ) } @@ -82,41 +88,41 @@ class Peer extends React.Component { const network = name[1] + '.' + 'ts.net'; var tags = "-" - if(this.props.Tags) { - const mapped_items = this.props.Tags?.map(t => { return t}) + if (this.props.Tags) { + const mapped_items = this.props.Tags?.map(t => { return t }) tags = mapped_items.join(', ') } return ( - - - + + + - - - - + + ); } } diff --git a/src/types.ts b/src/types.ts index 94118ee..2c314a1 100644 --- a/src/types.ts +++ b/src/types.ts @@ -40,6 +40,7 @@ export type TailscalePeer = { ExitNodeOption: boolean; Active: boolean; CurAddr: string; + ShareeNode?: boolean; // funnel-ingress-node, device-of-shared-to-user } export interface TailscaleExitNodeStatus {
Tailscale peers
IP
- { this.props.Online + {this.props.Online ? : }{ this.props.TailscaleIPs[0] }{ hostName }{ network }{this.props.TailscaleIPs[0]}{hostName}{network} { - tags - } + tags + } { this.props.Active - ? this.props.CurAddr != "" + {this.props.Active + ? this.props.CurAddr != "" ? "Direct" : "Relay: " + this.props.Relay : this.props.Online ? "Idle" : "-" }{ this.props.ExitNode - ? "Current" - : this.props.ExitNodeOption - ? "Yes" - : "-" + {this.props.ExitNode + ? "Current" + : this.props.ExitNodeOption + ? "Yes" + : "-" }{ this.props.OS }{ this.props.TxBytes } / { this.props.RxBytes }{this.props.OS}{this.props.TxBytes} / {this.props.RxBytes}