mirror of
https://github.com/speatzle/nfsense.git
synced 2025-05-10 18:38:22 +00:00
Add Services Search Provider
This commit is contained in:
parent
97d3609b03
commit
219daf39b9
1 changed files with 17 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue