Added loading to dashboard and fixed sri hash
parent
bd433e3f24
commit
b3ab0538eb
|
@ -17,3 +17,4 @@
|
||||||
[ ] Show QR code with new config
|
[ ] Show QR code with new config
|
||||||
[ ] Clean up bash file headings
|
[ ] Clean up bash file headings
|
||||||
[ ] Deploy on GF4
|
[ ] Deploy on GF4
|
||||||
|
[ ] Write tests
|
||||||
|
|
|
@ -6,7 +6,8 @@
|
||||||
<p>Use this console to edit your network-connected devices. </p>
|
<p>Use this console to edit your network-connected devices. </p>
|
||||||
|
|
||||||
<h2>Your peers</h2>
|
<h2>Your peers</h2>
|
||||||
<table>
|
<p data-bind="visible:!isLoaded">Loading...</p>
|
||||||
|
<table data-bind="visible:isLoaded">
|
||||||
<thead><tr>
|
<thead><tr>
|
||||||
<th>Host</th><th></th>
|
<th>Host</th><th></th>
|
||||||
</tr></thead>
|
</tr></thead>
|
||||||
|
@ -18,7 +19,8 @@
|
||||||
|
|
||||||
<h2>Add a peer</h2>
|
<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>
|
<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>
|
<p data-bind="visible:!isLoaded">Loading...</p>
|
||||||
|
<div data-bind="visible:isLoaded">
|
||||||
<input type="text" data-bind="textInput:newPeerName,event:{keypress:addKeyPress}" placeholder="mypc1"></input>
|
<input type="text" data-bind="textInput:newPeerName,event:{keypress:addKeyPress}" placeholder="mypc1"></input>
|
||||||
<button data-bind="click:addPeer,disable:isAdding,text:addText">Add</button>
|
<button data-bind="click:addPeer,disable:isAdding,text:addText">Add</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -26,7 +28,8 @@
|
||||||
<hr>
|
<hr>
|
||||||
<pre data-bind="text:newConfigText"></pre>
|
<pre data-bind="text:newConfigText"></pre>
|
||||||
|
|
||||||
<script src="/knockout.min.js" integrity="sha512-2AL/VEauKkZqQU9BHgnv48OhXcJPx9vdzxN1JrKDVc4FPU/MEE/BZ6d9l0mP7VmvLsjtYwqiYQpDskK9dG8KBA=="></script>
|
<script src="/knockout.min.js" integrity="sha512-vs7+jbztHoMto5Yd/yinM4/y2DOkPLt0fATcN+j+G4ANY2z4faIzZIOMkpBmWdcxt+596FemCh9M18NUJTZwvw==
|
||||||
|
"></script>
|
||||||
<script src="/dashboard.js"></script>
|
<script src="/dashboard.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -16,6 +16,7 @@ function PeerList() {
|
||||||
self.newConfigText = ko.observable('')
|
self.newConfigText = ko.observable('')
|
||||||
self.isAdding = ko.observable(false)
|
self.isAdding = ko.observable(false)
|
||||||
self.addText = ko.computed(() => self.isAdding()?'Adding...':'Add')
|
self.addText = ko.computed(() => self.isAdding()?'Adding...':'Add')
|
||||||
|
self.isLoaded = ko.observable(false)
|
||||||
|
|
||||||
// Initial loading
|
// Initial loading
|
||||||
self.getUser = async () => {
|
self.getUser = async () => {
|
||||||
|
@ -40,6 +41,8 @@ function PeerList() {
|
||||||
.map( (i)=>new Peer(i))
|
.map( (i)=>new Peer(i))
|
||||||
)
|
)
|
||||||
self.token = user.token
|
self.token = user.token
|
||||||
|
} finally {
|
||||||
|
self.isLoaded(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue