Skip to content

Commit 1554ca3

Browse files
committed
feat(datasource): datasource UI
1 parent e66fa42 commit 1554ca3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

frontend/src/views/ds/form.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<el-dialog
33
v-model="dialogVisible"
4-
title="Add Datasource"
4+
:title="title"
55
width="600"
66
:destroy-on-close="true"
77
:close-on-click-modal="false"
@@ -10,7 +10,7 @@
1010
>
1111
<template #header="{ close, titleId, titleClass }">
1212
<div style="display: flex">
13-
<div style="margin-right: 24px">Add Datasource</div>
13+
<div style="margin-right: 24px">{{ title }}</div>
1414
<el-steps
1515
v-show="isCreate"
1616
:active="active"
@@ -180,6 +180,7 @@ const excelUploadSuccess = ref(false);
180180
const tableListLoading = ref(true);
181181
const token = wsCache.get("user.token");
182182
const headers = ref<any>({ "X-SQLBOT-TOKEN": `Bearer ${token}` });
183+
const title = ref('')
183184
184185
const rules = reactive<FormRules>({
185186
name: [
@@ -222,6 +223,7 @@ const close = () => {
222223
const open = (item: any, editTable: boolean = false) => {
223224
isEditTable.value = false;
224225
if (item) {
226+
title.value = 'Edit Datasource'
225227
isCreate.value = false;
226228
form.value.id = item.id;
227229
form.value.name = item.name;
@@ -243,6 +245,7 @@ const open = (item: any, editTable: boolean = false) => {
243245
}
244246
245247
if (editTable) {
248+
title.value = 'Choose Tables'
246249
active.value = 1;
247250
isEditTable.value = true;
248251
isCreate.value = false;
@@ -275,6 +278,7 @@ const open = (item: any, editTable: boolean = false) => {
275278
});
276279
}
277280
} else {
281+
title.value = 'Add Datasource'
278282
isCreate.value = true;
279283
isEditTable.value = false;
280284
checkList.value = [];

0 commit comments

Comments
 (0)