feat: add select-filtered button for visible databases search
This commit is contained in:
1 parent
19b5b70fb7
commit
cded066fdf
3 files changed
+11
No files matched your search
@@ -101,10 +101,16 @@ function toggleDatabase(database: string) {
|
||||
selectedNames.value = next;
|
||||
}
|
||||
|
||||
const isSearching = computed(() => searchText.value.trim().length > 0);
|
||||
|
||||
function selectAll() {
|
||||
selectedNames.value = new Set(listedDatabaseNames.value);
|
||||
}
|
||||
|
||||
function selectFiltered() {
|
||||
selectedNames.value = new Set(filteredDatabaseNames.value);
|
||||
}
|
||||
|
||||
function clearSelection() {
|
||||
selectedNames.value = new Set();
|
||||
}
|
||||
@@ -142,6 +148,9 @@ async function saveSelection() {
|
||||
<button class="hover:text-foreground disabled:opacity-50" :disabled="isLoading" @click="selectAll">
|
||||
{{ t("visibleDatabases.selectAll") }}
|
||||
</button>
|
||||
<button v-if="isSearching" class="hover:text-foreground disabled:opacity-50" :disabled="isLoading" @click="selectFiltered">
|
||||
{{ t("visibleDatabases.selectFiltered") }}
|
||||
</button>
|
||||
<button class="hover:text-foreground disabled:opacity-50" :disabled="isLoading" @click="clearSelection">
|
||||
{{ t("visibleDatabases.clear") }}
|
||||
</button>
|
||||
|
||||
Reference in new issue
Block a user