feat(vpn): support optional non-mandatory VPN route access and align route config with enabled semantics
This commit is contained in:
@@ -141,9 +141,11 @@ export class OpsViewVpn extends DeesElement {
|
||||
`,
|
||||
];
|
||||
|
||||
/** Look up connected client info by clientId */
|
||||
private getConnectedInfo(clientId: string): interfaces.data.IVpnConnectedClient | undefined {
|
||||
return this.vpnState.connectedClients?.find(c => c.clientId === clientId);
|
||||
/** Look up connected client info by clientId or assignedIp */
|
||||
private getConnectedInfo(client: interfaces.data.IVpnClient): interfaces.data.IVpnConnectedClient | undefined {
|
||||
return this.vpnState.connectedClients?.find(
|
||||
c => c.clientId === client.clientId || (client.assignedIp && c.assignedIp === client.assignedIp)
|
||||
);
|
||||
}
|
||||
|
||||
render(): TemplateResult {
|
||||
@@ -277,7 +279,7 @@ export class OpsViewVpn extends DeesElement {
|
||||
.heading2=${'Manage WireGuard and SmartVPN client registrations'}
|
||||
.data=${clients}
|
||||
.displayFunction=${(client: interfaces.data.IVpnClient) => {
|
||||
const conn = this.getConnectedInfo(client.clientId);
|
||||
const conn = this.getConnectedInfo(client);
|
||||
let statusHtml;
|
||||
if (!client.enabled) {
|
||||
statusHtml = html`<span class="statusBadge disabled">disabled</span>`;
|
||||
@@ -349,7 +351,7 @@ export class OpsViewVpn extends DeesElement {
|
||||
type: ['doubleClick'],
|
||||
actionFunc: async (actionData: any) => {
|
||||
const client = actionData.item as interfaces.data.IVpnClient;
|
||||
const conn = this.getConnectedInfo(client.clientId);
|
||||
const conn = this.getConnectedInfo(client);
|
||||
const { DeesModal } = await import('@design.estate/dees-catalog');
|
||||
|
||||
// Fetch telemetry on-demand
|
||||
|
||||
Reference in New Issue
Block a user