Skip to content

Commit bd0a955

Browse files
committed
Hide not configurable settings when running external (linux host on
browser)
1 parent ff4e231 commit bd0a955

1 file changed

Lines changed: 46 additions & 40 deletions

File tree

frontend/src/routes/mode/host/connection/+page.svelte

Lines changed: 46 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import { IS_RUNNING_EXTERNAL } from '$lib/detection/onwebsite';
1616
import Tooltip from '$lib/layout/Tooltip.svelte';
1717
import MouseIcon from '$lib/layout/icons/MouseIcon.svelte';
18+
import IsRunningExternal from '$lib/detection/IsRunningExternal.svelte';
1819
// import { GetAudioProcess, SetAudioPid } from '$lib/wailsjs/go/bindings/App';
1920
2021
let selected_audio_src = $state(0)
@@ -151,46 +152,51 @@
151152
<p>{$_('external-whip-explanation')}</p>
152153
</Tooltip>
153154

154-
<section class:hidden={streaming.value && !whipEnabled} class="flex flex-row-reverse items-center gap-2">
155-
<label
156-
id="label-external-whip-checkbox"
157-
for="lan-mode-checkbox"
158-
class="font-semibold text-white">{$_('external-whip')}</label
159-
>
160-
<input
161-
id="lan-mode-checkbox"
162-
type="checkbox"
163-
class="checkbox checkbox-xs checkbox-primary"
164-
checked={whipEnabled}
165-
onchange={toogleWhip}
166-
/>
167-
</section>
168-
169-
<section class:hidden={!whipEnabled} class="text-white">
170-
Whip URL: http://localhost:8082
171-
</section>
172-
173-
<section class="w-full">
174-
<h3 class="text-3xl text-white text-center">
175-
{$_('toogle_devices')}
176-
</h3>
177-
<div class="flex flex-row justify-center gap-3 mt-6">
178-
<button onclick={toogleMouse} class:btn-primary={mouseEnabled} class:btn-neutral={!mouseEnabled} class:border-gray-400={!mouseEnabled} class="btn border">
179-
<MouseIcon/>
180-
</button>
181-
<button onclick={toogleKeyboard} class:btn-primary={keyboardEnabled} class:btn-neutral={!keyboardEnabled} class:border-gray-400={!keyboardEnabled} class="btn border">
182-
<KeyboardIcon/>
183-
</button>
184-
<button onclick={toogleGamepad} class:btn-primary={gamepadEnabled} class:btn-neutral={!gamepadEnabled} class:border-gray-400={!gamepadEnabled} class="btn border">
185-
<GamepadIcon/>
186-
</button>
187-
</div>
188-
<div class:hidden={!streaming.value || whipEnabled} class="flex flex-row justify-center gap-3 mt-6">
189-
<button onclick={StopStreaming} disabled={!streaming.value} class="btn btn-primary">
190-
{$_('stop-streaming')}
191-
</button>
192-
</div>
193-
</section>
155+
<IsRunningExternal not>
156+
157+
<section class:hidden={streaming.value && !whipEnabled} class="flex flex-row-reverse items-center gap-2">
158+
<label
159+
id="label-external-whip-checkbox"
160+
for="lan-mode-checkbox"
161+
class="font-semibold text-white">{$_('external-whip')}</label
162+
>
163+
<input
164+
id="lan-mode-checkbox"
165+
type="checkbox"
166+
class="checkbox checkbox-xs checkbox-primary"
167+
checked={whipEnabled}
168+
onchange={toogleWhip}
169+
/>
170+
</section>
171+
172+
<section class:hidden={!whipEnabled} class="text-white">
173+
Whip URL: http://localhost:8082/whip
174+
</section>
175+
176+
<section class="w-full">
177+
<h3 class="text-3xl text-white text-center">
178+
{$_('toogle_devices')}
179+
</h3>
180+
<div class="flex flex-row justify-center gap-3 mt-6">
181+
<button onclick={toogleMouse} class:btn-primary={mouseEnabled} class:btn-neutral={!mouseEnabled} class:border-gray-400={!mouseEnabled} class="btn border">
182+
<MouseIcon/>
183+
</button>
184+
<button onclick={toogleKeyboard} class:btn-primary={keyboardEnabled} class:btn-neutral={!keyboardEnabled} class:border-gray-400={!keyboardEnabled} class="btn border">
185+
<KeyboardIcon/>
186+
</button>
187+
<button onclick={toogleGamepad} class:btn-primary={gamepadEnabled} class:btn-neutral={!gamepadEnabled} class:border-gray-400={!gamepadEnabled} class="btn border">
188+
<GamepadIcon/>
189+
</button>
190+
</div>
191+
<div class:hidden={!streaming.value || whipEnabled} class="flex flex-row justify-center gap-3 mt-6">
192+
<button onclick={StopStreaming} disabled={!streaming.value} class="btn btn-primary">
193+
{$_('stop-streaming')}
194+
</button>
195+
</div>
196+
</section>
197+
198+
</IsRunningExternal>
199+
194200

195201
<!-- <section class="w-1/3 mx-auto" class:hidden={!streaming.value}>
196202
<h3 class="text-3xl text-white text-center">

0 commit comments

Comments
 (0)