sass issues

pull/508/head
hunterlong 2020-04-19 01:55:53 -07:00
parent 191b97b7b7
commit 835bb5e618
5 changed files with 11 additions and 34 deletions

View File

@ -202,7 +202,7 @@ clean:
find . -name "*.out" -type f -delete find . -name "*.out" -type f -delete
find . -name "*.cpu" -type f -delete find . -name "*.cpu" -type f -delete
find . -name "*.mem" -type f -delete find . -name "*.mem" -type f -delete
rm -rf {build,releases,tmp} rm -rf {build,releases,tmp,source/build}
print_details: print_details:
@echo \==== Statping Development Instance ==== @echo \==== Statping Development Instance ====

View File

@ -9,7 +9,7 @@
# Statping - Status Page & Monitoring Server # Statping - Status Page & Monitoring Server
An easy to use Status Page for your websites and applications. Statping will automatically fetch the application and render a beautiful status page with tons of features for you to build an even better status page. This Status Page generator allows you to use MySQL, Postgres, or SQLite on multiple operating systems. An easy to use Status Page for your websites and applications. Statping will automatically fetch the application and render a beautiful status page with tons of features for you to build an even better status page. This Status Page generator allows you to use MySQL, Postgres, or SQLite on multiple operating systems.
[![GoDoc](https://godoc.org/github.com/golang/gddo?status.svg)](https://godoc.org/github.com/statping/statping) [![Slack](https://slack.statping.com/badge.svg)](https://slack.statping.com) [![](https://images.microbadger.com/badges/image/statping/statping.svg)](https://microbadger.com/images/statping/statping) [![Docker Pulls](https://img.shields.io/docker/pulls/statping/statping.svg)](https://hub.docker.com/r/statping/statping/builds/) [![Master Release](https://github.com/statping/statping/actions)](https://github.com/statping/statping/workflows/Master%20Release/badge.svg) [![GoDoc](https://godoc.org/github.com/golang/gddo?status.svg)](https://godoc.org/github.com/statping/statping) [![Slack](https://slack.statping.com/badge.svg)](https://slack.statping.com) [![](https://images.microbadger.com/badges/image/statping/statping.svg)](https://microbadger.com/images/statping/statping) [![Docker Pulls](https://img.shields.io/docker/pulls/statping/statping.svg)](https://hub.docker.com/r/statping/statping/builds/)
<br><br> <br><br>
<img align="left" width="320" height="235" src="https://img.cjx.io/statupsiterun.gif"> <img align="left" width="320" height="235" src="https://img.cjx.io/statupsiterun.gif">

View File

@ -1,30 +0,0 @@
package main
import (
"fmt"
"github.com/statping/statping/source"
"github.com/statping/statping/utils"
"net"
)
// UsingAssets will return true if /assets folder is present
func UsingAssets() bool {
return source.UsingAssets(utils.Directory)
}
// GetLocalIP returns the non loopback local IP of the host
func GetLocalIP() string {
addrs, err := net.InterfaceAddrs()
if err != nil {
return "http://localhost"
}
for _, address := range addrs {
// check the address type and if it is not a loopback the display it
if ipnet, ok := address.(*net.IPNet); ok && !ipnet.IP.IsLoopback() {
if ipnet.IP.To4() != nil {
return fmt.Sprintf("http://%v", ipnet.IP.String())
}
}
}
return "http://localhost"
}

View File

@ -9,6 +9,7 @@ import (
"github.com/russross/blackfriday/v2" "github.com/russross/blackfriday/v2"
"github.com/statping/statping/utils" "github.com/statping/statping/utils"
"os" "os"
"os/exec"
"path/filepath" "path/filepath"
"strings" "strings"
) )
@ -44,6 +45,12 @@ func scssRendered(name string) string {
func CompileSASS(files ...string) error { func CompileSASS(files ...string) error {
sassBin := utils.Params.GetString("SASS") sassBin := utils.Params.GetString("SASS")
path, err := exec.LookPath("sass")
if err != nil {
return err
}
sassBin = path
for _, file := range files { for _, file := range files {
scssFile := fmt.Sprintf("%v/assets/%v", utils.Params.GetString("STATPING_DIR"), file) scssFile := fmt.Sprintf("%v/assets/%v", utils.Params.GetString("STATPING_DIR"), file)

View File

@ -117,7 +117,7 @@ func (t Timestamp) Ago() string {
// Command will run a terminal command with 'sh -c COMMAND' and return stdout and errOut as strings // Command will run a terminal command with 'sh -c COMMAND' and return stdout and errOut as strings
// in, out, err := Command("sass assets/scss assets/css/base.css") // in, out, err := Command("sass assets/scss assets/css/base.css")
func Command(name string, args ...string) (string, string, error) { func Command(name string, args ...string) (string, string, error) {
Log.Debugln("running command: " + name + strings.Join(args, " ")) Log.Info("running command: " + name + strings.Join(args, " "))
testCmd := exec.Command(name, args...) testCmd := exec.Command(name, args...)
var stdout, stderr []byte var stdout, stderr []byte
var errStdout, errStderr error var errStdout, errStderr error