mirror of https://github.com/statping/statping
Merge pull request #138 from geoffroya/issues/137
dev: Add base.gohtml in assets [#137](https://github.com/statping-ng/…pull/1101/head
commit
ffd830fb29
|
@ -8,7 +8,7 @@ const tokenKey = "statping_auth";
|
||||||
class Api {
|
class Api {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.version = "0.91.0";
|
this.version = "0.91.0";
|
||||||
this.commit = "40f31e3110550754a929a9f848c2eefa4df9ae3f";
|
this.commit = "b7ecf0c31b0c75c394061d2f6457a925e4440f1e";
|
||||||
}
|
}
|
||||||
|
|
||||||
async oauth() {
|
async oauth() {
|
||||||
|
|
|
@ -172,13 +172,24 @@ func ExecuteResponse(w http.ResponseWriter, r *http.Request, file string, data i
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorln(err)
|
log.Errorln(err)
|
||||||
}
|
}
|
||||||
render, err := source.TmplBox.String(file)
|
|
||||||
if err != nil {
|
asset := file
|
||||||
log.Errorln(err)
|
if source.UsingAssets(utils.Directory) {
|
||||||
}
|
|
||||||
// render the page requested
|
asset = utils.Directory + "/assets/" + file
|
||||||
if _, err := mainTemplate.Parse(render); err != nil {
|
|
||||||
log.Errorln(err)
|
if _, err := mainTemplate.ParseFiles(asset); err != nil {
|
||||||
|
log.Errorln(err)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
render, err := source.TmplBox.String(asset)
|
||||||
|
if err != nil {
|
||||||
|
log.Errorln(err)
|
||||||
|
}
|
||||||
|
// render the page requested
|
||||||
|
if _, err := mainTemplate.Parse(render); err != nil {
|
||||||
|
log.Errorln(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// execute the template
|
// execute the template
|
||||||
if err := mainTemplate.Execute(w, data); err != nil {
|
if err := mainTemplate.Execute(w, data); err != nil {
|
||||||
|
|
|
@ -30,6 +30,7 @@ var (
|
||||||
"scss/mobile.scss",
|
"scss/mobile.scss",
|
||||||
"scss/variables.scss",
|
"scss/variables.scss",
|
||||||
"robots.txt",
|
"robots.txt",
|
||||||
|
"base.gohtml",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -174,7 +175,7 @@ func DeleteAllAssets(folder string) error {
|
||||||
// CopyAllToPublic will copy all the files in a rice box into a local folder
|
// CopyAllToPublic will copy all the files in a rice box into a local folder
|
||||||
func CopyAllToPublic(box *rice.Box) error {
|
func CopyAllToPublic(box *rice.Box) error {
|
||||||
exclude := map[string]bool{
|
exclude := map[string]bool{
|
||||||
"base.gohtml": true,
|
// "base.gohtml": true,
|
||||||
"index.html": true,
|
"index.html": true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue