From 07439b094da2c2af8346f29c5fd824077149f1f7 Mon Sep 17 00:00:00 2001 From: Samuel Lorch Date: Sat, 4 Nov 2023 15:15:32 +0100 Subject: [PATCH] Add Wireguard definitions --- client/src/definitions.ts | 50 +++++++++++++-------------------------- 1 file changed, 17 insertions(+), 33 deletions(-) diff --git a/client/src/definitions.ts b/client/src/definitions.ts index 6c21926..76fbc06 100644 --- a/client/src/definitions.ts +++ b/client/src/definitions.ts @@ -357,42 +357,26 @@ export const editTypes: { [key: string]: { [key: string]: any } } = { name: 'VPN', 'wireguard_interfaces': { name: 'Wireguard Interface', - validationSchema: toFormValidator( - zod.object({ - }), - ), - sections: [ - { - fields: [ - { key: 'name', label: 'Name', as: 'TextBox', default: 'placeholder' }, - { key: 'public_key', label: 'Public Key', as: 'TextBox', default: 'placeholder' }, - { key: 'private_key', label: 'Private Key', as: 'TextBox', default: 'placeholder' }, - { key: 'listen_port', label: 'Listen Port', as: 'NumberBox' }, - { key: 'peers', label: 'Peers', as: 'MultiSelect', props: { searchProvider: GetPeers } }, - { key: 'comment', label: 'Comment', as: 'MultilineTextBox' }, - ], - }, - ], + fields: { + name: { is: 'TextBox', label: 'Name'}, + public_key: { is: 'TextBox', label: 'Public Key'}, + private_key: { is: 'TextBox', label: 'Private Key'}, + listen_port: { is: 'NumberBox', label: 'Listen Port'}, + peers: { is: 'MutliSelect', label: 'Peers', props: { searchProvider: GetPeers} }, + comment: { is: 'MultilineTextBox', label: 'Comment'}, + }, }, 'wireguard_peers': { name: 'Wireguard Peer', - validationSchema: toFormValidator( - zod.object({ - }), - ), - sections: [ - { - fields: [ - { key: 'name', label: 'Name', as: 'TextBox', default: 'placeholder' }, - { key: 'public_key', label: 'Public Key', as: 'TextBox', default: 'placeholder' }, - { key: 'preshared_key', label: 'Preshared Key', as: 'TextBox', default: 'placeholder' }, - { key: 'allowed_ips', label: 'Allowed IPs', as: 'MultiSelect', props: { searchProvider: GetAddresses } }, - { key: 'endpoint', label: 'Endpoint', as: 'TextBox', default: 'placeholder' }, - { key: 'persistent_keepalive', label: 'Persistent Keepalive', as: 'NumberBox' }, - { key: 'comment', label: 'Comment', as: 'MultilineTextBox' }, - ], - }, - ], + fields: { + name: { is: 'TextBox', label: 'Name'}, + public_key: { is: 'TextBox', label: 'Public Key'}, + preshared_key: { is: 'TextBox', label: 'Preshared Key'}, + allowed_ips: { is: 'MutliSelect', label: 'Allowed IPs', props: { searchProvider: GetAddresses} }, + endpoint: { is: 'TextBox', label: 'Endpoint'}, + persistent_keepalive: { is: 'NumberBox', label: 'Persistent Keepalive'}, + comment: { is: 'MultilineTextBox', label: 'Comment'}, + }, }, }, 'system': {