added teams
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { Link } from '@inertiajs/vue3';
|
||||
import { BookOpen, FolderGit2, LayoutGrid } from '@lucide/vue';
|
||||
import { UserGroup } from '@lucide/vue';
|
||||
import AppLogo from '@/components/AppLogo.vue';
|
||||
import NavFooter from '@/components/NavFooter.vue';
|
||||
import NavMain from '@/components/NavMain.vue';
|
||||
@@ -16,26 +16,17 @@ import {
|
||||
} from '@/components/ui/sidebar';
|
||||
import { dashboard } from '@/routes';
|
||||
import type { NavItem } from '@/types';
|
||||
import teams from "@/routes/teams";
|
||||
|
||||
const mainNavItems: NavItem[] = [
|
||||
{
|
||||
title: 'Dashboard',
|
||||
href: dashboard(),
|
||||
icon: LayoutGrid,
|
||||
title: 'Meine Teams',
|
||||
href: teams.index(),
|
||||
icon: UserGroup,
|
||||
},
|
||||
];
|
||||
|
||||
const footerNavItems: NavItem[] = [
|
||||
{
|
||||
title: 'Repository',
|
||||
href: 'https://github.com/laravel/vue-starter-kit',
|
||||
icon: FolderGit2,
|
||||
},
|
||||
{
|
||||
title: 'Documentation',
|
||||
href: 'https://laravel.com/docs/starter-kits#vue',
|
||||
icon: BookOpen,
|
||||
},
|
||||
];
|
||||
</script>
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,55 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
import teamRoutes from "@/routes/teams";
|
||||
import {Head} from "@inertiajs/vue3";
|
||||
import type {Team} from "@/types/models";
|
||||
import TextLink from "@/components/TextLink.vue";
|
||||
|
||||
defineOptions({
|
||||
layout: {
|
||||
breadcrumbs: [
|
||||
{
|
||||
title: 'Meine Teams',
|
||||
href: teamRoutes.index(),
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
defineProps<{
|
||||
teams: Team[]
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Head title="Teams"/>
|
||||
|
||||
<div>
|
||||
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Slug</th>
|
||||
<th>Mitglieder</th>
|
||||
<th>2FA</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr
|
||||
v-if="teams.length > 0"
|
||||
v-for="team in teams"
|
||||
>
|
||||
<th>{{ team.name }}</th>
|
||||
<th>{{ team.slug }}</th>
|
||||
<th>{{ team.members.length }}</th>
|
||||
<th>{{ team.multi_factor_required }}</th>
|
||||
</tr>
|
||||
<tr v-else class="text-center font-bold">
|
||||
Du bist noch von keinem Team mitglied.
|
||||
Tritt einem Team bei oder <TextLink href="{{ route('teams.create') }}">erstelle eins.</TextLink>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</template>
|
||||
@@ -0,0 +1,16 @@
|
||||
export interface Team {
|
||||
name: string;
|
||||
slug: string;
|
||||
members: TeamMember[];
|
||||
multi_factor_required: boolean;
|
||||
}
|
||||
|
||||
export type TeamMemberRole = 'admin' | 'member'
|
||||
|
||||
export interface TeamMember {
|
||||
name: string;
|
||||
email: string;
|
||||
has_multi_factor: boolean;
|
||||
role: TeamMemberRole;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user