From 219daf39b9bb32f9b66178adfc3e7b67d975ca46 Mon Sep 17 00:00:00 2001 From: Samuel Lorch Date: Sat, 13 May 2023 22:10:31 +0200 Subject: [PATCH] Add Services Search Provider --- client/src/definitions.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/client/src/definitions.ts b/client/src/definitions.ts index 5bfb91c..6361e46 100644 --- a/client/src/definitions.ts +++ b/client/src/definitions.ts @@ -48,6 +48,23 @@ const GetAddresses: SearchProvider = async (o) => { } }; +const GetServices: SearchProvider = async (o) => { + let res = await apiCall("Object.GetServices", {}); + if (res.Error === null) { + console.debug("services", res.Data.Services); + let obj = {} as Options; + Object.keys(res.Data.Services).forEach(function (key, index) { + obj[key] = { + display: key, + }; + }); + return obj; + } else { + console.debug("error", res); + return {} as Options; + } +}; + const GetPeers: SearchProvider = async (o) => { let res = await apiCall("VPN.GetWireguardPeers", {}); if (res.Error === null) {