mirror of https://github.com/statping/statping
updates
parent
c24e073942
commit
2b76781571
|
@ -1,4 +1,4 @@
|
|||
FROM hunterlong/statup:base-v0.5
|
||||
FROM hunterlong/statup:base-v0.51
|
||||
MAINTAINER "Hunter Long (https://github.com/hunterlong)"
|
||||
|
||||
# Locked version of Statup for 'latest' Docker tag
|
||||
|
|
7
Makefile
7
Makefile
|
@ -100,7 +100,7 @@ docker-push-base:
|
|||
docker push hunterlong/statup:base
|
||||
docker push hunterlong/statup:base-v$(VERSION)
|
||||
|
||||
docker-build-base: clean
|
||||
docker-build-base:
|
||||
wget -q https://assets.statup.io/sass && chmod +x sass
|
||||
$(XGO) --targets=linux/amd64 -ldflags="-X main.VERSION=$(VERSION) -linkmode external -extldflags -static" -out alpine ./cmd
|
||||
docker build -t hunterlong/statup:base --no-cache -f dev/Dockerfile-base .
|
||||
|
@ -135,7 +135,7 @@ dev-deps: dep
|
|||
$(GOCMD) get github.com/mgechev/revive
|
||||
|
||||
clean:
|
||||
rm -rf ./{logs,assets,plugins,statup.db,config.yml,.sass-cache,config.yml,statup,build,.sass-cache,statup.db,index.html}
|
||||
rm -rf ./{logs,assets,plugins,statup.db,config.yml,.sass-cache,config.yml,statup,build,.sass-cache,statup.db,index.html,vendor}
|
||||
rm -rf cmd/{logs,assets,plugins,statup.db,config.yml,.sass-cache,*.log}
|
||||
rm -rf core/{logs,assets,plugins,statup.db,config.yml,.sass-cache,*.log}
|
||||
rm -rf handlers/{logs,assets,plugins,statup.db,config.yml,.sass-cache,*.log}
|
||||
|
@ -144,8 +144,7 @@ clean:
|
|||
rm -rf types/{logs,assets,plugins,statup.db,config.yml,.sass-cache,*.log}
|
||||
rm -rf utils/{logs,assets,plugins,statup.db,config.yml,.sass-cache,*.log}
|
||||
rm -rf dev/test/cypress/videos
|
||||
rm -f coverage.out
|
||||
rm -f coverage.json
|
||||
rm -f coverage.* sass
|
||||
|
||||
tag:
|
||||
git tag "v$(VERSION)" --force
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
package handlers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/hunterlong/statup/core"
|
||||
"github.com/hunterlong/statup/types"
|
||||
"github.com/hunterlong/statup/utils"
|
||||
|
@ -40,6 +39,23 @@ func TrayHandler(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
func DesktopInit(ip string, port int) {
|
||||
var err error
|
||||
exists := utils.FileExists(utils.Directory + "/statup.db")
|
||||
if exists {
|
||||
core.Configs, err = core.LoadConfig()
|
||||
if err != nil {
|
||||
utils.Log(3, err)
|
||||
return
|
||||
}
|
||||
err = core.DbConnection(core.Configs.Connection, false, utils.Directory)
|
||||
if err != nil {
|
||||
utils.Log(3, err)
|
||||
return
|
||||
}
|
||||
core.InitApp()
|
||||
RunHTTPServer(ip, port)
|
||||
}
|
||||
|
||||
config := &core.DbConfig{DbConfig: &types.DbConfig{
|
||||
DbConn: "sqlite",
|
||||
Project: "Statup",
|
||||
|
@ -52,9 +68,7 @@ func DesktopInit(ip string, port int) {
|
|||
Location: utils.Directory,
|
||||
}}
|
||||
|
||||
fmt.Println(config)
|
||||
|
||||
err := config.Save()
|
||||
err = config.Save()
|
||||
if err != nil {
|
||||
utils.Log(4, err)
|
||||
}
|
||||
|
|
|
@ -416,7 +416,7 @@ HTML, BODY {
|
|||
padding: 5px 5px; }
|
||||
|
||||
.lg_number {
|
||||
font-size: 9vw; }
|
||||
font-size: 8.1vw; }
|
||||
|
||||
.stats_area {
|
||||
margin-top: 1.5rem !important;
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
}
|
||||
|
||||
.lg_number {
|
||||
font-size: 9vw;
|
||||
font-size: 8.1vw;
|
||||
}
|
||||
|
||||
.stats_area {
|
||||
|
|
|
@ -87,6 +87,15 @@ func UnderScoreString(str string) string {
|
|||
return newStr
|
||||
}
|
||||
|
||||
func FileExists(name string) bool {
|
||||
if _, err := os.Stat(name); err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func DeleteFile(file string) error {
|
||||
err := os.Remove(file)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue