diff --git a/core/frontend/src/store/helper.ts b/core/frontend/src/store/helper.ts index a32dccc75e..83247b17e6 100644 --- a/core/frontend/src/store/helper.ts +++ b/core/frontend/src/store/helper.ts @@ -150,6 +150,18 @@ class PingStore extends VuexModule { this.updateFoundServices([]) }) } + + @Action + async ping(options: {host: string, iface?: string}): Promise { + return back_axios({ + method: 'get', + url: `${this.API_URL}/ping`, + params: { host: options.host, interface_addr: options.iface }, + timeout: 15000, + }) + .then((response) => response.data as boolean) + .catch(() => undefined) + } } export { PingStore }