Skip to content

Commit

Permalink
Fix JS undefined error
Browse files Browse the repository at this point in the history
  • Loading branch information
iobear committed Feb 26, 2024
1 parent 4922a2a commit 27dca6b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Changelog
## [v1.5.dev] - 2024-02-23
## [v1.5.dev] - 2024-02-26
Fix:
- JS dashboard update error
- JS lowercase undefined error

Change:
- Made a common module, moved ServiceState to common for other tools
Expand Down
6 changes: 4 additions & 2 deletions cmd/dashgoat/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"flag"
"fmt"
"net/http"
"os"
"strings"
"sync"

Expand Down Expand Up @@ -77,8 +76,11 @@ func main() {
config.WebPath = "/" + config.WebPath
}

useOS := false
// Serving embedded static files
useOS := len(os.Args) > 1 && os.Args[1] == "live"
// if len(os.Args) > 1 && os.Args[1] == "live" {
// useOS = true
// }
assetHandler := http.FileServer(getFileSystem(useOS))
e.GET("/", echo.WrapHandler(assetHandler))
e.GET("/*", echo.WrapHandler(http.StripPrefix("/", assetHandler)))
Expand Down
2 changes: 1 addition & 1 deletion web/css/dash.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ body {
flex-grow: 2;
}
.divTable .cellmessage {
flex-grow: 5;
flex-grow: 6;
}
.divTable .cellchange,
.divTable .cellprobe,
Expand Down
2 changes: 1 addition & 1 deletion web/js/dash.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function createHeader()
{
let cell = document.createElement("div");

cell.setAttribute("onclick", "setSortBy(this.innerText.toLowerCase())");
cell.setAttribute("onclick", "setSortBy(this.innerText)");
dashheader.appendChild(cell).classList.add('cell'+item)
dashheader.appendChild(cell).innerText = item;
}
Expand Down
5 changes: 5 additions & 0 deletions web/js/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ function lowerCase(item)
return item;
}

if (item == undefined)
{
return item;
}

if (isInt(item))
{
return item;
Expand Down

0 comments on commit 27dca6b

Please sign in to comment.