Rearranged admin page

master
Keith Irwin 2022-11-06 16:09:18 -07:00
parent c1bf546112
commit 0fede1e4a9
Signed by: ki9
GPG Key ID: DF773B3F4A88DA86
1 changed files with 20 additions and 19 deletions

View File

@ -3,7 +3,26 @@
<title>Wireguard Admin</title>
</head>
<body>
<p>Use this console to edit network-connected devices. </p>
<h2>Add user</h2>
<p>To add a new user, type in the user's first device name and a username and click 'add'. The hostname and username must each be 3-10 lowercase letters and numbers <code>/[a-z0-9]{3,10}/</code>. </p>
<p data-bind="hidden:isLoaded">Loading...</p>
<div data-bind="visible:isLoaded">
<input type="text" data-bind="textInput:newUserHostname,event:{keypress:addUserKeyPress}" placeholder="pc1"></input>
<input type="text" data-bind="textInput:newUsername,event:{keypress:addUserKeyPress}" placeholder="joe"></input>
<button data-bind="click:addUser,disable:isAddingUser,text:addUserText">Add</button>
</div>
<p>After clicking "Add", the new user's first peer 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>
<h2>Delete User</h2>
<p>To delete a user, select the username from the list below and click 'Delete'. This will delete the user and all their peers. </p>
<p data-bind="hidden:isLoaded">Loading...</p>
<div data-bind="visible:isLoaded">
<select data-bind="options:users,optionsText:'name',value:userToDelete,optionsCaption:'(user)'"></select>
<button data-bind="click:delUser,disable:isDeletingUser,text:deleteUserText">Delete</button>
</div>
<br><hr>
<h2>Peers</h2>
<p data-bind="hidden:isLoaded">Loading...</p>
@ -28,24 +47,6 @@
</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>
<h2>Add user</h2>
<p>To add a new user, type in the user's first device name and a username and click 'add'. The hostname and username must each be 3-10 lowercase letters and numbers <code>/[a-z0-9]{3,10}/</code>. </p>
<p data-bind="hidden:isLoaded">Loading...</p>
<div data-bind="visible:isLoaded">
<input type="text" data-bind="textInput:newUserHostname,event:{keypress:addUserKeyPress}" placeholder="pc1"></input>
<input type="text" data-bind="textInput:newUsername,event:{keypress:addUserKeyPress}" placeholder="joe"></input>
<button data-bind="click:addUser,disable:isAddingUser,text:addUserText">Add</button>
</div>
<p>After clicking "Add", the new user's first peer 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>
<h2>Delete User</h2>
<p>To delete a user, select the username from the list below and click 'Delete'. This will delete the user and all their peers. </p>
<p data-bind="hidden:isLoaded">Loading...</p>
<div data-bind="visible:isLoaded">
<select data-bind="options:users,optionsText:'name',value:userToDelete,optionsCaption:'(user)'"></select>
<button data-bind="click:delUser,disable:isDeletingUser,text:deleteUserText">Delete</button>
</div>
<br><hr>
<pre data-bind="text:newConfigText"></pre>