mirror of
https://codeberg.org/PLG-Development/PLG-MuDiCS
synced 2026-07-06 00:47:09 +00:00
show blackscreen added
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ done
|
|||||||
return folder_element_list;
|
return folder_element_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function get_file_tree_data(ip: string, path: string): Promise<TreeElement[]|null> {
|
export async function get_file_tree_data(ip: string, path: string): Promise<TreeElement[] | null> {
|
||||||
const options = {
|
const options = {
|
||||||
method: 'PATCH',
|
method: 'PATCH',
|
||||||
headers: { 'content-type': 'application/json' },
|
headers: { 'content-type': 'application/json' },
|
||||||
@@ -84,11 +84,22 @@ export async function get_file_tree_data(ip: string, path: string): Promise<Tree
|
|||||||
};
|
};
|
||||||
const raw_response = await request_display(ip, '/shellCommand', options);
|
const raw_response = await request_display(ip, '/shellCommand', options);
|
||||||
if (!raw_response) return null;
|
if (!raw_response) return null;
|
||||||
const tree_structure: TreeElement[]|null = (JSON.parse(raw_response.stdout.trim()) as [TreeElement, any])[0].contents || null;
|
const tree_structure: TreeElement[] | null = (JSON.parse(raw_response.stdout.trim()) as [TreeElement, any])[0].contents || null;
|
||||||
return tree_structure;
|
return tree_structure;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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' });
|
||||||
|
|||||||
Reference in New Issue
Block a user