Skip to content

Commit

Permalink
start page review
Browse files Browse the repository at this point in the history
  • Loading branch information
jypelle committed Nov 27, 2021
1 parent 7690c28 commit 98cf14b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
6 changes: 4 additions & 2 deletions internal/cliwa/startComponent_wasm.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,16 @@ func (c *StartComponent) logInAction() {
// Create rest Client
var err error
c.app.restClient, err = restClientV1.NewRestClient(&c.app.config, true)
messageBlock := jst.Id("startMessageBlock")
message := jst.Id("startMessage")
if err != nil {
message := jst.Id("message")
messageBlock.Get("style").Set("display", "flex")
message.Set("innerHTML", "Unable to connect to server")
logrus.Errorf("Unable to instantiate mifasol rest client: %v", err)
return
}
if c.app.ConnectedUserId() == restApiV1.UndefinedUserId {
message := jst.Id("message")
messageBlock.Get("style").Set("display", "flex")
message.Set("innerHTML", "Wrong credentials")
jst.LocalStorage.Set("mifasolUsername", "")
jst.LocalStorage.Set("mifasolPassword", "")
Expand Down
11 changes: 7 additions & 4 deletions internal/cliwa/templates/start/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<h1 style="margin: 2rem;"><img src="/static/image/logo64.png" style="vertical-align:middle;"> Mifasol</h1>
</div>
<div style="flex: 2; display: flex; flex-flow: row wrap; align-content: flex-start; justify-content: center; padding-top: 2rem;">
<div style="margin: 0 2rem 2rem 2rem; flex: 0 1 22rem;">
<h2>Connect to web client (alpha!)</h2>
<div style="margin: 0 2rem 2rem 2rem; flex: 0 1 20rem;">
<h2>Connect to web client</h2>
<form id="startForm">
<div>
<label for="mifasolUsername">Username</label>
Expand All @@ -25,7 +25,10 @@ <h2>Connect to web client (alpha!)</h2>
Remember me
</div>
</div>
<p id="message"></p>
<div id="startMessageBlock" style="display: none;">
<label></label>
<div id="startMessage"></div>
</div>
<div>
<label></label>
<div>
Expand All @@ -34,7 +37,7 @@ <h2>Connect to web client (alpha!)</h2>
</div>
</form>
</div>
<div style="margin: 0 2rem 2rem 2rem; flex: 0 1 22rem;">
<div style="margin: 0 2rem 2rem 2rem; flex: 0 1 20rem;">
<h2>Download console client</h2>
<p><a href="/clients/mifasolcli-windows-amd64.exe"><i class="fab fa-windows" style="font-size: 2rem;"></i>
mifasolcli (windows amd64)</a></p>
Expand Down

0 comments on commit 98cf14b

Please sign in to comment.