improved table
This commit is contained in:
parent
45e929138b
commit
4f01a74602
4
.gitignore
vendored
4
.gitignore
vendored
@ -1 +1,3 @@
|
||||
.venv
|
||||
.venv
|
||||
__pycache__
|
||||
*.pyc
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
data/db.sqlite
BIN
data/db.sqlite
Binary file not shown.
@ -34,3 +34,7 @@ main {
|
||||
.boxed {
|
||||
@apply space-y-2 bg-blue-200 p-4 rounded-2xl shadow-lg;
|
||||
}
|
||||
|
||||
table td {
|
||||
@apply p-1;
|
||||
}
|
||||
|
||||
@ -38,28 +38,32 @@ const onNewUserCreation = async () => {
|
||||
<template v-if="primaryUser.currentUser.value.role === 'admin'">
|
||||
<div class="boxed">
|
||||
<h3>Users</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th class="font-bold">Username</th>
|
||||
<th class="font-bold">Role</th>
|
||||
<th class="font-bold">Actions</th>
|
||||
</tr>
|
||||
<tr v-for="user in primaryUser.allUsers.value" :key="user.user">
|
||||
<td>{{ user.user }}</td>
|
||||
<td>{{ user.role }}</td>
|
||||
<td>
|
||||
<button
|
||||
@click="
|
||||
() =>
|
||||
deleteUser(user)
|
||||
.then(() => (userDeletionMsg = { message: 'Success', type: 'success' }))
|
||||
.catch((e) => (userDeletionMsg = { message: e, type: 'error' }))
|
||||
"
|
||||
>
|
||||
Delete
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
<table class="table-auto">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="font-bold">Username</th>
|
||||
<th class="font-bold">Role</th>
|
||||
<th class="font-bold">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="user in primaryUser.allUsers.value" :key="user.user">
|
||||
<td>{{ user.user }}</td>
|
||||
<td>{{ user.role }}</td>
|
||||
<td>
|
||||
<button
|
||||
@click="
|
||||
() =>
|
||||
deleteUser(user)
|
||||
.then(() => (userDeletionMsg = { message: 'Success', type: 'success' }))
|
||||
.catch((e) => (userDeletionMsg = { message: e, type: 'error' }))
|
||||
"
|
||||
>
|
||||
Delete
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<UserInfo :type="userDeletionMsg.type as any" v-if="userDeletionMsg.message">
|
||||
<template #default>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user