show blackscreen added

This commit is contained in:
E44
2025-11-08 22:03:12 +01:00
parent bd5a15e3b5
commit ea74609349
3 changed files with 46 additions and 8 deletions
@@ -15,6 +15,8 @@
import PopUp from './PopUp.svelte'; import PopUp from './PopUp.svelte';
import type { PopupContent } from '../ts/types'; import type { PopupContent } from '../ts/types';
import KeyInput from './KeyInput.svelte'; import KeyInput from './KeyInput.svelte';
import { send_keyboard_input, show_blackscreen } from '../ts/api_handler';
import { run_on_all_selected_displays } from '../ts/stores/displays';
let popup_content: PopupContent = $state({ let popup_content: PopupContent = $state({
open: false, open: false,
@@ -55,17 +57,42 @@
<div class="flex flex-row justify-between gap-2"> <div class="flex flex-row justify-between gap-2">
<div class="flex flex-col gap-2"> <div class="flex flex-col gap-2">
<div class="flex flex-row gap-2 w-75 justify-normal"> <div class="flex flex-row gap-2 w-75 justify-normal">
<Button title="Vorherige Folie (Pfeil nach Links)" className="px-9" <Button
><ArrowBigLeft /></Button title="Vorherige Folie (Pfeil nach Links)"
className="px-9"
click_function={() => {
run_on_all_selected_displays(
() => {
send_keyboard_input;
},
true,
'VK_LEFT'
);
}}><ArrowBigLeft /></Button
> >
<Button title="Nächste Folie (Pfeil nach Rechts)" className="px-9" <Button
><ArrowBigRight /></Button title="Nächste Folie (Pfeil nach Rechts)"
className="px-9"
click_function={() => {
run_on_all_selected_displays(
() => {
send_keyboard_input;
},
true,
'VK_RIGHT'
);
}}><ArrowBigRight /></Button
> >
</div> </div>
<Button className="px-3 flex gap-3 w-75 justify-normal" <Button className="px-3 flex gap-3 w-75 justify-normal"
><TextAlignStart /> Text anzeigen</Button ><TextAlignStart /> Text anzeigen</Button
> >
<Button className="px-3 flex gap-3 w-75 justify-normal"><Presentation />Blackout</Button> <Button
className="px-3 flex gap-3 w-75 justify-normal"
click_function={() => {
run_on_all_selected_displays(show_blackscreen, true);
}}><Presentation />Blackout</Button
>
<div class="flex flex-row justify-normal"> <div class="flex flex-row justify-normal">
<Button className="rounded-r-none pl-3 flex gap-3 grow w-65 justify-normal" <Button className="rounded-r-none pl-3 flex gap-3 grow w-65 justify-normal"
><TrafficCone /> Fallback-Bild anzeigen</Button ><TrafficCone /> Fallback-Bild anzeigen</Button
@@ -31,7 +31,7 @@
} else { } else {
$pinned_display_id = display.id; $pinned_display_id = display.id;
} }
// update_screenshot(display.id); DEBUG update_screenshot(display.id);
e.stopPropagation(); e.stopPropagation();
} }
</script> </script>
+11
View File
@@ -89,6 +89,17 @@ export async function get_file_tree_data(ip: string, path: string): Promise<Tree
} }
export async function show_blackscreen(ip: string) {
const options = {
method: 'PATCH',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({
html: `<div style="width:100dvw; height:100dvh; background-color:black;"></div>`
})
};
await request_display(ip, '/showHTML', options);
}
export async function ping_ip(ip: string): Promise<DisplayStatus> { export async function ping_ip(ip: string): Promise<DisplayStatus> {
const raw_response = await request_control(`/ping?ip=${ip}`, { method: 'GET' }); const raw_response = await request_control(`/ping?ip=${ip}`, { method: 'GET' });