feat(ui): start tasks from the dashboard and slim it to activity and setup
This commit is contained in:
23 files changed
+297
-487
No files matched your search
@@ -0,0 +1,32 @@
|
||||
<script setup lang="ts">
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog";
|
||||
import NewTaskForm from "./NewTaskForm.vue";
|
||||
|
||||
const props = defineProps<{ workflow?: string; instructions?: string }>();
|
||||
const router = useRouter();
|
||||
const open = defineModel<boolean>("open", { default: false });
|
||||
|
||||
function started(taskId: number) {
|
||||
open.value = false;
|
||||
void router.push(`/tasks/${taskId}`);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Dialog v-model:open="open">
|
||||
<DialogContent class="sm:max-w-[640px]">
|
||||
<DialogHeader>
|
||||
<DialogTitle>New task</DialogTitle>
|
||||
</DialogHeader>
|
||||
<NewTaskForm
|
||||
v-if="open"
|
||||
:initial-workflow="props.workflow"
|
||||
:initial-instructions="props.instructions"
|
||||
@started="started"
|
||||
@cancel="open = false"
|
||||
/>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</template>
|
||||
Reference in new issue
Block a user