Skip to content

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

chore: show unmask label in access table (#19457)

ecmadaoeeb7c08540c3
diff --git a/frontend/src/components/Plan/components/SQLCheckSection/SQLCheckSection.vue b/frontend/src/components/Plan/components/SQLCheckSection/SQLCheckSection.vue
index b5bc924f2e..27489420bd 100644
--- a/frontend/src/components/Plan/components/SQLCheckSection/SQLCheckSection.vue
+++ b/frontend/src/components/Plan/components/SQLCheckSection/SQLCheckSection.vue
@@ -1,6 +1,6 @@
<template>
<div class="w-full flex items-center gap-x-4 px-4 py-2">
- <div class="textlabel h-[26px] inline-flex items-center">
+ <div class="textlabel h-6.5 inline-flex items-center">
{{ $t("issue.sql-check.sql-checks") }}
</div>
<div
diff --git a/frontend/src/views/project/ProjectAccessGrantDashboard.vue b/frontend/src/views/project/ProjectAccessGrantDashboard.vue
index c0ee32ca4f..f6cafa499c 100644
--- a/frontend/src/views/project/ProjectAccessGrantDashboard.vue
+++ b/frontend/src/views/project/ProjectAccessGrantDashboard.vue
@@ -66,7 +66,8 @@
</div>
</template>
-<script setup lang="ts">
+<script setup lang="tsx">
+import { useWindowSize } from "@vueuse/core";
import type { DataTableColumn, DataTableSortState } from "naive-ui";
import {
NButton,
@@ -120,6 +121,7 @@ const props = defineProps<{
projectId: string;
}>();
+const { width: windowWidth } = useWindowSize();
const { t } = useI18n();
const router = useRouter();
const dialog = useDialog();
@@ -264,6 +266,8 @@ const handleRevoke = (grant: AccessGrant) => {
});
};
+const isWideScreen = computed(() => windowWidth.value >= 1280);
+
const columns = computed((): DataTableColumn<AccessGrant>[] => [
{
key: "status",
@@ -289,41 +293,63 @@ const columns = computed((): DataTableColumn<AccessGrant>[] => [
ellipsis: true,
render: (grant) => extractUserEmail(grant.creator),
},
- {
- key: "create_time",
- title: t("common.created-at"),
- width: 180,
- render: (grant) => {
- if (!grant.createTime) return "-";
- const ms = getTimeForPbTimestampProtoEs(grant.createTime);
- return h("span", { class: "text-sm" }, formatAbsoluteDateTime(ms));
- },
- },
- {
- key: "expire_time",
- title: t("common.expiration"),
- sortOrder: false,
- width: 180,
- render: (grant) => {
- const info = getAccessGrantExpirationText(grant);
- if (info.type !== "datetime") return "-";
- return h("span", { class: "text-sm" }, info.value);
- },
- },
+ ...(isWideScreen.value
+ ? ([
+ {
+ key: "create_time",
+ title: t("common.created-at"),
+ width: 180,
+ render: (grant: AccessGrant) => {
+ if (!grant.createTime) return "-";
+ const ms = getTimeForPbTimestampProtoEs(grant.createTime);
+ return h("span", { class: "text-sm" }, formatAbsoluteDateTime(ms));
+ },
+ },
+ {
+ key: "expire_time",
+ title: t("common.expiration"),
+ sortOrder: false as const,
+ width: 180,
+ render: (grant: AccessGrant) => {
+ const info = getAccessGrantExpirationText(grant);
+ if (info.type !== "datetime") return "-";
+ return h("span", { class: "text-sm" }, info.value);
+ },
+ },
+ ] as DataTableColumn<AccessGrant>[])
+ : []),
{
key: "query",
title: t("common.statement"),
- ellipsis: true,
- render: (grant) =>
- h(
- NTooltip,
- {},
- {
- trigger: () => h("span", { class: "font-mono text-xs" }, grant.query),
- default: () =>
- h("pre", { class: "max-w-lg whitespace-pre-wrap" }, grant.query),
- }
- ),
+ render: (grant) => {
+ return (
+ <NTooltip>
+ {{
+ trigger: () => (
+ <div class="flex items-center gap-x-1 overflow-hidden">
+ <span class="font-mono text-xs truncate shrink">
+ {grant.query}
+ </span>
+ {grant.unmask && (
+ <NTag
+ class="shrink-0"
+ size="small"
+ type="warning"
+ round={true}
+ bordered={false}
+ >
+ {t("sql-editor.grant-type-unmask")}
+ </NTag>
+ )}
+ </div>
+ ),
+ default: () => (
+ <pre class="max-w-lg whitespace-pre-wrap">{grant.query}</pre>
+ ),
+ }}
+ </NTooltip>
+ );
+ },
},
{
key: "targets",