refactor(ui): build settings, org, task, workflow and dashboard pages from the shared components
This commit is contained in:
77 files changed
+505
-744
No files matched your search
@@ -307,7 +307,7 @@ const title = computed(() => (props.binding ? "Edit binding" : "New binding"));
|
||||
</FieldGroup>
|
||||
|
||||
<section v-if="props.binding" class="mt-4 flex flex-col gap-2">
|
||||
<h3 class="text-sm font-medium">Recent dispatches</h3>
|
||||
<h3 class="text-caption font-medium tracking-[0.06em] text-fg-subtle uppercase">Recent dispatches</h3>
|
||||
<DispatchLinks kind="bindings" :id="props.binding.id" />
|
||||
</section>
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ import { Check, Pause, Pencil, Play, Trash2 } from "@lucide/vue";
|
||||
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { DropdownMenuItem } from "@/components/ui/dropdown-menu";
|
||||
import { MoreMenu } from "@/components/ui/more-menu";
|
||||
import { TableCell, TableRow } from "@/components/ui/table";
|
||||
import BindingStatusBadge from "./BindingStatusBadge.vue";
|
||||
import { eventTypeLabel, type EventType } from "@/captures/event-types";
|
||||
@@ -90,31 +92,19 @@ const emit = defineEmits<{
|
||||
>
|
||||
<Check data-icon="inline-start" />
|
||||
Approve</Button>
|
||||
<Button
|
||||
v-if="props.binding.status === 'armed'"
|
||||
variant="outline"
|
||||
size="sm"
|
||||
@click="emit('pause', props.binding)"
|
||||
>
|
||||
<Pause data-icon="inline-start" />
|
||||
Pause</Button>
|
||||
<!-- Resuming returns the binding to pending approval, so it is
|
||||
approved again before it fires. -->
|
||||
<Button
|
||||
v-if="props.binding.status === 'paused'"
|
||||
variant="outline"
|
||||
size="sm"
|
||||
@click="emit('resume', props.binding)"
|
||||
>
|
||||
<Play data-icon="inline-start" />
|
||||
Resume</Button>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
@click="emit('delete', props.binding)"
|
||||
>
|
||||
<Trash2 data-icon="inline-start" />
|
||||
Delete</Button>
|
||||
<MoreMenu :label="`More actions for ${props.binding.name}`">
|
||||
<DropdownMenuItem
|
||||
v-if="props.binding.status === 'armed'"
|
||||
@select="emit('pause', props.binding)"
|
||||
><Pause />Pause</DropdownMenuItem>
|
||||
<!-- Resuming returns the binding to pending approval, so it is
|
||||
approved again before it fires. -->
|
||||
<DropdownMenuItem
|
||||
v-if="props.binding.status === 'paused'"
|
||||
@select="emit('resume', props.binding)"
|
||||
><Play />Resume</DropdownMenuItem>
|
||||
<DropdownMenuItem variant="destructive" @select="emit('delete', props.binding)"><Trash2 />Delete</DropdownMenuItem>
|
||||
</MoreMenu>
|
||||
</div>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import {
|
||||
Empty,
|
||||
EmptyDescription,
|
||||
@@ -65,8 +65,7 @@ const failureTitle = computed(() =>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
|
||||
<Card v-else>
|
||||
<CardContent>
|
||||
<Section v-else>
|
||||
<Table>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
@@ -103,6 +102,5 @@ const failureTitle = computed(() =>
|
||||
</template>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Section>
|
||||
</template>
|
||||
@@ -2,7 +2,7 @@
|
||||
import { ref, watch } from "vue";
|
||||
|
||||
import { api } from "@/lib/api";
|
||||
import { ago } from "@/lib/format";
|
||||
import { Timestamp } from "@/components/ui/timestamp";
|
||||
|
||||
/**
|
||||
* The dispatch ledger rows for one binding, capture or task, each linking the
|
||||
@@ -76,7 +76,7 @@ const captureLink = (id: string) => ({
|
||||
>
|
||||
<span v-else>{{ d.reason || "claimed, no task recorded" }}</span>
|
||||
</template>
|
||||
<span>{{ ago(d.dispatched_at) }}</span>
|
||||
<Timestamp :at="d.dispatched_at" />
|
||||
</li>
|
||||
</ul>
|
||||
<p v-else-if="props.kind !== 'tasks'" class="text-xs text-fg-muted">No dispatches yet.</p>
|
||||
|
||||
Reference in new issue
Block a user