33 lines
1.5 KiB
HTML
33 lines
1.5 KiB
HTML
<html>
|
|
<head>
|
|
<title>Wireguard Dashboard</title>
|
|
</head>
|
|
<body>
|
|
<p>Use this console to edit your network-connected devices. </p>
|
|
|
|
<h2>Your peers</h2>
|
|
<table>
|
|
<thead><tr>
|
|
<th>Host</th><th></th>
|
|
</tr></thead>
|
|
<tbody data-bind="foreach:peers"><tr>
|
|
<td data-bind="text:name"></td>
|
|
<td><button style="float:right" data-bind="click:$parent.delPeer,disable:$data.isDeleting,text:deleteText">Delete</button></td>
|
|
</tr></tbody>
|
|
</table>
|
|
|
|
<h2>Add a peer</h2>
|
|
<p>To add a new peer, type in a hostname and click add. The hostname must be 3-10 lowercase letters and numbers <code>/[a-z0-9]{3,10}/</code>. Keep it short for your own sake!</p>
|
|
<div>
|
|
<input type="text" data-bind="textInput:newPeerName,event:{keypress:addKeyPress}" placeholder="mypc1"></input>
|
|
<button data-bind="click:addPeer,disable:isAdding,text:addText">Add</button>
|
|
</div>
|
|
<p>After clicking "Add", the new peer's config will appear below. Copy and paste it into your wireguard client and start the service. <b>This configuration will not be shown again!</b>If you lose the config, you will need to delete the peer and recreate it. </p>
|
|
<hr>
|
|
<pre data-bind="text:newConfigText"></pre>
|
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.5.1/knockout-latest.js" integrity="sha512-2AL/VEauKkZqQU9BHgnv48OhXcJPx9vdzxN1JrKDVc4FPU/MEE/BZ6d9l0mP7VmvLsjtYwqiYQpDskK9dG8KBA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
<script src="/dashboard.js"></script>
|
|
</body>
|
|
</html>
|