From 88e52fa65af6a7f65ec6b0a495984e4829098e3d Mon Sep 17 00:00:00 2001 From: MaMe82 Date: Mon, 15 Oct 2018 23:07:05 +0200 Subject: [PATCH] Moved app template from html to gopherjs --- dist/www/index.html | 40 ---------------------------------------- web_client/main.go | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 40 deletions(-) diff --git a/dist/www/index.html b/dist/www/index.html index 97fd045..e4b0c6b 100644 --- a/dist/www/index.html +++ b/dist/www/index.html @@ -39,46 +39,6 @@
- - - - - P4wnP1 web-frontend - - - - - - - - - - - - - - - - - -
by MaMe82
-
-
-
- - - - - -
-
No connection to server
-

Trying to reconnect ... (attempt {{ $store.state.failedConnectionAttempts }})

-
-
-
- - -
diff --git a/web_client/main.go b/web_client/main.go index 4c83ac3..99f511c 100644 --- a/web_client/main.go +++ b/web_client/main.go @@ -80,8 +80,10 @@ func main() { InitComponentsNetwork() InitComponentsWiFi() InitComponentsTriggerActions() + vm := hvue.NewVM( hvue.El("#app"), + hvue.Template(templateMainApp), /* //add "testString" to data hvue.DataFunc(func(vm *hvue.VM) interface{} { @@ -114,3 +116,46 @@ func main() { js.Global.Set("vm",vm) js.Global.Set("rpc", RpcClient) } + +const templateMainApp = ` + + + + + P4wnP1 web-frontend + + + + + + + + + + + + + + + + + +
by MaMe82
+
+
+
+ + + + + +
+
No connection to server
+

Trying to reconnect ... (attempt {{ $store.state.failedConnectionAttempts }})

+
+
+
+ + +
+` \ No newline at end of file