Skip to content

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

chore: ui update and fix database group (#9612)

ecmadaoafd3c974ee1c
diff --git a/frontend/src/components/AnomalyCenter/AnomalyCenterDashboard.vue b/frontend/src/components/AnomalyCenter/AnomalyCenterDashboard.vue
index dddef416b5..115d2258a3 100644
--- a/frontend/src/components/AnomalyCenter/AnomalyCenterDashboard.vue
+++ b/frontend/src/components/AnomalyCenter/AnomalyCenterDashboard.vue
@@ -76,7 +76,6 @@
<SearchBox
ref="searchField"
v-model:value="state.searchText"
- style="width: 18rem"
:placeholder="
$t('anomaly.table-search-placeholder', {
type:
diff --git a/frontend/src/components/Branch/BranchCreateView.vue b/frontend/src/components/Branch/BranchCreateView.vue
index 5db0da7bb5..1e180e8e7f 100644
--- a/frontend/src/components/Branch/BranchCreateView.vue
+++ b/frontend/src/components/Branch/BranchCreateView.vue
@@ -400,7 +400,7 @@ const handleConfirm = async () => {
createdSchemaDesign.name
);
router.replace({
- name: "workspace.branch.detail",
+ name: "workspace.project.branch.detail",
params: {
projectSlug: projectV1Slug(project.value),
branchName: sheetId,
diff --git a/frontend/src/components/Branch/BranchDetailView.vue b/frontend/src/components/Branch/BranchDetailView.vue
index 1f896a2ab2..060eba770a 100644
--- a/frontend/src/components/Branch/BranchDetailView.vue
+++ b/frontend/src/components/Branch/BranchDetailView.vue
@@ -462,7 +462,7 @@ const handleSaveBranch = async () => {
);
state.isEditing = false;
router.replace({
- name: "workspace.branch.detail",
+ name: "workspace.project.branch.detail",
params: {
projectSlug: projectV1Slug(project.value),
branchName: sheetId,
@@ -525,7 +525,7 @@ const handleMergeAfterConflictResolved = (branchName: string) => {
state.isEditing = false;
const [_, sheetId] = getProjectAndSchemaDesignSheetId(branchName);
router.replace({
- name: "workspace.branch.detail",
+ name: "workspace.project.branch.detail",
params: {
projectSlug: projectV1Slug(project.value),
branchName: sheetId,
diff --git a/frontend/src/components/Branch/BranchTable.vue b/frontend/src/components/Branch/BranchTable.vue
index 8a1ef1244d..49573466a6 100644
--- a/frontend/src/components/Branch/BranchTable.vue
+++ b/frontend/src/components/Branch/BranchTable.vue
@@ -13,20 +13,24 @@
{{ projectV1Name(getFormattedValue(branch).project) }}
</div>
<div class="bb-grid-cell">
- <NEllipsis :line-clamp="1">{{ branch.title }}</NEllipsis>
+ <NPerformantEllipsis :line-clamp="1">{{
+ branch.title
+ }}</NPerformantEllipsis>
</div>
<div class="bb-grid-cell">
- <NEllipsis :line-clamp="1">{{
+ <NPerformantEllipsis :line-clamp="1">{{
getFormattedValue(branch).parentBranch
- }}</NEllipsis>
+ }}</NPerformantEllipsis>
</div>
<div class="bb-grid-cell">
<DatabaseInfo :database="getFormattedValue(branch).database" />
</div>
<div class="bb-grid-cell">
- <span class="text-gray-400">{{
- getFormattedValue(branch).updatedTimeStr
- }}</span>
+ <NPerformantEllipsis>
+ <span class="text-gray-400">
+ {{ getFormattedValue(branch).updatedTimeStr }}</span
+ >
+ </NPerformantEllipsis>
</div>
</template>
</BBGrid>
@@ -34,7 +38,7 @@
<script lang="ts" setup>
import dayjs from "dayjs";
-import { NEllipsis } from "naive-ui";
+import { NPerformantEllipsis } from "naive-ui";
import { computed } from "vue";
import { useI18n } from "vue-i18n";
import { BBGridColumn } from "@/bbkit";
diff --git a/frontend/src/components/Changelist/ChangelistDetail/ChangelistDetail.vue b/frontend/src/components/Changelist/ChangelistDetail/ChangelistDetail.vue
index 13404d91c5..7bbfa3eadd 100644
--- a/frontend/src/components/Changelist/ChangelistDetail/ChangelistDetail.vue
+++ b/frontend/src/components/Changelist/ChangelistDetail/ChangelistDetail.vue
@@ -1,5 +1,5 @@
<template>
- <div class="flex flex-col items-stretch gap-y-4 px-4 relative">
+ <div class="flex flex-col items-stretch gap-y-4 relative">
<NavBar />
<ChangeTable
@@ -124,7 +124,7 @@ const handleReorderMove = (row: number, delta: -1 | 1) => {
};
const documentTitle = computed(() => {
- if (route.name !== "workspace.changelist.detail") {
+ if (route.name !== "workspace.project.changelist.detail") {
return undefined;
}
return changelist.value.description;
diff --git a/frontend/src/components/CommonSidebar.vue b/frontend/src/components/CommonSidebar.vue
index 760f113bee..d1945d76d8 100644
--- a/frontend/src/components/CommonSidebar.vue
+++ b/frontend/src/components/CommonSidebar.vue
@@ -6,7 +6,7 @@
<router-link
v-if="item.type === 'route' && item.path"
:to="item.path"
- class="outline-item group w-full flex items-center px-2 py-1.5 !text-base"
+ class="outline-item group w-full font-medium flex items-center px-2 py-1.5 !text-base"
:class="getItemClass(item.path)"
>
<component :is="item.icon" class="mr-2 w-5 h-5 text-gray-500" />
diff --git a/frontend/src/components/DatabaseGroup/DatabaseGroupPanel.vue b/frontend/src/components/DatabaseGroup/DatabaseGroupPanel.vue
index e879c906a3..e3314105a0 100644
--- a/frontend/src/components/DatabaseGroup/DatabaseGroupPanel.vue
+++ b/frontend/src/components/DatabaseGroup/DatabaseGroupPanel.vue
@@ -163,7 +163,8 @@ const doDelete = () => {
const databaseGroup = props.databaseGroup as DatabaseGroup;
await dbGroupStore.deleteDatabaseGroup(databaseGroup.name);
if (
- router.currentRoute.value.name === "workspace.database-group.detail"
+ router.currentRoute.value.name ===
+ "workspace.project.database-group.detail"
) {
router.replace({
name: "workspace.project.detail",
@@ -179,7 +180,7 @@ const doDelete = () => {
await dbGroupStore.deleteSchemaGroup(schemaGroupName);
if (
router.currentRoute.value.name ===
- "workspace.database-group.table-group.detail"
+ "workspace.project.database-group.table-group.detail"
) {
const [_, databaseGroupName] =
getProjectNameAndDatabaseGroupNameAndSchemaGroupName(
@@ -258,15 +259,16 @@ const doConfirm = async () => {
return;
}
- if (!buildCELExpr(formState.expr)) {
- return;
+ let tableExpression = "true";
+ if (buildCELExpr(formState.expr)) {
+ const celStrings = await batchConvertParsedExprToCELString([
+ ParsedExpr.fromJSON({
+ expr: buildCELExpr(formState.expr),
+ }),
+ ]);
+ tableExpression = celStrings[0] || "true";
}
- const celStrings = await batchConvertParsedExprToCELString([
- ParsedExpr.fromJSON({
- expr: buildCELExpr(formState.expr),
- }),
- ]);
const resourceId = formState.resourceId;
await dbGroupStore.createSchemaGroup({
dbGroupName: formState.selectedDatabaseGroupId,
@@ -274,11 +276,21 @@ const doConfirm = async () => {
name: `${formState.selectedDatabaseGroupId}/schemaGroups/${resourceId}`,
tablePlaceholder: formState.placeholder,
tableExpr: Expr.fromJSON({
- expression: celStrings[0] || "true",
+ expression: tableExpression,
}),
},
schemaGroupId: resourceId,
});
+ const dbGroup = dbGroupStore.getDBGroupByName(
+ formState.selectedDatabaseGroupId
+ );
+ if (dbGroup) {
+ router.push(
+ `/project/${projectV1Slug(dbGroup.project)}/database-groups/${
+ dbGroup.databaseGroupName
+ }`
+ );
+ }
} else {
const celStrings = await batchConvertParsedExprToCELString([
ParsedExpr.fromJSON({
@@ -294,6 +306,12 @@ const doConfirm = async () => {
});
}
}
+ pushNotification({
+ module: "bytebase",
+ style: "SUCCESS",
+ title: isCreating.value ? t("common.created") : t("common.updated"),
+ });
+ emit("close");
} catch (error) {
console.error(error);
pushNotification({
@@ -304,7 +322,5 @@ const doConfirm = async () => {
});
return;
}
-
- emit("close");
};
</script>
diff --git a/frontend/src/components/DatabaseGroup/DatabaseGroupSelect.vue b/frontend/src/components/DatabaseGroup/DatabaseGroupSelect.vue
index d15cfd4ad2..a6863f2062 100644
--- a/frontend/src/components/DatabaseGroup/DatabaseGroupSelect.vue
+++ b/frontend/src/components/DatabaseGroup/DatabaseGroupSelect.vue
@@ -9,6 +9,7 @@
</template>
<script lang="ts" setup>
+import { head } from "lodash-es";
import { SelectOption } from "naive-ui";
import { computed, reactive, watch } from "vue";
import { useDBGroupStore } from "@/store";
@@ -68,6 +69,10 @@ watch(
state.selectedDatabaseGroup = dbGroupList.value.find(
(item) => item.name === props.selected
)?.name;
+ if (!state.selectedDatabaseGroup) {
+ state.selectedDatabaseGroup = head(dbGroupList.value)?.name;
+ }
+ emit("update:selected", state.selectedDatabaseGroup);
},
{ immediate: true, deep: true }
);
diff --git a/frontend/src/components/DatabaseGroup/ProjectDatabaseGroupPanel.vue b/frontend/src/components/DatabaseGroup/ProjectDatabaseGroupPanel.vue
index 120ce573be..7a0e914f05 100644
--- a/frontend/src/components/DatabaseGroup/ProjectDatabaseGroupPanel.vue
+++ b/frontend/src/components/DatabaseGroup/ProjectDatabaseGroupPanel.vue
@@ -28,6 +28,7 @@
:project="project"
:resource-type="state.resourceType"
:database-group="state.editingDatabaseGroup"
+ @close="state.showDatabaseGroupPanel = false"
/>
<FeatureModal
diff --git a/frontend/src/components/DatabaseOverviewPanel.vue b/frontend/src/components/DatabaseOverviewPanel.vue
index 9f18aa91fa..4c2c3a407f 100644
--- a/frontend/src/components/DatabaseOverviewPanel.vue
+++ b/frontend/src/components/DatabaseOverviewPanel.vue
@@ -105,13 +105,11 @@
}}</span>
<span v-else>{{ $t("db.tables") }}</span>
</div>
- <div>
- <SearchBox
- :value="state.tableNameSearchKeyword"
- :placeholder="$t('common.filter-by-name')"
- @update:value="state.tableNameSearchKeyword = $event"
- />
- </div>
+ <SearchBox
+ :value="state.tableNameSearchKeyword"
+ :placeholder="$t('common.filter-by-name')"
+ @update:value="state.tableNameSearchKeyword = $event"
+ />
</div>
<TableDataTable
diff --git a/frontend/src/components/DeploymentConfigTool/DeploymentMatrix.vue b/frontend/src/components/DeploymentConfigTool/DeploymentMatrix.vue
index 694ccbe2c1..da4f089966 100644
--- a/frontend/src/components/DeploymentConfigTool/DeploymentMatrix.vue
+++ b/frontend/src/components/DeploymentConfigTool/DeploymentMatrix.vue
@@ -30,7 +30,6 @@
v-if="showSearchBox"
v-model:value="state.keyword"
:placeholder="$t('common.filter-by-name')"
- style="width: 12rem"
/>
</NInputGroup>
</div>
diff --git a/frontend/src/components/Project/ProjectSidebar.vue b/frontend/src/components/Project/ProjectSidebar.vue
index 22ca4765d3..00f27464d4 100644
--- a/frontend/src/components/Project/ProjectSidebar.vue
+++ b/frontend/src/components/Project/ProjectSidebar.vue
@@ -312,14 +312,14 @@ const selectProjectTabOnHash = () => {
case "workspace.project.hook.detail":
state.selectedHash = "webhook";
return;
- case "workspace.changelist.detail":
+ case "workspace.project.changelist.detail":
state.selectedHash = "changelists";
return;
- case "workspace.branch.detail":
+ case "workspace.project.branch.detail":
state.selectedHash = "branches";
return;
- case "workspace.database-group.detail":
- case "workspace.database-group.table-group.detail":
+ case "workspace.project.database-group.detail":
+ case "workspace.project.database-group.table-group.detail":
state.selectedHash = "database-groups";
return;
case "workspace.issue.detail":
diff --git a/frontend/src/components/Project/ProjectSwitchModal.vue b/frontend/src/components/Project/ProjectSwitchModal.vue
index 5db13d16e9..88acfaea29 100644
--- a/frontend/src/components/Project/ProjectSwitchModal.vue
+++ b/frontend/src/components/Project/ProjectSwitchModal.vue
@@ -14,7 +14,7 @@
v-model:value="state.searchText"
:placeholder="$t('common.filter-by-name')"
:autofocus="false"
- style="flex: 1 1 0%"
+ style="max-width: 100%"
/>
<NButton @click="state.showCreateDrawer = true">
{{ $t("quick-action.new-project") }}
diff --git a/frontend/src/components/ProjectBranchesPanel.vue b/frontend/src/components/ProjectBranchesPanel.vue
index 33f9290077..4721913543 100644
--- a/frontend/src/components/ProjectBranchesPanel.vue
+++ b/frontend/src/components/ProjectBranchesPanel.vue
@@ -1,19 +1,15 @@
<template>
<div class="space-y-4 w-full overflow-x-auto">
- <div class="w-full flex flex-row justify-between items-center">
- <div class="flex flex-row justify-start items-center"></div>
- <div class="flex flex-row justify-end items-center gap-x-2">
- <NInput
- v-model:value="state.searchKeyword"
- class="!w-36"
- clearable
- :placeholder="$t('common.filter-by-name')"
- />
- <NButton type="primary" @click="handleCreateBranch">
- <heroicons-solid:plus class="w-4 h-auto mr-0.5" />
- <span>{{ $t("database.new-branch") }}</span>
- </NButton>
- </div>
+ <div class="flex flex-row justify-end items-center gap-x-2">
+ <SearchBox
+ v-model:value="state.searchKeyword"
+ :autofocus="true"
+ :placeholder="$t('common.filter-by-name')"
+ />
+ <NButton type="primary" @click="handleCreateBranch">
+ <heroicons-solid:plus class="w-4 h-auto mr-0.5" />
+ <span>{{ $t("database.new-branch") }}</span>
+ </NButton>
</div>
<BranchDataTable
@@ -28,7 +24,7 @@
<script lang="ts" setup>
import { orderBy } from "lodash-es";
-import { NButton, NInput } from "naive-ui";
+import { NButton } from "naive-ui";
import { computed, reactive } from "vue";
import { useRouter } from "vue-router";
import BranchDataTable from "@/components/Branch/BranchDataTable.vue";
@@ -73,7 +69,7 @@ const filteredBranches = computed(() => {
const handleCreateBranch = () => {
router.push({
- name: "workspace.branch.detail",
+ name: "workspace.project.branch.detail",
params: {
projectSlug: projectV1Slug(project.value),
branchName: "new",
@@ -84,7 +80,7 @@ const handleCreateBranch = () => {
const handleBranchClick = async (schemaDesign: SchemaDesign) => {
const [_, sheetId] = getProjectAndSchemaDesignSheetId(schemaDesign.name);
router.push({
- name: "workspace.branch.detail",
+ name: "workspace.project.branch.detail",
params: {
projectSlug: projectV1Slug(project.value),
branchName: `${sheetId}`,
diff --git a/frontend/src/components/ProjectMember/ProjectMemberPanel.vue b/frontend/src/components/ProjectMember/ProjectMemberPanel.vue
index 080eb031ea..0c4d8dcf48 100644
--- a/frontend/src/components/ProjectMember/ProjectMemberPanel.vue
+++ b/frontend/src/components/ProjectMember/ProjectMemberPanel.vue
@@ -34,7 +34,6 @@
<template #suffix>
<SearchBox
v-model:value="state.searchText"
- style="width: 12rem"
:placeholder="$t('project.members.search-member')"
/>
</template>
diff --git a/frontend/src/components/SchemaTemplate/SelectClassificationDrawer.vue b/frontend/src/components/SchemaTemplate/SelectClassificationDrawer.vue
index 49d52f2c04..c5a7c0e987 100644
--- a/frontend/src/components/SchemaTemplate/SelectClassificationDrawer.vue
+++ b/frontend/src/components/SchemaTemplate/SelectClassificationDrawer.vue
@@ -4,7 +4,7 @@
<div class="divide-block-border space-y-8 w-[25rem] h-full">
<SearchBox
v-model:value="state.searchText"
- style="width: 100%"
+ style="max-width: 100%"
:placeholder="$t('schema-template.classification.search')"
/>
diff --git a/frontend/src/components/v2/Form/SearchBox.vue b/frontend/src/components/v2/Form/SearchBox.vue
index d2ce899995..1ea3d2599e 100644
--- a/frontend/src/components/v2/Form/SearchBox.vue
+++ b/frontend/src/components/v2/Form/SearchBox.vue
@@ -4,7 +4,7 @@
:value="value"
:clearable="!!value"
:placeholder="placeholder"
- style="width: 12rem"
+ style="max-width: 18rem; flex: 1 1 0%"
v-bind="$attrs"
@update:value="$emit('update:value', $event)"
>
diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts
index 2491ce1452..c485c8b397 100644
--- a/frontend/src/router/index.ts
+++ b/frontend/src/router/index.ts
@@ -239,22 +239,6 @@ const routes: Array<RouteRecordRaw> = [
leftSidebar: true,
},
},
- {
- path: "/project/:projectSlug/changelists/:changelistName",
- name: "workspace.changelist.detail",
- meta: {
- overrideTitle: true,
- },
- components: {
- content: () =>
- import("../components/Changelist/ChangelistDetail/"),
- leftSidebar: ProjectSidebar,
- },
- props: {
- content: true,
- leftSidebar: true,
- },
- },
{
path: "sync-schema",
name: "workspace.sync-schema",
@@ -715,13 +699,35 @@ const routes: Array<RouteRecordRaw> = [
},
{
path: "branches/:branchName",
- name: "workspace.branch.detail",
+ name: "workspace.project.branch.detail",
meta: {
overrideTitle: true,
},
component: () => import("../views/branch/BranchDetail.vue"),
props: true,
},
+ {
+ path: "changelists/:changelistName",
+ name: "workspace.project.changelist.detail",
+ meta: {
+ overrideTitle: true,
+ },
+ component: () =>
+ import("../components/Changelist/ChangelistDetail/"),
+ props: true,
+ },
+ {
+ path: "database-groups/:databaseGroupName",
+ name: "workspace.project.database-group.detail",
+ component: () => import("../views/DatabaseGroupDetail.vue"),
+ props: true,
+ },
+ {
+ path: "database-groups/:databaseGroupName/table-groups/:schemaGroupName",
+ name: "workspace.project.database-group.table-group.detail",
+ component: () => import("../views/SchemaGroupDetail.vue"),
+ props: true,
+ },
],
},
{
@@ -875,30 +881,6 @@ const routes: Array<RouteRecordRaw> = [
},
props: { content: true, leftSidebar: true },
},
- // Resource name related routes.
- {
- path: "project/:projectSlug",
- children: [
- {
- path: "database-groups/:databaseGroupName",
- name: "workspace.database-group.detail",
- components: {
- content: () => import("../views/DatabaseGroupDetail.vue"),
- leftSidebar: ProjectSidebar,
- },
- props: true,
- },
- {
- path: "database-groups/:databaseGroupName/table-groups/:schemaGroupName",
- name: "workspace.database-group.table-group.detail",
- components: {
- content: () => import("../views/SchemaGroupDetail.vue"),
- leftSidebar: ProjectSidebar,
- },
- props: true,
- },
- ],
- },
],
},
],
@@ -1234,7 +1216,7 @@ router.beforeEach((to, from, next) => {
});
throw new Error("not found");
}
- } else if (to.name === "workspace.changelist.detail") {
+ } else if (to.name === "workspace.project.changelist.detail") {
const name = `${project.name}/changelists/${to.params.changelistName}`;
useChangelistStore()
.fetchChangelistByName(name)
@@ -1257,7 +1239,7 @@ router.beforeEach((to, from, next) => {
throw error;
});
} else if (
- to.name === "workspace.branch.detail" &&
+ to.name === "workspace.project.branch.detail" &&
to.params.branchName !== "new"
) {
const name = `${project.name}/schemaDesigns/${to.params.branchName}`;
@@ -1302,7 +1284,7 @@ router.beforeEach((to, from, next) => {
return;
}
- if (to.name === "workspace.branch.detail") {
+ if (to.name === "workspace.project.branch.detail") {
if (to.params.branchName === "new") {
next();
return;
diff --git a/frontend/src/views/DatabaseGroupDetail.vue b/frontend/src/views/DatabaseGroupDetail.vue
index dc54fdb3d2..7a83fca44c 100644
--- a/frontend/src/views/DatabaseGroupDetail.vue
+++ b/frontend/src/views/DatabaseGroupDetail.vue
@@ -5,9 +5,9 @@
tabindex="0"
v-bind="$attrs"
>
- <main class="flex-1 relative overflow-y-auto">
+ <main class="flex-1 relative overflow-y-auto space-y-4">
<div
- class="px-4 space-y-2 lg:space-y-0 lg:flex lg:items-center lg:justify-between"
+ class="space-y-2 lg:space-y-0 lg:flex lg:items-center lg:justify-between"
>
<div class="flex-1 min-w-0 shrink-0">
<!-- Summary -->
@@ -65,16 +65,15 @@
</div>
</div>
- <hr class="my-4" />
+ <hr />
<FeatureAttentionForInstanceLicense
v-if="existMatchedUnactivateInstance"
- custom-class="m-4"
:style="`WARN`"
feature="bb.feature.database-grouping"
/>
- <div class="w-full px-3 max-w-5xl grid grid-cols-5 gap-x-6">
+ <div class="w-full max-w-5xl grid grid-cols-5 gap-x-6">
<div class="col-span-3">
<p class="pl-1 text-lg mb-2">
{{ $t("database-group.condition.self") }}
@@ -94,8 +93,8 @@
</div>
</div>
- <hr class="mt-8 my-4" />
- <div class="w-full max-w-5xl px-4">
+ <hr />
+ <div class="w-full max-w-5xl">
<div class="w-full flex flex-row justify-between items-center">
<p class="my-4">{{ $t("database-group.table-group.self") }}</p>
<div>
diff --git a/frontend/src/views/ProjectDashboard.vue b/frontend/src/views/ProjectDashboard.vue
index 62570c63ad..21619eeff2 100644
--- a/frontend/src/views/ProjectDashboard.vue
+++ b/frontend/src/views/ProjectDashboard.vue
@@ -5,7 +5,6 @@
v-model:value="state.searchText"
:placeholder="$t('common.filter-by-name')"
:autofocus="true"
- style="width: 12rem"
/>
</div>
<ProjectV1Table :project-list="filteredProjectList" class="border-x-0" />
diff --git a/frontend/src/views/SchemaGroupDetail.vue b/frontend/src/views/SchemaGroupDetail.vue
index 9fac4e0fac..74d1621070 100644
--- a/frontend/src/views/SchemaGroupDetail.vue
+++ b/frontend/src/views/SchemaGroupDetail.vue
@@ -5,10 +5,10 @@
tabindex="0"
v-bind="$attrs"
>
- <main class="flex-1 relative overflow-y-auto">
+ <main class="flex-1 relative overflow-y-auto space-y-4">
<!-- Highlight Panel -->
<div
- class="px-4 space-y-2 lg:space-y-0 lg:flex lg:items-center lg:justify-between"
+ class="space-y-2 lg:space-y-0 lg:flex lg:items-center lg:justify-between"
>
<div class="flex-1 min-w-0 shrink-0">
<!-- Summary -->
@@ -59,16 +59,15 @@
</div>
</div>
- <hr class="my-4" />
+ <hr />
<FeatureAttentionForInstanceLicense
v-if="existMatchedUnactivateInstance"
- custom-class="m-4"
:style="`WARN`"
feature="bb.feature.database-grouping"
/>
- <div class="w-full px-3 max-w-5xl grid grid-cols-5 gap-x-6">
+ <div class="w-full max-w-5xl grid grid-cols-5 gap-x-6">
<div class="col-span-3">
<p class="pl-1 text-lg mb-2">
{{ $t("database-group.condition.self") }}
diff --git a/frontend/src/views/SchemaTemplate/FieldTemplates.vue b/frontend/src/views/SchemaTemplate/FieldTemplates.vue
index 3e5825620f..1d12dd506c 100644
--- a/frontend/src/views/SchemaTemplate/FieldTemplates.vue
+++ b/frontend/src/views/SchemaTemplate/FieldTemplates.vue
@@ -5,11 +5,6 @@
<div class="flex-1 textinfolabel">
{{ $t("schema-template.field-template.description") }}
</div>
- <div>
- <NButton type="primary" @click="createSchemaTemplate">
- {{ $t("common.add") }}
- </NButton>
- </div>
</div>
</div>
<div class="flex items-center justify-between gap-x-2 my-4">
@@ -32,12 +27,18 @@
</NCheckbox>
</template>
</div>
- <SearchBox
- v-model:value="state.searchText"
- :autofocus="true"
- :placeholder="$t('schema-template.search-by-name-or-comment')"
- style="width: 18rem"
- />
+ <div class="flex items-center space-x-2">
+ <div class="hidden md:block">
+ <SearchBox
+ v-model:value="state.searchText"
+ :autofocus="true"
+ :placeholder="$t('schema-template.search-by-name-or-comment')"
+ />
+ </div>
+ <NButton type="primary" @click="createSchemaTemplate">
+ {{ $t("common.add") }}
+ </NButton>
+ </div>
</div>
<FieldTemplateView
:engine="engine"
diff --git a/frontend/src/views/SchemaTemplate/TableTemplates.vue b/frontend/src/views/SchemaTemplate/TableTemplates.vue
index f22405fe2f..1f58e9f959 100644
--- a/frontend/src/views/SchemaTemplate/TableTemplates.vue
+++ b/frontend/src/views/SchemaTemplate/TableTemplates.vue
@@ -5,15 +5,6 @@
<div class="flex-1 textinfolabel">
{{ $t("schema-template.table-template.description") }}
</div>
- <div>
- <NButton
- type="primary"
- :disabled="readonly"
- @click="createSchemaTemplate"
- >
- {{ $t("common.add") }}
- </NButton>
- </div>
</div>
</div>
<div class="flex items-center justify-between gap-x-2 my-4">
@@ -36,12 +27,22 @@
</NCheckbox>
</template>
</div>
- <SearchBox
- v-model:value="state.searchText"
- :autofocus="true"
- :placeholder="$t('schema-template.search-by-name-or-comment')"
- style="width: 18rem"
- />
+ <div class="flex items-center space-x-2">
+ <div class="hidden md:block">
+ <SearchBox
+ v-model:value="state.searchText"
+ :autofocus="true"
+ :placeholder="$t('schema-template.search-by-name-or-comment')"
+ />
+ </div>
+ <NButton
+ type="primary"
+ :disabled="readonly"
+ @click="createSchemaTemplate"
+ >
+ {{ $t("common.add") }}
+ </NButton>
+ </div>
</div>
<TableTemplateView
:engine="engine"