Skip to content

Commit edc97fb

Browse files
author
fuyoo
committed
disable choose current user.
1 parent c278750 commit edc97fb

File tree

1 file changed

+10
-5
lines changed
  • src/pages/host/components/CoDatabase

1 file changed

+10
-5
lines changed

src/pages/host/components/CoDatabase/CoDbs.vue

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ const fetchDbs = async () => {
1717
}
1818
fetchDbs()
1919
const reload = async (v: number) => {
20-
console.log(v)
20+
if (v == Number(route.query.db || 0)) {
21+
return
22+
}
2123
await router.replace({
2224
query: {
2325
...route.query,
@@ -26,10 +28,9 @@ const reload = async (v: number) => {
2628
})
2729
location.reload()
2830
}
29-
console.log(route.query)
3031
</script>
3132
<template>
32-
<el-dropdown @command="reload" trigger="click" class="w-full">
33+
<el-dropdown :max-height="248" @command="reload" trigger="click" class="w-full">
3334
<q-btn outline unelevated dense no-caps push long color="primary" class="w-full mx-2">
3435
<div style="width: 100%;">
3536
<i class="i-material-symbols:database"></i>
@@ -38,9 +39,13 @@ console.log(route.query)
3839
</q-btn>
3940
<template #dropdown>
4041
<el-dropdown-menu>
41-
<el-dropdown-item :key="item" v-for="item in Number(dbs)" :command="item - 1">
42+
<el-dropdown-item :disabled="item - 1 == (route.query.db || 0)" :key="item" v-for="item in Number(dbs)"
43+
:command="item - 1">
4244
<div class="w-40 text-center">
43-
{{ $t('normal.0') + '.' + (item - 1) }}</div>
45+
{{ $t('normal.0') +
46+
'.' +
47+
(item - 1) }}
48+
</div>
4449
</el-dropdown-item>
4550
</el-dropdown-menu>
4651
</template>

0 commit comments

Comments
 (0)