This commit is contained in:
Emile Nijssen 2021-05-22 22:40:11 +02:00
parent d7bb645470
commit d8f45476da
6 changed files with 104 additions and 63 deletions

View file

@ -55,7 +55,14 @@ class API {
return this.call({
method: 'get',
path: '/wireguard/client',
});
}).then(clients => clients.map(client => ({
...client,
createdAt: new Date(client.createdAt),
updatedAt: new Date(client.updatedAt),
latestHandshakeAt: client.latestHandshakeAt !== null
? new Date(client.latestHandshakeAt)
: null,
})));
}
async createClient({ name }) {