Files
HellCon/src/components/NetworkSettings.vue
T
SchluffeandClaude Opus 5.5 5f8c6a1916 WIP V improve UX [snapshot task 2]
Add the connections workspace (sidebar, editable slots, per-slot activity,
removal dialog with focus wrapping), remove the downloadable local HTML and
unreleased identity backup/restore, and start the 0.0.5 draft changelog.
Restore the released 0.0.3/0.0.4 changelog entries. Enable focus emulation
in browser checks so background tabs receive focus/blur events.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 13:44:08 +02:00

37 lines
3.1 KiB
Vue

<script setup lang="ts">
import type { IceOptions, NetworkSettings } from '../lib/webrtc.ts';
import { STUN_PROVIDERS } from '../lib/webrtc.ts';
const settings = defineModel<NetworkSettings>({ required: true });
defineProps<{ disabled?: boolean; managedCredentials?: IceOptions | null }>();
const iceEndpoint = import.meta.env.VITE_ICE_ENDPOINT || '';
</script>
<template>
<fieldset :disabled="disabled" class="network-settings">
<legend>Connection settings</legend>
<label for="stun-provider">STUN provider</label>
<select id="stun-provider" v-model="settings.stunChoice" class="stun-select">
<option v-for="provider in STUN_PROVIDERS" :key="provider.id" :value="provider.id">{{ provider.label }}</option>
<option value="custom">Custom…</option>
</select>
<input v-if="settings.stunChoice === 'custom'" v-model="settings.customStun" class="stun-input" aria-label="Custom STUN address" placeholder="stun:your.domain:3478" />
<p class="status">STUN helps discover a reachable address. Its operator sees your public IP and request timing, but does not carry your file. Direct connections may fail on restrictive networks.</p>
<label class="checkbox"><input type="checkbox" v-model="settings.allowTurn" /> Allow a TURN relay for this connection (opt-in)</label>
<template v-if="settings.allowTurn">
<p class="status">Both people must opt in. Your browser may contact this relay and route encrypted file traffic through it. The operator sees addresses, timing and traffic volume, and may charge for bandwidth. Use credentials you are authorized to use; they remain in this tab.</p>
<label v-if="iceEndpoint" class="checkbox"><input type="checkbox" v-model="settings.managedTurn" /> Use the configured relay with temporary credentials</label>
<template v-if="iceEndpoint && settings.managedTurn">
<p v-if="!managedCredentials" class="status">The relay details will appear here when you create a connection code.</p>
<input class="stun-input" aria-label="TURN address" :value="Array.isArray(managedCredentials?.turnUrl) ? managedCredentials.turnUrl.join(', ') : managedCredentials?.turnUrl || ''" placeholder="TURN address (filled when creating a code)" readonly />
<input class="stun-input" aria-label="TURN username" :value="managedCredentials?.username || ''" placeholder="TURN username (filled when creating a code)" readonly />
<input class="stun-input" type="password" aria-label="TURN password" :value="managedCredentials?.credential || ''" placeholder="TURN password (filled when creating a code)" autocomplete="off" readonly />
</template>
<template v-else>
<input v-model="settings.turnUrl" class="stun-input" aria-label="TURN address" placeholder="turns:relay.example:5349?transport=tcp" autocomplete="off" />
<input v-model="settings.username" class="stun-input" aria-label="TURN username" placeholder="TURN username" autocomplete="off" />
<input v-model="settings.credential" class="stun-input" type="password" aria-label="TURN password" placeholder="TURN password" autocomplete="off" />
</template>
</template>
</fieldset>
</template>