2025-06-30 18:58:24 +02:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: © 2025 Hornwitser <code@hornwitser.no>
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
-->
|
2025-06-23 00:20:33 +02:00
|
|
|
<template>
|
|
|
|
<table>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Id</th>
|
|
|
|
<th>Name</th>
|
|
|
|
<th>Type</th>
|
|
|
|
<th>Last Update</th>
|
|
|
|
<th></th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr v-for="user in usersStore.users.values()">
|
|
|
|
<td>{{ user.id }}</td>
|
|
|
|
<td>
|
2025-09-06 15:16:02 +02:00
|
|
|
<NuxtLink :to="`/admin/users/${user.id}`">
|
|
|
|
<template v-if="user.name">
|
|
|
|
{{ user.name }}
|
|
|
|
</template>
|
|
|
|
<i v-else>(empty)</i>
|
|
|
|
</NuxtLink>
|
2025-06-23 00:20:33 +02:00
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<select
|
|
|
|
v-if='user.type !== "anonymous"'
|
|
|
|
v-model="user.type"
|
|
|
|
>
|
|
|
|
<option value="regular">Regular</option>
|
|
|
|
<option value="crew">Crew</option>
|
|
|
|
<option value="admin">Admin</option>
|
|
|
|
</select>
|
|
|
|
<template v-else>
|
|
|
|
{{ user.type }}
|
|
|
|
</template>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
{{ user.updatedAt.toFormat("yyyy-LL-dd HH:mm") }}
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<button
|
|
|
|
v-if="user.isModified()"
|
|
|
|
type="button"
|
2025-09-06 15:16:02 +02:00
|
|
|
@click="usersStore.saveUser(user);"
|
2025-06-23 00:20:33 +02:00
|
|
|
>Save</button>
|
|
|
|
<button
|
|
|
|
v-if="user.isModified()"
|
|
|
|
type="button"
|
|
|
|
@click="user.discard()"
|
|
|
|
>Discard</button>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
useEventSource();
|
|
|
|
const usersStore = useUsersStore();
|
|
|
|
</script>
|