Skip to content

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

Pipeline status icon and style change

Tianzhou Chenddee67314961
diff --git a/frontend/src/assets/css/tailwind.css b/frontend/src/assets/css/tailwind.css
index 26b3b59f24..6f1f6ba08e 100644
--- a/frontend/src/assets/css/tailwind.css
+++ b/frontend/src/assets/css/tailwind.css
@@ -7,12 +7,16 @@
--color-normal-hover: #9ca3af;
--color-normal-text: #24292e;
+ /* red-600 */
--color-error: #dc2626;
+ /* red-700 */
--color-error-hover: #b91c1c;
-
+ /* gray-200 */
--color-link-hover: #e5e7eb;
+ /* gray-200 */
--color-block-border: #e5e7eb;
+ /* gray-300 */
--color-control-border: #d1d5db;
}
diff --git a/frontend/src/bbkit/BBStepBar.vue b/frontend/src/bbkit/BBStepBar.vue
index 6282b8a860..f7f24d9b52 100644
--- a/frontend/src/bbkit/BBStepBar.vue
+++ b/frontend/src/bbkit/BBStepBar.vue
@@ -14,21 +14,17 @@
class="relative w-6 h-6 flex items-center justify-center rounded-full"
:class="stepClass(step.status)"
>
- <template v-if="step.status == `CREATED`">
+ <template v-if="step.status == `PENDING`">
<span
class="h-2.5 w-2.5 bg-gray-300 rounded-full"
aria-hidden="true"
></span>
</template>
<template v-else-if="step.status == `RUNNING`">
- <svg
- class="w-6 h-6"
- fill="currentColor"
- viewBox="0 0 20 20"
- xmlns="http://www.w3.org/2000/svg"
- >
- <path d="M2 10a8 8 0 018-8v8h8a8 8 0 11-16 0z"></path>
- </svg>
+ <span
+ class="h-2.5 w-2.5 bg-blue-600 rounded-full"
+ aria-hidden="true"
+ ></span>
</template>
<template v-else-if="step.status == `DONE`">
<svg
@@ -46,19 +42,11 @@
</svg>
</template>
<template v-else-if="step.status == `FAILED`">
- <svg
- class="w-5 h-5"
- fill="currentColor"
- viewBox="0 0 20 20"
- xmlns="http://www.w3.org/2000/svg"
+ <span
+ class="h-2.5 w-2.5 rounded-full text-center pb-6 font-medium text-base"
aria-hidden="true"
+ >!</span
>
- <path
- fill-rule="evenodd"
- d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
- clip-rule="evenodd"
- />
- </svg>
</template>
<template v-else-if="step.status == `CANCELED`">
<svg
@@ -71,23 +59,26 @@
>
<path
fill-rule="evenodd"
- d="M13.477 14.89A6 6 0 015.11 6.524l8.367 8.368zm1.414-1.414L6.524 5.11a6 6 0 018.367 8.367zM18 10a8 8 0 11-16 0 8 8 0 0116 0z"
+ d="M3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
clip-rule="evenodd"
></path>
</svg>
</template>
<template v-else-if="step.status == `SKIPPED`">
<svg
- class="w-5 h-5"
+ class="w-4 h-4"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
- aria-hidden="true"
>
- >
<path
fill-rule="evenodd"
- d="M3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
+ d="M10.293 15.707a1 1 0 010-1.414L14.586 10l-4.293-4.293a1 1 0 111.414-1.414l5 5a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0z"
+ clip-rule="evenodd"
+ ></path>
+ <path
+ fill-rule="evenodd"
+ d="M4.293 15.707a1 1 0 010-1.414L8.586 10 4.293 5.707a1 1 0 011.414-1.414l5 5a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0z"
clip-rule="evenodd"
></path>
</svg>
@@ -114,18 +105,18 @@ export default {
setup(props, ctx) {
const stepClass = (status: BBStepStatus) => {
switch (status) {
- case "CREATED":
+ case "PENDING":
return "bg-white border-2 border-gray-300 hover:border-gray-400";
case "RUNNING":
- return "bg-white border-2 border-accent hover:border-accent-hover";
+ return "bg-white border-2 border-blue-600 text-blue-600 hover:text-blue-700 hover:border-blue-700";
case "DONE":
- return "bg-accent hover:bg-accent-hover text-white";
+ return "bg-green-600 hover:bg-green-700 text-white";
case "FAILED":
- return "bg-error hover:bg-error-hover text-white";
+ return "bg-error text-white hover:text-white hover:bg-error-hover";
case "CANCELED":
- return "bg-white border-2 border-accent hover:border-accent-hover";
+ return "bg-white border-2 text-gray-500 border-gray-500 hover:text-gray-600 hover:border-gray-600";
case "SKIPPED":
- return "bg-white border-2 border-accent hover:border-accent-hover";
+ return "bg-white border-2 text-gray-400 border-gray-400 hover:text-gray-500 hover:border-gray-500";
}
};
diff --git a/frontend/src/bbkit/types.ts b/frontend/src/bbkit/types.ts
index 49b34804cb..fec036c67a 100644
--- a/frontend/src/bbkit/types.ts
+++ b/frontend/src/bbkit/types.ts
@@ -8,7 +8,7 @@ export type BBTableSectionDataSource<T> = {
};
export type BBStepStatus =
- | "CREATED"
+ | "PENDING"
| "RUNNING"
| "DONE"
| "FAILED"
diff --git a/frontend/src/components/PipelineTable.vue b/frontend/src/components/PipelineTable.vue
index 9be368a53c..e16c2fc216 100644
--- a/frontend/src/components/PipelineTable.vue
+++ b/frontend/src/components/PipelineTable.vue
@@ -22,10 +22,59 @@
</BBTableCell>
<BBTableCell class="w-16">
<span
- class="px-2 py-1 inline-flex text-xs font-semibold rounded-full"
+ class="relative w-6 h-6 flex items-center justify-center rounded-full"
:class="statusMap[pipeline.attributes.status].class"
>
- {{ statusMap[pipeline.attributes.status].name }}
+ <template v-if="pipeline.attributes.status == `PENDING`">
+ <span
+ class="h-2.5 w-2.5 bg-gray-300 rounded-full"
+ aria-hidden="true"
+ ></span>
+ </template>
+ <template v-else-if="pipeline.attributes.status == `RUNNING`">
+ <span
+ class="h-2.5 w-2.5 bg-blue-600 rounded-full"
+ aria-hidden="true"
+ ></span>
+ </template>
+ <template v-else-if="pipeline.attributes.status == `DONE`">
+ <svg
+ class="w-5 h-5"
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 20 20"
+ fill="currentColor"
+ aria-hidden="true"
+ >
+ <path
+ fill-rule="evenodd"
+ d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z"
+ clip-rule="evenodd"
+ />
+ </svg>
+ </template>
+ <template v-else-if="pipeline.attributes.status == `FAILED`">
+ <span
+ class="h-2.5 w-2.5 rounded-full text-center pb-6 font-medium text-base"
+ aria-hidden="true"
+ >!</span
+ >
+ </template>
+ <template v-else-if="pipeline.attributes.status == `CANCELED`">
+ <svg
+ class="w-5 h-5"
+ fill="currentColor"
+ viewBox="0 0 20 20"
+ xmlns="http://www.w3.org/2000/svg"
+ aria-hidden="true"
+ >
+ >
+ <path
+ fill-rule="evenodd"
+ d="M3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
+ clip-rule="evenodd"
+ ></path>
+ </svg>
+ </template>
</span>
</BBTableCell>
<BBTableCell class="w-auto">
@@ -35,7 +84,8 @@
<BBStepBar :stepList="stageList(pipeline)" />
</BBTableCell>
<BBTableCell class="w-8 hidden lg:table-cell">
- <BBAvatar :username="pipeline.attributes.assignee.name"> </BBAvatar>
+ <BBAvatar :size="`small`" :username="pipeline.attributes.assignee.name">
+ </BBAvatar>
</BBTableCell>
<BBTableCell class="w-24 hidden lg:table-cell">
{{ humanize(pipeline.attributes.createdTs) }}
@@ -63,25 +113,27 @@ interface LocalState {
}
const statusMap = {
- CREATED: {
- name: "Created",
- class: "bg-green-200 text-green-800",
+ PENDING: {
+ name: "Pending",
+ class: "bg-white border-2 border-gray-300 hover:border-gray-400",
},
RUNNING: {
name: "Running",
- class: "bg-yellow-200 text-yellow-800",
+ class:
+ "bg-white border-2 border-blue-600 text-blue-600 hover:text-blue-700 hover:border-blue-700",
},
DONE: {
name: "Done",
- class: "bg-blue-200 text-blue-800",
+ class: "bg-green-600 hover:bg-green-700 text-white",
},
FAILED: {
name: "Failed",
- class: "bg-red-200 text-red-800",
+ class: "bg-error text-white hover:text-white hover:bg-error-hover",
},
CANCELED: {
name: "Canceled",
- class: "bg-gray-200 text-gray-800",
+ class:
+ "bg-white border-2 text-gray-500 border-gray-500 hover:text-gray-600 hover:border-gray-600",
},
};
@@ -126,7 +178,7 @@ export default {
const stageList = function (pipeline: Pipeline): BBStep[] {
return pipeline.attributes.stageProgressList.map((stageProgress) => {
- let stepStatus: BBStepStatus = "CREATED";
+ let stepStatus: BBStepStatus = "PENDING";
switch (stageProgress.status) {
case "RUNNING":
stepStatus = "RUNNING";
@@ -137,8 +189,8 @@ export default {
case "FAILED":
stepStatus = "FAILED";
break;
- case "CREATED":
- stepStatus = "CREATED";
+ case "PENDING":
+ stepStatus = "PENDING";
break;
case "CANCELED":
stepStatus = "CANCELED";
diff --git a/frontend/src/miragejs/factories/pipeline.js b/frontend/src/miragejs/factories/pipeline.js
index 006d678ca5..871fa47f8f 100644
--- a/frontend/src/miragejs/factories/pipeline.js
+++ b/frontend/src/miragejs/factories/pipeline.js
@@ -15,7 +15,7 @@ export default {
return Date.now() - scaleFactor * 3600 * 20 * 1000;
},
status() {
- return "CREATED";
+ return "RUNNING";
},
type() {
let dice = Math.random();
diff --git a/frontend/src/miragejs/seeds/index.js b/frontend/src/miragejs/seeds/index.js
index 1ad5a03851..036890f82d 100644
--- a/frontend/src/miragejs/seeds/index.js
+++ b/frontend/src/miragejs/seeds/index.js
@@ -229,28 +229,28 @@ const fillStage = (environmentList) => {
const i = Math.floor(Math.random() * 5);
if (i % 5 == 0) {
return {
- status: "CREATED",
+ status: "RUNNING",
currentStageId: environmentList[0].id,
stageProgressList: [
{
stageId: environmentList[0].id,
stageName: environmentList[0].name,
- status: "CREATED",
+ status: "RUNNING",
},
{
stageId: environmentList[1].id,
stageName: environmentList[1].name,
- status: "CREATED",
+ status: "PENDING",
},
{
stageId: environmentList[2].id,
stageName: environmentList[2].name,
- status: "CREATED",
+ status: "PENDING",
},
{
stageId: environmentList[3].id,
stageName: environmentList[3].name,
- status: "CREATED",
+ status: "PENDING",
},
],
};
@@ -277,7 +277,7 @@ const fillStage = (environmentList) => {
{
stageId: environmentList[3].id,
stageName: environmentList[3].name,
- status: "CREATED",
+ status: "PENDING",
},
],
};
@@ -326,12 +326,12 @@ const fillStage = (environmentList) => {
{
stageId: environmentList[2].id,
stageName: environmentList[2].name,
- status: "CREATED",
+ status: "PENDING",
},
{
stageId: environmentList[3].id,
stageName: environmentList[3].name,
- status: "CREATED",
+ status: "PENDING",
},
],
};
diff --git a/frontend/src/types/bytebase.ts b/frontend/src/types/bytebase.ts
index ae125fe97b..d6fbcca46f 100644
--- a/frontend/src/types/bytebase.ts
+++ b/frontend/src/types/bytebase.ts
@@ -27,14 +27,14 @@ export type Pipeline = ResourceObject & {
title: string;
createdTs: number;
lastUpdatedTs: number;
- status: "CREATED" | "RUNNING" | "DONE" | "FAILED" | "CANCELED";
+ status: "RUNNING" | "DONE" | "FAILED" | "CANCELED";
type: "DDL" | "DML" | "AUTH";
currentStageId: string;
stageProgressList: {
stageId: string;
stageName: string;
status:
- | "CREATED"
+ | "PENDING"
| "RUNNING"
| "DONE"
| "FAILED"
diff --git a/frontend/src/views/Home.vue b/frontend/src/views/Home.vue
index e11f79efeb..c8ec72aee8 100644
--- a/frontend/src/views/Home.vue
+++ b/frontend/src/views/Home.vue
@@ -67,15 +67,13 @@ export default {
for (const pipeline of pipelineList) {
if (
pipeline.attributes.assignee.id === currentUser!.id &&
- (pipeline.attributes.status === "CREATED" ||
- pipeline.attributes.status === "RUNNING" ||
+ (pipeline.attributes.status === "RUNNING" ||
pipeline.attributes.status === "FAILED")
) {
state.attentionList.push(pipeline);
} else if (
pipeline.attributes.subscriberIdList.includes(currentUser!.id) &&
- (pipeline.attributes.status === "CREATED" ||
- pipeline.attributes.status === "RUNNING" ||
+ (pipeline.attributes.status === "RUNNING" ||
pipeline.attributes.status === "FAILED")
) {
state.subscribeList.push(pipeline);