diff --git a/CHANGELOG.md b/CHANGELOG.md index 6810bc00..d6156090 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# 0.90.14 +- Updated SCSS compiling, and confirmed it works. +- Added `$container-color` SCSS variable. +- Fixed issue with JWT token (nil pointer) for the Cookie name + # 0.90.13 - Added new function `utils.RenameDirectory` to rename directory - Added new function `(*DbConfig) BackupAssets` to backup a customized theme and place into a directory named `assets_backup`. Only for migration 0.80 to 0.90+, entirely new frontend. diff --git a/cmd/cli.go b/cmd/cli.go index 1f095cc8..69565dd6 100644 --- a/cmd/cli.go +++ b/cmd/cli.go @@ -42,9 +42,9 @@ func catchCLI(args []string) error { switch args[0] { case "version": if COMMIT != "" { - fmt.Printf("%v (%v)\n", VERSION, COMMIT) + fmt.Printf("%s (%s)\n", VERSION, COMMIT) } else { - fmt.Printf("%v\n", VERSION) + fmt.Printf("%s\n", VERSION) } return errors.New("end") case "assets": diff --git a/cmd/main.go b/cmd/main.go index 6d83e91c..7afd2dbf 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -73,8 +73,7 @@ func exit(err error) { } func init() { - core.App = new(core.Core) - core.App.Version = VERSION + core.New(VERSION) } // main will run the Statping application diff --git a/frontend/src/assets/scss/base.scss b/frontend/src/assets/scss/base.scss index 881715fa..c759d7c5 100644 --- a/frontend/src/assets/scss/base.scss +++ b/frontend/src/assets/scss/base.scss @@ -678,6 +678,7 @@ HTML,BODY { .index_container { min-height: 980pt; + background-color: $container-color; } /* Enter and leave animations can use different */ diff --git a/frontend/src/assets/scss/variables.scss b/frontend/src/assets/scss/variables.scss index 8cb93728..6951a1bd 100644 --- a/frontend/src/assets/scss/variables.scss +++ b/frontend/src/assets/scss/variables.scss @@ -1,5 +1,6 @@ /* Index Page */ $background-color: #fcfcfc; +$container-color: #fcfcfc; $max-width: 860px; $title-color: #464646; $description-color: #939393; diff --git a/frontend/src/chart_design.js b/frontend/src/chart_design.js deleted file mode 100644 index e69de29b..00000000 diff --git a/handlers/api_test.go b/handlers/api_test.go index 0f272076..bb622c57 100644 --- a/handlers/api_test.go +++ b/handlers/api_test.go @@ -35,6 +35,7 @@ func init() { source.Assets() utils.InitLogs() dir = utils.Directory + core.New("test") } //func TestResetDatabase(t *testing.T) { diff --git a/handlers/routes.go b/handlers/routes.go index 46fd0ca8..c77506ac 100644 --- a/handlers/routes.go +++ b/handlers/routes.go @@ -191,5 +191,5 @@ func resetRouter() { } func resetCookies() { - jwtKey = fmt.Sprintf("%v_%v", core.App.ApiSecret, utils.Now().Nanosecond()) + jwtKey = fmt.Sprintf("%s_%d", core.App.ApiSecret, utils.Now().Nanosecond()) } diff --git a/source/source.go b/source/source.go index 3acc2a94..020479d1 100644 --- a/source/source.go +++ b/source/source.go @@ -31,7 +31,7 @@ import ( var ( log = utils.Log.WithField("type", "source") TmplBox *rice.Box // HTML and other small files from the 'source/tmpl' directory, this will be loaded into '/assets' - DefaultScss = []string{"scss/base.scss", "scss/mobile.scss"} + DefaultScss = []string{"scss/main.scss", "scss/base.scss", "scss/mobile.scss"} ) // Assets will load the Rice boxes containing the CSS, SCSS, JS, and HTML files. @@ -77,7 +77,9 @@ func CompileSASS(files ...string) error { return errors.Wrap(err, "failed to capture stdout or stderr") } - log.Infoln(fmt.Sprintf("out: %v | error: %v", stdout, stderr)) + if stdout != "" || stderr != "" { + log.Infoln(fmt.Sprintf("out: %v | error: %v", stdout, stderr)) + } } log.Infoln("SASS Compiling is complete!") return nil diff --git a/types/core/struct.go b/types/core/struct.go index c095ff13..cd86b88d 100644 --- a/types/core/struct.go +++ b/types/core/struct.go @@ -9,6 +9,11 @@ var ( App *Core ) +func New(version string) { + App = new(Core) + App.Version = version +} + // Core struct contains all the required fields for Statping. All application settings // will be saved into 1 row in the 'core' table. You can use the core.CoreApp // global variable to interact with the attributes to the application, such as services. diff --git a/utils/utils_test.go b/utils/utils_test.go index 818f2156..fcba1a40 100644 --- a/utils/utils_test.go +++ b/utils/utils_test.go @@ -53,10 +53,9 @@ func TestDir(t *testing.T) { } func TestCommand(t *testing.T) { - t.SkipNow() - in, out, err := Command("pwd") + in, out, err := Command("/bin/echo", "\"statping testing\"") assert.Nil(t, err) - assert.Contains(t, in, "statping") + assert.Contains(t, in, "statping testing") assert.Empty(t, out) } diff --git a/version.txt b/version.txt index a4321cff..7bcdbe78 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.90.13 \ No newline at end of file +0.90.14 \ No newline at end of file