This commit is contained in:
2026-10-19 00:11:20 +07:00
parent f74b2a8a41
commit 0f948b316a
8 changed files with 176 additions and 3 deletions
+19 -1
View File
@@ -58,6 +58,18 @@ const host = ref<HostInfo>({
})
const display = ref<number | null>(null)
const isBusy = ref(false)
const isCheckingSound = ref(false)
async function checkSound() {
if (!bridge || isCheckingSound.value) return
isCheckingSound.value = true
try {
await bridge.checkSound()
} catch (error) {
message.error(error instanceof Error ? error.message : 'Не удалось проверить звук')
} finally {
isCheckingSound.value = false
}
}
const preview = ref<PreviewFrame | null>(null)
const previewURL = computed(() =>
preview.value?.session === state.value?.session &&
@@ -292,12 +304,18 @@ onUnmounted(() => {
{ label: 'По умолчанию в системе', value: '' },
...(host.audioOutputs ?? []).map((device) => ({ label: device.label, value: device.id })),
]"
:disabled="isBusy"
:disabled="isBusy || isCheckingSound"
:input-props="{ id: 'audio-output-input', 'aria-label': 'Вывод звука' }"
@update:value="selectAudioOutput"
/>
<n-alert v-if="host.audioOutputNotice" type="warning" role="status">{{ host.audioOutputNotice }}</n-alert>
<n-space align="center">
<n-button
data-testid="check-sound"
:disabled="isBusy || isCheckingSound"
:loading="isCheckingSound"
@click="checkSound"
>Проверка звука</n-button>
<n-button
v-if="!state?.outputOpen"
:disabled="display === null || isBusy"
+1
View File
@@ -155,6 +155,7 @@ export interface PlanStatus {
notice: string
}
export interface ScreenBridge {
checkSound: () => Promise<void>
selectAudioOutput: (id: string) => Promise<void>
prepareAudioOutput: () => Promise<void>
planStatus: () => Promise<PlanStatus>