Skip to content

Commit

Permalink
fix routing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
fjogeleit committed Sep 6, 2024
1 parent be26e54 commit 50aebf9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 44 deletions.
44 changes: 0 additions & 44 deletions frontend/components/StaticAutocomplete.vue

This file was deleted.

8 changes: 8 additions & 0 deletions frontend/composables/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,18 @@ export const defineRouteQuery = (key: string, selected: Ref<string[]>) => {
const debounced = useDebounce()

return (inp: string[]) => {
if (equal(selected.value, inp)) return;

selected.value = inp

debounced(() => {
router.push({ name: route.name as string, query: { ...route.query, [key]: inp }, params: route.params })
})
}
}

const equal = <T>(a: T[], b: T[]): boolean => {
if (a.length !== b.length) return false

return a.every(item => b.includes(item))
}
1 change: 1 addition & 0 deletions frontend/modules/core/plugins/apis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default defineNuxtPlugin(async () => {
defaultFilter: { resources: [], clusterResources: [] },
clusters: [{ name: 'Default', slug: 'default', plugins: [] }],
oauth: false,
banner: '',
}
})

Expand Down

0 comments on commit 50aebf9

Please sign in to comment.