27 lines
481 B
TypeScript
27 lines
481 B
TypeScript
import {Api} from "~/api/Api";
|
|
|
|
export class Target
|
|
{
|
|
|
|
constructor (
|
|
public key: string,
|
|
public display: string,
|
|
public status: string,
|
|
public pings: Ping[],
|
|
) {}
|
|
|
|
static get(onSuccess: (targets: Target[]) => void)
|
|
{
|
|
Api.get<Target[]>("/targets")
|
|
.then((response) => {
|
|
onSuccess(response.data)
|
|
});
|
|
}
|
|
}
|
|
|
|
export class Ping
|
|
{
|
|
constructor (
|
|
public result: string
|
|
) {}
|
|
} |