Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: improve task run time display in rollout views (#17092)

boojackcb1097a3b01a
diff --git a/frontend/src/components/Plan/components/RolloutView/StageCard.vue b/frontend/src/components/Plan/components/RolloutView/StageCard.vue
index 0f82a8a4da..b14c1c015e 100644
--- a/frontend/src/components/Plan/components/RolloutView/StageCard.vue
+++ b/frontend/src/components/Plan/components/RolloutView/StageCard.vue
@@ -95,21 +95,37 @@
<template #avatar>
<TaskStatus :status="task.status" size="tiny" disabled />
</template>
- <div class="flex items-center flex-nowrap">
+ <div class="flex items-center flex-nowrap gap-2">
<DatabaseDisplay :database="task.target" />
- <NTooltip v-if="task.runTime">
- <template #trigger>
- <CalendarClockIcon
- class="w-3.5 h-3.5 ml-1 text-gray-500"
- />
- </template>
- ({{ $t("task.scheduled-time") }})
- {{
- humanizeTs(
- getTimeForPbTimestampProtoEs(task.runTime, 0) / 1000
- )
- }}
- </NTooltip>
+ <template v-if="task.runTime">
+ <span class="font-mono text-control-light opacity-80"
+ >/</span
+ >
+ <NTooltip>
+ <template #trigger>
+ <div class="flex items-center gap-1">
+ <CalendarClockIcon
+ :size="14"
+ class="text-control-light"
+ />
+ <span class="text-control">{{
+ humanizeTs(
+ getTimeForPbTimestampProtoEs(task.runTime, 0) /
+ 1000
+ )
+ }}</span>
+ </div>
+ </template>
+ <div class="space-y-1">
+ <div class="text-sm opacity-80">
+ {{ $t("task.scheduled-time") }}
+ </div>
+ <div class="text-sm whitespace-nowrap">
+ {{ formatFullDateTime(task.runTime) }}
+ </div>
+ </div>
+ </NTooltip>
+ </template>
</div>
</NTag>
<NTag
@@ -166,6 +182,7 @@
<script setup lang="ts">
import type { Timestamp as TimestampPb } from "@bufbuild/protobuf/wkt";
+import dayjs from "dayjs";
import {
CircleFadingPlusIcon,
ChevronDownIcon,
@@ -314,6 +331,11 @@ const latestUpdateTimestamp = computed(() => {
return latestTimestamp;
});
+const formatFullDateTime = (timestamp: TimestampPb) => {
+ const timestampInMilliseconds = getTimeForPbTimestampProtoEs(timestamp, 0);
+ return dayjs(timestampInMilliseconds).local().format();
+};
+
const getTaskCount = (status: Task_Status) => {
return filteredTasks.value.filter((task) => task.status === status).length;
};
diff --git a/frontend/src/components/Plan/components/RolloutView/TaskTable.vue b/frontend/src/components/Plan/components/RolloutView/TaskTable.vue
index bac8f85708..4c461e17ed 100644
--- a/frontend/src/components/Plan/components/RolloutView/TaskTable.vue
+++ b/frontend/src/components/Plan/components/RolloutView/TaskTable.vue
@@ -16,6 +16,7 @@
</template>
<script lang="tsx" setup>
+import dayjs from "dayjs";
import { head } from "lodash-es";
import { CalendarClockIcon } from "lucide-vue-next";
import type { DataTableColumn } from "naive-ui";
@@ -163,6 +164,12 @@ const getLatestTaskRun = (task: Task) => {
return head(relatedTaskRuns);
};
+// Format full datetime for display
+const formatFullDateTime = (timestamp: any) => {
+ const timestampInMilliseconds = getTimeForPbTimestampProtoEs(timestamp, 0);
+ return dayjs(timestampInMilliseconds).local().format();
+};
+
const columnList = computed((): DataTableColumn<Task>[] => {
return [
{
@@ -216,7 +223,16 @@ const columnList = computed((): DataTableColumn<Task>[] => {
</div>
</NTag>
),
- default: () => t("task.scheduled-time"),
+ default: () => (
+ <div class="space-y-1">
+ <div class="text-sm opacity-80">
+ {t("task.scheduled-time")}
+ </div>
+ <div class="text-sm whitespace-nowrap">
+ {formatFullDateTime(task.runTime)}
+ </div>
+ </div>
+ ),
}}
</NTooltip>
)}
diff --git a/frontend/src/components/Plan/components/RolloutView/TaskView.vue b/frontend/src/components/Plan/components/RolloutView/TaskView.vue
index bd17dbaf65..11e50bf01c 100644
--- a/frontend/src/components/Plan/components/RolloutView/TaskView.vue
+++ b/frontend/src/components/Plan/components/RolloutView/TaskView.vue
@@ -16,6 +16,28 @@
</template>
{{ $t("common.version") }}
</NTooltip>
+ <NTooltip v-if="task.runTime">
+ <template #trigger>
+ <NTag round>
+ <div class="flex items-center gap-1">
+ <CalendarClockIcon class="w-4 h-4 opacity-80" />
+ <span>{{
+ humanizeTs(
+ getTimeForPbTimestampProtoEs(task.runTime, 0) / 1000
+ )
+ }}</span>
+ </div>
+ </NTag>
+ </template>
+ <div class="space-y-1">
+ <div class="text-sm opacity-80">
+ {{ $t("task.scheduled-time") }}
+ </div>
+ <div class="text-sm whitespace-nowrap">
+ {{ formatFullDateTime(task.runTime) }}
+ </div>
+ </div>
+ </NTooltip>
</div>
</div>
@@ -81,7 +103,9 @@
</template>
<script setup lang="ts">
+import dayjs from "dayjs";
import { last } from "lodash-es";
+import { CalendarClockIcon } from "lucide-vue-next";
import { NTag, NTooltip } from "naive-ui";
import { computed, watchEffect } from "vue";
import { semanticTaskType } from "@/components/IssueV1";
@@ -94,7 +118,7 @@ import {
useCurrentProjectV1,
useSheetV1Store,
} from "@/store";
-import { unknownTask } from "@/types";
+import { getTimeForPbTimestampProtoEs, unknownTask } from "@/types";
import { TaskRun_Status } from "@/types/proto-es/v1/rollout_service_pb";
import { databaseForTask } from "@/utils";
import {
@@ -154,6 +178,11 @@ const rollbackableTaskRun = computed(() => {
const database = computed(() => databaseForTask(project.value, task.value));
const schemaVersion = computed(() => extractSchemaVersionFromTask(task.value));
+const formatFullDateTime = (timestamp: any) => {
+ const timestampInMilliseconds = getTimeForPbTimestampProtoEs(timestamp, 0);
+ return dayjs(timestampInMilliseconds).local().format();
+};
+
// Sheet statement
const statement = computed(() => {
const sheet = sheetStore.getSheetByName(sheetNameOfTaskV1(task.value));
diff --git a/frontend/src/components/Plan/components/common/DatabaseDisplay.vue b/frontend/src/components/Plan/components/common/DatabaseDisplay.vue
index 67434f0751..ba1ce32187 100644
--- a/frontend/src/components/Plan/components/common/DatabaseDisplay.vue
+++ b/frontend/src/components/Plan/components/common/DatabaseDisplay.vue
@@ -17,12 +17,12 @@
{{ databaseDisplayName }}
</span>
<router-link
- class="pl-2 opacity-60 hover:opacity-100"
+ class="pl-1 opacity-60 hover:opacity-100"
:to="`/${database}`"
target="_blank"
@click.stop
>
- <ExternalLinkIcon :size="16" />
+ <ExternalLinkIcon :size="14" />
</router-link>
</div>
</template>