Add Services Search Provider

This commit is contained in:
Samuel Lorch 2023-05-13 22:10:31 +02:00
parent 97d3609b03
commit 219daf39b9

View file

@ -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) {