-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Frank Jogeleit
committed
Dec 31, 2023
1 parent
66a3203
commit 264d969
Showing
15 changed files
with
148 additions
and
52 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
frontend/modules/core/components/form/NamespaceAutocomplete.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<template> | ||
<v-autocomplete | ||
multiple | ||
clearable | ||
density="compact" | ||
:items="items as string[]" | ||
variant="outlined" | ||
hide-details | ||
label="Namespaces" | ||
closable-chips | ||
:model-value="selected" | ||
@update:model-value="input" | ||
style="min-width: 300px;" | ||
> | ||
<template #selection="{ item, index }"> | ||
<v-chip v-if="index <= 1" size="small" label> | ||
<span>{{ (item as any).title }}</span> | ||
</v-chip> | ||
<span v-if="index === 2" class="grey--text caption ml-2 d-inline-flex align-center"> | ||
(+{{ selected.length - 2 }} others) | ||
</span> | ||
</template> | ||
</v-autocomplete> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { ResourceFilter } from "~/modules/core/provider/dashboard"; | ||
import { useDebounce } from "~/composables/router"; | ||
const props = defineProps<{ modelValue: string[]; items: string[]; }>(); | ||
const emit = defineEmits<{ 'update:modelValue': string[] }>(); | ||
const filter = inject(ResourceFilter, ref({})) | ||
const selected = ref<string[]>([]); | ||
const input = defineRouteQuery('namespaces', selected); | ||
watch(() => props.items, (current) => { | ||
input(selected.value.filter((s) => current.includes(s))); | ||
}, { immediate: true }); | ||
const debounced = useDebounce() | ||
watch(selected, (current) => debounced(() => emit("update:modelValue", current)), { immediate: true }); | ||
</script> |
36 changes: 36 additions & 0 deletions
36
frontend/modules/core/components/resource/NamespaceSection.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<template> | ||
<v-row> | ||
<v-col> | ||
<v-card> | ||
<v-toolbar color="header"> | ||
<v-toolbar-title>Namespace Scoped Resources</v-toolbar-title> | ||
<template #append> | ||
<form-namespace-autocomplete v-model="internal" :items="props.namespaces" /> | ||
</template> | ||
</v-toolbar> | ||
</v-card> | ||
</v-col> | ||
</v-row> | ||
<slot :namespaces="list"> | ||
<resource-scroller :list="list"> | ||
<template #default="{ item }"> | ||
<LazyResourceResultList :namespace="item" :details="false" /> | ||
</template> | ||
</resource-scroller> | ||
</slot> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import ResourceScroller from "~/modules/core/components/ResourceScroller.vue"; | ||
const props = defineProps<{ namespaces: string[]; }>() | ||
const internal = ref<string[]>([]) | ||
const list = computed(() => { | ||
if (internal.value.length > 0) return internal.value | ||
return props.namespaces || [] | ||
}) | ||
</script> |
17 changes: 0 additions & 17 deletions
17
frontend/modules/core/components/select/NamespaceAutocomplete.vue
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters