mirror of
https://github.com/Elysola/WebHooker.git
synced 2026-11-20 17:13:49 +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>
|
||||
<RcSelect
|
||||
class="filter-select"
|
||||
:model-value="selectedGroupId || 'all'"
|
||||
:model-value="selectedGroupId || '*'"
|
||||
:options="groupOptions"
|
||||
:disabled="loading"
|
||||
@update:model-value="onGroupFilter"
|
||||
@@ -75,12 +75,12 @@ function refresh(): void {
|
||||
}
|
||||
|
||||
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 })),
|
||||
]);
|
||||
|
||||
function onGroupFilter(value: string): void {
|
||||
emit("update:selectedGroupId", value === "all" ? "" : value);
|
||||
emit("update:selectedGroupId", value === "*" ? "" : value);
|
||||
emit("filter");
|
||||
}
|
||||
</script>
|
||||
@@ -20,7 +20,7 @@ const emit = defineEmits<{
|
||||
const sortBy = ref<"total" | "failed" | "rate">("total");
|
||||
|
||||
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 })),
|
||||
]);
|
||||
|
||||
@@ -34,7 +34,7 @@ function pctOf(count: number, total: number): string {
|
||||
}
|
||||
|
||||
function onGroupFilter(value: string): void {
|
||||
emit("update:selectedGroupId", value === "all" ? "" : value);
|
||||
emit("update:selectedGroupId", value === "*" ? "" : value);
|
||||
emit("filter");
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ function cycleSort(): void {
|
||||
<label class="filter-label">{{ t("metrics.filterGroup") }}</label>
|
||||
<RcSelect
|
||||
class="filter-select"
|
||||
:model-value="selectedGroupId || 'all'"
|
||||
:model-value="selectedGroupId || '*'"
|
||||
:options="groupOptions"
|
||||
:disabled="loading"
|
||||
@update:model-value="onGroupFilter"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<label class="filter-label">{{ t("logs.filterGroup") }}</label>
|
||||
<RcSelect
|
||||
class="filter-select"
|
||||
:model-value="selectedGroupId || 'all'"
|
||||
:model-value="selectedGroupId || '*'"
|
||||
:options="groupOptions"
|
||||
:disabled="loading"
|
||||
@update:model-value="onGroupFilter"
|
||||
@@ -101,7 +101,7 @@ const detailLoading = ref(false);
|
||||
const detailError = ref("");
|
||||
|
||||
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 })),
|
||||
]);
|
||||
|
||||
@@ -142,7 +142,7 @@ function refresh(): void {
|
||||
}
|
||||
|
||||
function onGroupFilter(value: string): void {
|
||||
emit("update:selectedGroupId", value === "all" ? "" : value);
|
||||
emit("update:selectedGroupId", value === "*" ? "" : value);
|
||||
emit("filter");
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user