SCSS fixes

pull/443/head v0.90.14
hunterlong 2020-03-22 00:57:17 -07:00
parent a7b49500ca
commit f953eea1dd
12 changed files with 24 additions and 11 deletions

View File

@ -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.

View File

@ -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":

View File

@ -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

View File

@ -678,6 +678,7 @@ HTML,BODY {
.index_container {
min-height: 980pt;
background-color: $container-color;
}
/* Enter and leave animations can use different */

View File

@ -1,5 +1,6 @@
/* Index Page */
$background-color: #fcfcfc;
$container-color: #fcfcfc;
$max-width: 860px;
$title-color: #464646;
$description-color: #939393;

View File

@ -35,6 +35,7 @@ func init() {
source.Assets()
utils.InitLogs()
dir = utils.Directory
core.New("test")
}
//func TestResetDatabase(t *testing.T) {

View File

@ -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())
}

View File

@ -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

View File

@ -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.

View File

@ -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)
}

View File

@ -1 +1 @@
0.90.13
0.90.14