Skip to content

Commit e8f289e

Browse files
authored
fix: initialize host in settings; limit sidebar width (#546)
* fix: limit sidebar width * fix(settings): initialize host
1 parent 6f129d1 commit e8f289e

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

src/components/global-setting/index.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,15 @@ a-drawer.settings-drawer(
174174
const res = await fetchDatabases()
175175
settingsForm.value.databaseList = databaseList.value
176176
settingsForm.value.database = database.value
177+
177178
if (res) {
178-
await save()
179+
const loginSuccess = await login({})
180+
if (loginSuccess) {
181+
loginStatus.value = 'success'
182+
checkTables()
183+
} else {
184+
loginStatus.value = 'fail'
185+
}
179186
}
180187
})
181188

src/components/short-cut/index.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ a-tooltip(position="right" :content="codeInfo.code")
2828
2929
const { inputFromNewLineToQueryCode } = useQueryCode()
3030
const { loadMoreColumns } = useSiderTabs()
31-
const { updateSettings } = useAppStore()
3231
3332
const isLoading = ref(false)
3433

src/views/dashboard/query/index.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,15 @@ a-layout.new-layout
5555
5656
const sidebarWidth = useStorage('sidebarWidth', 320)
5757
58+
watch(sidebarWidth, (newWidth) => {
59+
if (newWidth < 100) {
60+
sidebarWidth.value = 100
61+
}
62+
})
63+
5864
const actualSidebarWidth = computed(() => {
5965
const minWidth = 100
6066
const maxWidth = window.innerWidth * 0.4
61-
6267
return Math.max(minWidth, Math.min(sidebarWidth.value, maxWidth))
6368
})
6469

0 commit comments

Comments
 (0)