mirror of https://github.com/statping/statping
fixed Theme Editor codemirror inputs, test responses design for notifier
parent
a9ef085024
commit
ef60ba765c
|
@ -1,4 +1,4 @@
|
||||||
<template >
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div v-if="loaded && !directory" class="jumbotron jumbotron-fluid">
|
<div v-if="loaded && !directory" class="jumbotron jumbotron-fluid">
|
||||||
<div class="text-center col-12">
|
<div class="text-center col-12">
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
</p></span>
|
</p></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<form v-if="loaded && directory" @submit.prevent="saveAssets" :disabled="pending">
|
<form v-observe-visibility="visible" v-if="loaded && directory" @submit.prevent="saveAssets" :disabled="pending">
|
||||||
<h3>Variables</h3>
|
<h3>Variables</h3>
|
||||||
<codemirror v-show="loaded" v-model="vars" ref="vars" :options="cmOptions" class="codemirrorInput"/>
|
<codemirror v-show="loaded" v-model="vars" ref="vars" :options="cmOptions" class="codemirrorInput"/>
|
||||||
|
|
||||||
|
@ -77,6 +77,13 @@
|
||||||
this.changeTab('vars')
|
this.changeTab('vars')
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
visible(isVisible, entry) {
|
||||||
|
if (isVisible) {
|
||||||
|
this.$refs.vars.codemirror.refresh()
|
||||||
|
this.$refs.base.codemirror.refresh()
|
||||||
|
this.$refs.mobile.codemirror.refresh()
|
||||||
|
}
|
||||||
|
},
|
||||||
async fetchTheme() {
|
async fetchTheme() {
|
||||||
this.loaded = true
|
this.loaded = true
|
||||||
this.pending = true
|
this.pending = true
|
||||||
|
|
|
@ -68,7 +68,7 @@
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
|
||||||
<div v-if="error && !success" class="alert alert-danger col-12" role="alert">
|
<div v-if="error && !success" class="alert alert-danger col-12" role="alert">
|
||||||
{{error}}<p v-if="response">Response:<br>{{response}}</p>
|
{{error}}
|
||||||
</div>
|
</div>
|
||||||
<div v-if="success" class="alert alert-success col-12" role="alert">
|
<div v-if="success" class="alert alert-success col-12" role="alert">
|
||||||
<span class="text-capitalize">{{notifier.title}}</span> appears to be working!
|
<span class="text-capitalize">{{notifier.title}}</span> appears to be working!
|
||||||
|
@ -174,7 +174,6 @@ export default {
|
||||||
},
|
},
|
||||||
onCmSuccessReady(cm) {
|
onCmSuccessReady(cm) {
|
||||||
this.success_data = beautify(this.notifier.success_data, this.beautifySettings)
|
this.success_data = beautify(this.notifier.success_data, this.beautifySettings)
|
||||||
console.log('the editor is ready!', cm)
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
cm.refresh();
|
cm.refresh();
|
||||||
},1);
|
},1);
|
||||||
|
|
|
@ -6,7 +6,6 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/GeertJohan/go.rice"
|
"github.com/GeertJohan/go.rice"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/russross/blackfriday/v2"
|
|
||||||
"github.com/statping/statping/utils"
|
"github.com/statping/statping/utils"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
@ -30,12 +29,6 @@ func Assets() error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// HelpMarkdown will return the Markdown of help.md into HTML
|
|
||||||
func HelpMarkdown() string {
|
|
||||||
output := blackfriday.Run(CompiledWiki)
|
|
||||||
return string(output)
|
|
||||||
}
|
|
||||||
|
|
||||||
func scssRendered(name string) string {
|
func scssRendered(name string) string {
|
||||||
spl := strings.Split(name, "/")
|
spl := strings.Split(name, "/")
|
||||||
path := spl[:len(spl)-2]
|
path := spl[:len(spl)-2]
|
||||||
|
@ -137,6 +130,9 @@ func CreateAllAssets(folder string) error {
|
||||||
if err := MakePublicFolder(fp(folder, "assets", "css")); err != nil {
|
if err := MakePublicFolder(fp(folder, "assets", "css")); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if err := MakePublicFolder(fp(folder, "assets", "favicon")); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
if err := MakePublicFolder(fp(folder, "assets", "scss")); err != nil {
|
if err := MakePublicFolder(fp(folder, "assets", "scss")); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue