diff --git a/frontend/src/v2/components/GameDetails/FilesTab/FilesTab.test.ts b/frontend/src/v2/components/GameDetails/FilesTab/FilesTab.test.ts index e99f4eee9..b3763e74f 100644 --- a/frontend/src/v2/components/GameDetails/FilesTab/FilesTab.test.ts +++ b/frontend/src/v2/components/GameDetails/FilesTab/FilesTab.test.ts @@ -25,7 +25,11 @@ vi.mock("vue-i18n", () => ({ vi.mock("vue-router", async (importOriginal) => ({ ...(await importOriginal()), useRoute: () => ({ query: routeQuery, path: "/rom/1", params: {} }), - useRouter: () => ({ replace: vi.fn(), push: vi.fn() }), + useRouter: () => ({ + replace: vi.fn(), + push: vi.fn(), + currentRoute: { value: { query: routeQuery } }, + }), })); vi.mock("@/services/api/rom", () => ({ default: { uploadRoms, deleteRomFile: vi.fn() }, diff --git a/frontend/src/v2/components/Settings/PlatformsStatsSection.vue b/frontend/src/v2/components/Settings/PlatformsStatsSection.vue index de43e0c4a..727006e16 100644 --- a/frontend/src/v2/components/Settings/PlatformsStatsSection.vue +++ b/frontend/src/v2/components/Settings/PlatformsStatsSection.vue @@ -76,6 +76,12 @@ const orderItems = computed[]>(() => [ }, ]); +const emptyState = computed(() => + searchQuery.value.trim() + ? { icon: "mdi-magnify-close", title: t("settings.no-matching-platforms") } + : { icon: "mdi-folder-question", title: t("settings.no-platforms") }, +); + const sortedPlatforms = computed(() => { const q = searchQuery.value.trim().toLowerCase(); let list = [...filledPlatforms.value]; @@ -331,15 +337,7 @@ function onRowClick(e: MouseEvent, platformId: number): void { class="r-v2-plat-stats__bar" /> - + diff --git a/frontend/src/v2/components/Settings/StreamingSection.vue b/frontend/src/v2/components/Settings/StreamingSection.vue index f22c3a056..6a426ee28 100644 --- a/frontend/src/v2/components/Settings/StreamingSection.vue +++ b/frontend/src/v2/components/Settings/StreamingSection.vue @@ -8,7 +8,7 @@ // an admin needs: open its desktop to configure the emulator inside it, and // end whatever session is holding it. import { RBtn, REmptyState, RIcon, RSpinner } from "@v2/lib"; -import { onMounted, ref } from "vue"; +import { computed, onMounted, ref } from "vue"; import { useI18n } from "vue-i18n"; import { useRouter } from "vue-router"; import { ROUTES } from "@/plugins/router"; @@ -35,6 +35,25 @@ const loadFailed = ref(false); const containers = ref([]); const releasing = ref(null); +const emptyState = computed<{ icon: string; title: string } | null>(() => { + if (loadFailed.value) { + return { + icon: "mdi-alert-circle-outline", + title: t("settings.streaming-load-failed"), + }; + } + if (!enabled.value) { + return { icon: "mdi-monitor-off", title: t("settings.streaming-disabled") }; + } + if (containers.value.length === 0) { + return { + icon: "mdi-monitor-dashboard", + title: t("settings.streaming-none"), + }; + } + return null; +}); + async function load(): Promise { loading.value = true; loadFailed.value = false; @@ -120,26 +139,7 @@ onMounted(load); - - - - - +