diff --git a/control/frontend/src/lib/ts/api_handler.ts b/control/frontend/src/lib/ts/api_handler.ts index 65e2cbd..41d5680 100755 --- a/control/frontend/src/lib/ts/api_handler.ts +++ b/control/frontend/src/lib/ts/api_handler.ts @@ -51,6 +51,11 @@ export async function show_html(ip: string, html: string): Promise { await request_display(ip, '/showHTML', options); } +export async function show_website(ip: string, url: string): Promise { + const command = `screen -dmS custom_website chromium-browser --user-data-dir=$(mktemp -d) --start-fullscreen --app="${url}"`; + await run_shell_command(ip, command); +} + export async function get_file_data( ip: string, path: string diff --git a/control/frontend/src/routes/ControlView.svelte b/control/frontend/src/routes/ControlView.svelte index 0cec977..f6ec931 100644 --- a/control/frontend/src/routes/ControlView.svelte +++ b/control/frontend/src/routes/ControlView.svelte @@ -21,7 +21,7 @@ show_blackscreen, shutdown, startup, - show_html + show_website } from '$lib/ts/api_handler'; import { get_display_by_id, @@ -44,7 +44,7 @@ let popup_content: PopupContent = $state({ open: false, snippet: null, - title: '', + title: '' }); let current_text = $state(''); @@ -79,7 +79,7 @@ snippet: website_popup, title: 'Webseite Anzeigen', window_class: 'w-xl', - title_icon: Globe, + title_icon: Globe }; }; @@ -102,7 +102,7 @@ open: true, snippet: ask_shutdown_popup, title: 'Bildschirm Herunterfahren', - title_icon: PowerOff, + title_icon: PowerOff }; } @@ -110,7 +110,10 @@ popup_content.open = false; await run_on_all_selected_displays((d) => { shutdown(d.ip); // no await here because we want to be fast - db.displays.update(d.id, { status: 'app_offline', preview: { currently_updating: false, url: null} }); + db.displays.update(d.id, { + status: 'app_offline', + preview: { currently_updating: false, url: null } + }); }, false); } @@ -143,9 +146,7 @@ async function send_website() { popup_content.open = false; - await run_on_all_selected_displays((d) => - show_html(d.ip, ``) - ); + await run_on_all_selected_displays((d) => show_website(d.ip, website_url)); } @@ -185,11 +186,11 @@ {/snippet} {#snippet send_keys_popup()} - + {/snippet} {#snippet text_popup()} - + {/snippet}