added created view and confirm show
CI/CD / test_and_check_app (push) Failing after 48s
CI/CD / Publish immutable image (push) Skipped

This commit is contained in:
2026-10-10 23:29:45 +02:00
parent 095ce60d8f
commit 8fadceabed
8 changed files with 151 additions and 33 deletions
+31
View File
@@ -0,0 +1,31 @@
<script lang="ts" setup>
import { Head } from '@inertiajs/vue3';
import { Card, CardContent, CardTitle } from '@/components/ui/card';
import { Input } from '@/components/ui/input';
import { Button } from '@/components/ui/button';
const props = defineProps<{
otsLink: string;
}>();
const copyLink = async () => {
await navigator.clipboard.writeText(props.otsLink);
};
</script>
<template>
<div class="flex flex-col justify-center p-16">
<Head title="OTS" />
<Card class="w-full">
<CardContent>
<CardTitle class="mb-8 text-center text-2xl">
<h1>Erstellt!</h1>
</CardTitle>
<div class="flex gap-4">
<Input :model-value="otsLink" name="ots_link" readonly />
<Button variant="secondary" @click="copyLink">Kopieren</Button>
</div>
</CardContent>
</Card>
</div>
</template>
+51 -5
View File
@@ -1,19 +1,46 @@
<script lang="ts" setup>
import { Head } from '@inertiajs/vue3';
import otsRoutes from '@/routes/ots';
import { Head, useHttp } from '@inertiajs/vue3';
import type { OTS } from '@/types/models';
import { Card, CardContent } from '@/components/ui/card';
import {
Card,
CardAction,
CardContent,
CardDescription,
CardTitle,
} from '@/components/ui/card';
import { Textarea } from '@/components/ui/textarea';
import { ref } from 'vue';
import { Button } from '@/components/ui/button';
defineProps<{
oneTimeSecret: OTS;
const props = defineProps<{
oneTimeSecretId: string;
}>();
const oneTimeSecret = ref<OTS | null>(null);
const loadingSecret = ref<boolean>(false);
const confirmShow = async () => {
loadingSecret.value = true;
try {
oneTimeSecret.value = await useHttp<{}, { secret: string }>().submit(
otsRoutes.reveal({
oneTimeSecret: props.oneTimeSecretId,
}),
);
} catch (error) {
console.error(error);
} finally {
loadingSecret.value = false;
}
};
</script>
<template>
<div class="flex flex-col justify-center p-16">
<Head title="OTS" />
<Card class="w-full">
<CardContent>
<CardContent v-if="oneTimeSecret">
<Textarea
v-model="oneTimeSecret.secret"
:rows="10"
@@ -21,6 +48,25 @@ defineProps<{
readonly
/>
</CardContent>
<CardContent v-else>
<CardTitle class="text-center text-xl">
Möchtest du das Secret Anzeigen?
</CardTitle>
<CardDescription class="text-md mb-8 text-center">
Nach dem Anzeigen des Secrets wird es unwiderruflich gelöscht und kann
nicht noch einmal angezeigt werden!
</CardDescription>
<CardAction class="justify-self-center">
<Button
:disabled="loadingSecret"
class="cursor-pointer"
variant="destructive"
@click="confirmShow"
>
Anzeigen
</Button>
</CardAction>
</CardContent>
</Card>
</div>
</template>
-1
View File
@@ -8,7 +8,6 @@ export interface Team {
export interface OTS {
secret: string;
expires_at: string;
}
export type TeamMemberRole = 'owner' | 'admin' | 'member';