Compare commits
1 Commits
v0.0.90
...
feat/admin
| Author | SHA1 | Date | |
|---|---|---|---|
| 311f523647 |
10
.idea/data_source_mapping.xml
generated
Normal file
10
.idea/data_source_mapping.xml
generated
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="DataSourcePerFileMappings">
|
||||||
|
<file url="file://$APPLICATION_CONFIG_DIR$/consoles/db/f407a514-c6b4-4b26-9555-445a85892502/console.sql" value="f407a514-c6b4-4b26-9555-445a85892502" />
|
||||||
|
<file url="file://$APPLICATION_CONFIG_DIR$/consoles/db/f407a514-c6b4-4b26-9555-445a85892502/console_1.sql" value="f407a514-c6b4-4b26-9555-445a85892502" />
|
||||||
|
<file url="file://$APPLICATION_CONFIG_DIR$/consoles/db/f407a514-c6b4-4b26-9555-445a85892502/console_2.sql" value="f407a514-c6b4-4b26-9555-445a85892502" />
|
||||||
|
<file url="file://$APPLICATION_CONFIG_DIR$/consoles/db/f407a514-c6b4-4b26-9555-445a85892502/console_3.sql" value="f407a514-c6b4-4b26-9555-445a85892502" />
|
||||||
|
<file url="file://$APPLICATION_CONFIG_DIR$/consoles/db/f407a514-c6b4-4b26-9555-445a85892502/console_4.sql" value="f407a514-c6b4-4b26-9555-445a85892502" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@@ -26,10 +26,17 @@
|
|||||||
|
|
||||||
<div class="overflow-y-auto min-h-0 p-4 space-y-3">
|
<div class="overflow-y-auto min-h-0 p-4 space-y-3">
|
||||||
<!-- Liste des liens à ajouter ci-dessous -->
|
<!-- Liste des liens à ajouter ci-dessous -->
|
||||||
|
<!--Button pour afficher le component admin-users -->
|
||||||
|
<NuxtLink
|
||||||
|
to="/admin/user-list"
|
||||||
|
class="block px-4 py-2 rounded hover:bg-primary-600 transition"
|
||||||
|
>
|
||||||
|
Utilisateurs
|
||||||
|
</NuxtLink>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="p-4">
|
<div class="p-4">
|
||||||
|
<p class="font-bold text-white text-left">v{{ version }}</p>
|
||||||
<button
|
<button
|
||||||
@click="handleLogout"
|
@click="handleLogout"
|
||||||
class="w-full bg-red-600 hover:bg-red-700 py-2 rounded font-bold"
|
class="w-full bg-red-600 hover:bg-red-700 py-2 rounded font-bold"
|
||||||
@@ -37,6 +44,7 @@
|
|||||||
Déconnexion
|
Déconnexion
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
<main class="min-h-0 overflow-auto px-12 py-12 ">
|
<main class="min-h-0 overflow-auto px-12 py-12 ">
|
||||||
@@ -50,7 +58,9 @@
|
|||||||
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import auth from "~/layouts/auth.vue";
|
||||||
|
|
||||||
|
const { version } = useAppVersion()
|
||||||
const handleLogout = async () => {
|
const handleLogout = async () => {
|
||||||
try {
|
try {
|
||||||
await auth.logout()
|
await auth.logout()
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
|
<template>
|
||||||
|
<admin-users v-if="activeCode === 'users'" />
|
||||||
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
layout: 'admin'
|
layout: 'admin'
|
||||||
})
|
})
|
||||||
|
const route = useRoute()
|
||||||
|
|
||||||
|
const activeCode = computed(() => (route.query.code as string))
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
|
||||||
<h1>test</h1>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|||||||
64
frontend/pages/admin/user-list.vue
Normal file
64
frontend/pages/admin/user-list.vue
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
<template>
|
||||||
|
<div class="flex items-center justify-between gap-10">
|
||||||
|
<h1 class="text-3xl font-bold uppercase">Utilisateurs</h1>
|
||||||
|
<button
|
||||||
|
class="text-xl uppercase bg-primary-500 text-white h-[50px] w-[272px]"
|
||||||
|
@click="null"
|
||||||
|
>
|
||||||
|
Ajouter
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<div class="mt-6 border border-slate-200 mb-16 ">
|
||||||
|
<div class="grid grid-cols-3 gap-4 bg-slate-100 px-4 py-3 text-sm font-semibold uppercase tracking-wide">
|
||||||
|
<div>Username</div>
|
||||||
|
<div>Role</div>
|
||||||
|
<div>Action</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-for="user in userList"
|
||||||
|
:key="user.id"
|
||||||
|
class="grid grid-cols-3 gap-4 px-4 py-3 text-sm hover:bg-slate-50 cursor-pointer border-t border-slate-200 items-center"
|
||||||
|
role="button"
|
||||||
|
tabindex="0"
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
{{ user.username}}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{{ user.roles?.join(', ') || ' ---' }}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div class="p-4">
|
||||||
|
<button
|
||||||
|
class="text-xl uppercase bg-primary-500 text-white h-[50px] w-[272px]"
|
||||||
|
@click="null"
|
||||||
|
>
|
||||||
|
Modifier
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
definePageMeta({
|
||||||
|
layout: 'admin'
|
||||||
|
})
|
||||||
|
|
||||||
|
import type {UserData} from "~/services/dto/user-data";
|
||||||
|
import {getUsers} from "~/services/auth";
|
||||||
|
|
||||||
|
const userList = ref<UserData[]>([])
|
||||||
|
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
userList.value = await getUsers()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
export interface UserData {
|
export interface UserData {
|
||||||
id: number
|
id: number
|
||||||
username: string
|
username: string
|
||||||
|
roles?: string[]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
|||||||
private string $username = '';
|
private string $username = '';
|
||||||
|
|
||||||
#[ORM\Column(type: 'json')]
|
#[ORM\Column(type: 'json')]
|
||||||
|
#[Groups(['user:read'])]
|
||||||
private array $roles = [];
|
private array $roles = [];
|
||||||
|
|
||||||
#[ORM\Column]
|
#[ORM\Column]
|
||||||
|
|||||||
Reference in New Issue
Block a user