mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-13 08:12:40 +10:00
fix: devices page (reactivity and relative timestamps)
This commit is contained in:
@ -68,9 +68,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
<td class="whitespace-nowrap px-3 py-4 text-sm text-zinc-400">
|
<td class="whitespace-nowrap px-3 py-4 text-sm text-zinc-400">
|
||||||
{{
|
{{ DateTime.fromISO(client.lastConnected).toRelative() }}
|
||||||
DateTime.fromISO(client.lastConnected).diffNow().toHuman()
|
|
||||||
}}
|
|
||||||
</td>
|
</td>
|
||||||
<td
|
<td
|
||||||
class="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-3"
|
class="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-3"
|
||||||
@ -95,7 +93,7 @@
|
|||||||
import { CheckIcon } from "@heroicons/vue/24/outline";
|
import { CheckIcon } from "@heroicons/vue/24/outline";
|
||||||
import { DateTime } from "luxon";
|
import { DateTime } from "luxon";
|
||||||
|
|
||||||
const clients = await $dropFetch("/api/v1/user/client");
|
const clients = ref(await $dropFetch("/api/v1/user/client"));
|
||||||
|
|
||||||
async function revokeClient(id: string) {
|
async function revokeClient(id: string) {
|
||||||
await $dropFetch(`/api/v1/user/client/${id}`, { method: "DELETE" });
|
await $dropFetch(`/api/v1/user/client/${id}`, { method: "DELETE" });
|
||||||
@ -104,8 +102,8 @@ async function revokeClient(id: string) {
|
|||||||
function revokeClientWrapper(id: string) {
|
function revokeClientWrapper(id: string) {
|
||||||
revokeClient(id)
|
revokeClient(id)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
const index = clients.findIndex((e) => e.id == id);
|
const index = clients.value.findIndex((e) => e.id == id);
|
||||||
clients.splice(index, 1);
|
clients.value.splice(index, 1);
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
createModal(
|
createModal(
|
||||||
|
|||||||
Reference in New Issue
Block a user