Files
nostash/Shared (Extension)/Resources/options.html
2023-01-25 21:54:12 -05:00

55 lines
1.9 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="options.build.css">
<script defer src="options.build.js"></script>
</head>
<body x-data="options" class="text-fuchsia-900 bg-fuchsia-400 p-32">
<h1 class="text-6xl font-bold">Advanced</h1>
<select class="mt-3 input w-64" x-model.number="profileIndex" name="profiles" id="profiles" class="mt-3">
<template x-for="(profileName, index) in profileNames" :key="profileName">
<option x-text="profileName" :value="index"></option>
</template>
</select>
<h2 class="text-5xl font-bold mt-6">Relays</h2>
<table class="mt-3">
<thead class="font-bold text-lg">
<td class="p-2 text-center">URL</td>
<td class="p-2 text-center">Read</td>
<td class="p-2 text-center">Write</td>
<td class="p-2 text-center">Actions</td>
</thead>
<template x-for="(relay, index) in relays" :key="index">
<tr>
<td class="p-2 w-1/3" x-text="relay.url"></td>
<td class="p-2 text-center">
<input type="checkbox" x-model="relay.read" @change="await saveRelaysForProfile(index)">
</td>
<td class="p-2 text-center">
<input type="checkbox" x-model="relay.write" @change="await saveRelaysForProfile(index)">
</td>
<td class="p-2 text-center">
<button class="btn" @click="await deleteRelay(index)">Delete</button>
</td>
</tr>
</template>
</table>
<input class="mt-3 input" x-model="newRelay" type="text" @keyup.enter="await addRelay()" placeholder="wss://...">
<button class="btn" @click="await addRelay()">Add</button>
<div class="text-red-500 font-bold" x-show="urlError.length > 0" x-text="urlError"></div>
<div class="mt-6">
<button class="btn" @click="window.close()">Close</button>
</div>
</body>
</html>