New components/ui ReadError (destructive Alert + message + optional Retry) is now the single read-error presentation, used by Versions, Services, Canary, OrgAccess, Denials, Tokens, Audit, Extensions, Harness and the Status page (one page-level error instead of one per card). PanelError is the same alert for task panels, and TasksState's error kind, the attempts panel and the task-log pane all offer Retry. Org policy save errors sit beside the Save button instead of at the page top.
79 lines
2.4 KiB
Vue
79 lines
2.4 KiB
Vue
<script setup lang="ts">
|
|
import { TabsContent } from "@/components/ui/tabs";
|
|
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
|
|
|
import AttemptConfig from "./AttemptConfig.vue";
|
|
import ChangedFiles from "./ChangedFiles.vue";
|
|
import DebugView from "./DebugView.vue";
|
|
import PanelError from "./PanelError.vue";
|
|
import PanelLoading from "./PanelLoading.vue";
|
|
import SandboxView from "./SandboxView.vue";
|
|
import TaskLogs from "./TaskLogs.vue";
|
|
import { RUN_TABS } from "./task-run";
|
|
import { useTaskRun } from "./use-task-run";
|
|
|
|
/**
|
|
* The run page's inspector panels: one panel per tab, each reading the attempt
|
|
* the page has selected. The stage rail lives in the page's master pane and is
|
|
* not one of these tabs.
|
|
*
|
|
* Every panel is scoped to one attempt, and "no attempt" is a claim only a
|
|
* successful read of the run history can make -- a read still in flight is not
|
|
* a verdict either, and a failed read is reported as a failed read.
|
|
*/
|
|
const props = defineProps<{ id: string }>();
|
|
|
|
const run = useTaskRun();
|
|
</script>
|
|
|
|
<template>
|
|
<TabsContent v-for="tab in RUN_TABS" :key="tab.id" :value="tab.id">
|
|
<PanelLoading
|
|
v-if="run.attempts === undefined"
|
|
label="Loading this task's attempts…"
|
|
/>
|
|
|
|
<PanelError
|
|
v-else-if="run.attempts === null"
|
|
title="Could not load this task's attempts"
|
|
detail="Archie did not answer."
|
|
retry-label="Retry"
|
|
@retry="run.refreshAll()"
|
|
/>
|
|
|
|
<Empty v-else-if="run.attemptNumber == null">
|
|
<EmptyHeader>
|
|
<EmptyTitle>No attempt recorded</EmptyTitle>
|
|
</EmptyHeader>
|
|
</Empty>
|
|
<TaskLogs
|
|
v-else-if="tab.id === 'log'"
|
|
:state="run.logState"
|
|
:attempt="run.attemptNumber"
|
|
@retry="run.refreshAll()"
|
|
:stages="run.stageNames"
|
|
:filters="run.filters"
|
|
:task-id="props.id"
|
|
@filter="run.setFilters"
|
|
/>
|
|
|
|
<ChangedFiles
|
|
v-else-if="tab.id === 'changes'"
|
|
:state="run.changesState"
|
|
:task="run.task"
|
|
/>
|
|
|
|
<div v-else-if="tab.id === 'debug'" class="space-y-6">
|
|
<DebugView :state="run.debugState" :attempt="run.attemptNumber" />
|
|
<AttemptConfig :events="run.events" :attempt="run.attemptNumber" />
|
|
</div>
|
|
|
|
<SandboxView
|
|
v-else-if="tab.id === 'sandbox'"
|
|
:key="`${props.id}:${run.attemptNumber}`"
|
|
:task-id="props.id"
|
|
:attempt="run.attemptNumber"
|
|
/>
|
|
</TabsContent>
|
|
</template>
|