This commit is contained in:
2026-10-18 15:07:17 +07:00
parent 913b237cb8
commit e881f10857
3 changed files with 21 additions and 25 deletions
+11
View File
@@ -443,6 +443,17 @@ module.exports = async function onlineSmoke({
async () => (await evaluate('window.screenBridge.onlineState()')).connection === 'connected', async () => (await evaluate('window.screenBridge.onlineState()')).connection === 'connected',
'HTTP baseline', 'HTTP baseline',
) )
assert.equal(
await evaluate(`(() => {
const assignment = document.querySelector('[data-testid="sound-assignment"]')
const card = assignment?.closest('.n-card')
return card?.querySelector('.n-card-header__main')?.textContent.trim() === 'Игра'
&& ['Назначить звук этому экрану', 'Отключить управление'].every(label =>
!Array.from(document.querySelectorAll('.n-card')).find(c => c.querySelector('.n-card-header__main')?.textContent.trim() === 'Экран')?.textContent.includes(label))
})()`),
true,
'server screen controls belong to game card',
)
await poll( await poll(
() => () =>
evaluate( evaluate(
+10 -23
View File
@@ -13,6 +13,7 @@ import {
useMessage, useMessage,
} from 'naive-ui' } from 'naive-ui'
import { computed, ref, watch } from 'vue' import { computed, ref, watch } from 'vue'
import ScreenConnectionPanel from './ScreenConnectionPanel.vue'
import { import {
DEFAULT_SERVER, DEFAULT_SERVER,
type GameMaterial, type GameMaterial,
@@ -262,6 +263,7 @@ const gameOptions = computed(() => {
>Подключиться</n-button >Подключиться</n-button
> >
</template> </template>
<ScreenConnectionPanel :state="state" :is-busy="isBusy" @action="run" />
<p v-if="state.preparation.active" role="status" data-testid="materials-progress"> <p v-if="state.preparation.active" role="status" data-testid="materials-progress">
Материалы: {{ state.preparation.completed }}/{{ state.preparation.total }} · Материалы: {{ state.preparation.completed }}/{{ state.preparation.total }} ·
{{ (state.preparation.downloadedBytes / 1048576).toFixed(1) }} МиБ {{ (state.preparation.downloadedBytes / 1048576).toFixed(1) }} МиБ
@@ -287,7 +289,6 @@ const gameOptions = computed(() => {
name="materials" name="materials"
> >
<div class="materials-list"> <div class="materials-list">
<n-button text size="small" @click="openMaterialsFolder">Открыть папку</n-button>
<p v-if="!state.materials.length">В игре нет материалов.</p> <p v-if="!state.materials.length">В игре нет материалов.</p>
<n-table <n-table
v-if="state.materials.length" v-if="state.materials.length"
@@ -299,14 +300,11 @@ const gameOptions = computed(() => {
<tr> <tr>
<th scope="col">Материал</th> <th scope="col">Материал</th>
<th scope="col" class="status-column">Статус</th> <th scope="col" class="status-column">Статус</th>
<th scope="col" class="action-column">
<span class="visually-hidden">Загрузка</span>
</th>
</tr> </tr>
</thead> </thead>
<tbody v-for="group in materialGroups" :key="group.id"> <tbody v-for="group in materialGroups" :key="group.id">
<tr> <tr>
<th scope="rowgroup" colspan="3">{{ group.name }}</th> <th scope="rowgroup" colspan="2">{{ group.name }}</th>
</tr> </tr>
<tr <tr
v-for="(row, index) in group.rows" v-for="(row, index) in group.rows"
@@ -321,6 +319,7 @@ const gameOptions = computed(() => {
</td> </td>
<td class="material-status-cell"> <td class="material-status-cell">
<span <span
v-if="row.material.status === 'ready' || row.material.status === 'loading'"
role="status" role="status"
:aria-label="materialLabels[row.material.status]" :aria-label="materialLabels[row.material.status]"
:title="materialLabels[row.material.status]" :title="materialLabels[row.material.status]"
@@ -341,14 +340,11 @@ const gameOptions = computed(() => {
stroke-width="2" stroke-width="2"
aria-hidden="true" aria-hidden="true"
> >
<path v-if="row.material.status === 'ready'" d="m5 12 4 4L19 6" /> <path d="m5 12 4 4L19 6" />
<path v-else d="m6 6 12 12M6 18 18 6" />
</svg> </svg>
</span> </span>
</td>
<td>
<n-button <n-button
v-if="row.material.status === 'missing' || row.material.status === 'error'" v-else
square square
size="small" size="small"
:disabled="isBusy || state.busy" :disabled="isBusy || state.busy"
@@ -379,6 +375,7 @@ const gameOptions = computed(() => {
</tbody> </tbody>
</n-table> </n-table>
<div class="materials-actions"> <div class="materials-actions">
<n-button text size="small" @click="openMaterialsFolder">Открыть папку</n-button>
<n-button <n-button
:disabled=" :disabled="
!state.authenticated || state.currentGameId === null || isBusy || state.busy !state.authenticated || state.currentGameId === null || isBusy || state.busy
@@ -414,10 +411,6 @@ const gameOptions = computed(() => {
width: 72px; width: 72px;
} }
.action-column {
width: 48px;
}
.material-name { .material-name {
overflow-wrap: anywhere; overflow-wrap: anywhere;
} }
@@ -444,19 +437,13 @@ const gameOptions = computed(() => {
} }
.materials-actions { .materials-actions {
align-items: center;
display: flex; display: flex;
flex-wrap: wrap;
gap: 12px;
justify-content: flex-end; justify-content: flex-end;
} }
.visually-hidden {
clip-path: inset(50%);
height: 1px;
overflow: hidden;
position: absolute;
white-space: nowrap;
width: 1px;
}
.current-game { .current-game {
align-items: center; align-items: center;
display: flex; display: flex;
-2
View File
@@ -23,7 +23,6 @@ import type {
} from '../types/screen' } from '../types/screen'
import ConnectionPanel from './ConnectionPanel.vue' import ConnectionPanel from './ConnectionPanel.vue'
import ScreenConnectionPanel from './ScreenConnectionPanel.vue'
import MusicPlanPanel from './MusicPlanPanel.vue' import MusicPlanPanel from './MusicPlanPanel.vue'
import { useOnlineConnection } from '../composables/useOnlineConnection' import { useOnlineConnection } from '../composables/useOnlineConnection'
import ScreenPlanPanel from './ScreenPlanPanel.vue' import ScreenPlanPanel from './ScreenPlanPanel.vue'
@@ -279,7 +278,6 @@ onUnmounted(() => {
<n-button v-if="state?.outputOpen" @click="run(() => bridge!.closeOutput())" <n-button v-if="state?.outputOpen" @click="run(() => bridge!.closeOutput())"
>Закрыть показ</n-button >Закрыть показ</n-button
> >
<ScreenConnectionPanel :state="onlineState" :is-busy="isOnlineBusy" @action="runOnline" />
<template v-if="state"> <template v-if="state">
<label class="mute" <label class="mute"
>Выключить весь звук >Выключить весь звук