From b3ab0538eb41d608236aadcd613efde9bcf04ffb Mon Sep 17 00:00:00 2001 From: Keith Irwin Date: Sun, 6 Nov 2022 15:50:48 -0700 Subject: [PATCH] Added loading to dashboard and fixed sri hash --- checklist.md | 3 ++- front/dashboard.html | 9 ++++++--- front/dashboard.js | 3 +++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/checklist.md b/checklist.md index b37e35e..c4acbf3 100644 --- a/checklist.md +++ b/checklist.md @@ -16,4 +16,5 @@ [ ] Let users download ssl certs [ ] Show QR code with new config [ ] Clean up bash file headings -[ ] Deploy on GF4 \ No newline at end of file +[ ] Deploy on GF4 +[ ] Write tests diff --git a/front/dashboard.html b/front/dashboard.html index c760dbe..1645a4f 100644 --- a/front/dashboard.html +++ b/front/dashboard.html @@ -6,7 +6,8 @@

Use this console to edit your network-connected devices.

Your peers

- +

Loading...

+
@@ -18,7 +19,8 @@

Add a peer

To add a new peer, type in a hostname and click add. The hostname must be 3-10 lowercase letters and numbers /[a-z0-9]{3,10}/. Keep it short for your own sake!

-
+

Loading...

+
@@ -26,7 +28,8 @@

 
-	
+	
 	
 
 
diff --git a/front/dashboard.js b/front/dashboard.js
index c58937f..e782ea3 100644
--- a/front/dashboard.js
+++ b/front/dashboard.js
@@ -16,6 +16,7 @@ function PeerList() {
 	self.newConfigText = ko.observable('')
 	self.isAdding = ko.observable(false)
 	self.addText = ko.computed(() => self.isAdding()?'Adding...':'Add')
+	self.isLoaded = ko.observable(false)
 
 	// Initial loading
 	self.getUser = async () => {
@@ -40,6 +41,8 @@ function PeerList() {
 				.map( (i)=>new Peer(i))
 			)
 			self.token = user.token
+		} finally {
+			self.isLoaded(true)
 		}
 	}
 
Host