mirror of
https://github.com/Elysola/WebHooker.git
synced 2026-11-21 01:23:40 +00:00
fix(console): allow selecting a group named all
The all sentinel collides with a valid group id. Use a value that cannot be a group id so that group stays selectable.
This commit is contained in:
1 parent
9bc58ec81b
commit
9159fb8696
3 files changed
+9
-9
No files matched your search
@@ -6,7 +6,7 @@
|
|||||||
<label class="filter-label">{{ t("audit.filterGroup") }}</label>
|
<label class="filter-label">{{ t("audit.filterGroup") }}</label>
|
||||||
<RcSelect
|
<RcSelect
|
||||||
class="filter-select"
|
class="filter-select"
|
||||||
:model-value="selectedGroupId || 'all'"
|
:model-value="selectedGroupId || '*'"
|
||||||
:options="groupOptions"
|
:options="groupOptions"
|
||||||
:disabled="loading"
|
:disabled="loading"
|
||||||
@update:model-value="onGroupFilter"
|
@update:model-value="onGroupFilter"
|
||||||
@@ -75,12 +75,12 @@ function refresh(): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const groupOptions = computed(() => [
|
const groupOptions = computed(() => [
|
||||||
{ label: t("audit.allGroups"), value: "all" },
|
{ label: t("audit.allGroups"), value: "*" }, // "*" is no group id: one named "all" stays selectable
|
||||||
...props.groups.map((g) => ({ label: g.name || g.id, value: g.id })),
|
...props.groups.map((g) => ({ label: g.name || g.id, value: g.id })),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
function onGroupFilter(value: string): void {
|
function onGroupFilter(value: string): void {
|
||||||
emit("update:selectedGroupId", value === "all" ? "" : value);
|
emit("update:selectedGroupId", value === "*" ? "" : value);
|
||||||
emit("filter");
|
emit("filter");
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -20,7 +20,7 @@ const emit = defineEmits<{
|
|||||||
const sortBy = ref<"total" | "failed" | "rate">("total");
|
const sortBy = ref<"total" | "failed" | "rate">("total");
|
||||||
|
|
||||||
const groupOptions = computed(() => [
|
const groupOptions = computed(() => [
|
||||||
{ label: t("metrics.allGroups"), value: "all" },
|
{ label: t("metrics.allGroups"), value: "*" }, // "*" is no group id: one named "all" stays selectable
|
||||||
...props.groups.map((g) => ({ label: g.name || g.id, value: g.id })),
|
...props.groups.map((g) => ({ label: g.name || g.id, value: g.id })),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ function pctOf(count: number, total: number): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onGroupFilter(value: string): void {
|
function onGroupFilter(value: string): void {
|
||||||
emit("update:selectedGroupId", value === "all" ? "" : value);
|
emit("update:selectedGroupId", value === "*" ? "" : value);
|
||||||
emit("filter");
|
emit("filter");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,7 +120,7 @@ function cycleSort(): void {
|
|||||||
<label class="filter-label">{{ t("metrics.filterGroup") }}</label>
|
<label class="filter-label">{{ t("metrics.filterGroup") }}</label>
|
||||||
<RcSelect
|
<RcSelect
|
||||||
class="filter-select"
|
class="filter-select"
|
||||||
:model-value="selectedGroupId || 'all'"
|
:model-value="selectedGroupId || '*'"
|
||||||
:options="groupOptions"
|
:options="groupOptions"
|
||||||
:disabled="loading"
|
:disabled="loading"
|
||||||
@update:model-value="onGroupFilter"
|
@update:model-value="onGroupFilter"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<label class="filter-label">{{ t("logs.filterGroup") }}</label>
|
<label class="filter-label">{{ t("logs.filterGroup") }}</label>
|
||||||
<RcSelect
|
<RcSelect
|
||||||
class="filter-select"
|
class="filter-select"
|
||||||
:model-value="selectedGroupId || 'all'"
|
:model-value="selectedGroupId || '*'"
|
||||||
:options="groupOptions"
|
:options="groupOptions"
|
||||||
:disabled="loading"
|
:disabled="loading"
|
||||||
@update:model-value="onGroupFilter"
|
@update:model-value="onGroupFilter"
|
||||||
@@ -101,7 +101,7 @@ const detailLoading = ref(false);
|
|||||||
const detailError = ref("");
|
const detailError = ref("");
|
||||||
|
|
||||||
const groupOptions = computed(() => [
|
const groupOptions = computed(() => [
|
||||||
{ label: t("logs.allGroups"), value: "all" },
|
{ label: t("logs.allGroups"), value: "*" }, // "*" is no group id: one named "all" stays selectable
|
||||||
...props.groups.map((g) => ({ label: g.name || g.id, value: g.id })),
|
...props.groups.map((g) => ({ label: g.name || g.id, value: g.id })),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@@ -142,7 +142,7 @@ function refresh(): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onGroupFilter(value: string): void {
|
function onGroupFilter(value: string): void {
|
||||||
emit("update:selectedGroupId", value === "all" ? "" : value);
|
emit("update:selectedGroupId", value === "*" ? "" : value);
|
||||||
emit("filter");
|
emit("filter");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user