mirror of https://github.com/statping/statping
API.js generated version on go:generate
parent
0eba5881be
commit
09640d0032
|
@ -4,17 +4,13 @@ const qs = require('querystring');
|
|||
axios.defaults.withCredentials = true
|
||||
|
||||
const tokenKey = "statping_auth";
|
||||
const version = "0.90.64";
|
||||
const commit = "8b54ceb16f0e2ca6c4f5b8f0fe3b5cc2598dc594";
|
||||
|
||||
class Api {
|
||||
constructor() {
|
||||
|
||||
this.version = "0.90.64";
|
||||
this.commit = "0eba5881be48fde3e25f1078e5784ee7eb258788";
|
||||
}
|
||||
|
||||
version = () => version
|
||||
commit = () => commit
|
||||
|
||||
async oauth() {
|
||||
const oauth = axios.get('api/oauth').then(response => (response.data))
|
||||
return oauth
|
||||
|
|
|
@ -2275,7 +2275,7 @@ OluFxewsEO0QNDrfFb+0gnjYlnGqOFcZjUMXbDdY5oLSPtXohynuTK1qyQ==
|
|||
</div>
|
||||
|
||||
<div class="text-center small text-dim" v-pre>
|
||||
Automatically generated from Statping's Wiki on 2020-08-20 04:46:47.972956 +0000 UTC
|
||||
Automatically generated from Statping's Wiki on 2020-08-20 07:40:33.788807 +0000 UTC
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -12,8 +12,8 @@ import (
|
|||
"strings"
|
||||
)
|
||||
|
||||
const replace = `const version = "[0-9]\.[0-9]{2}\.[0-9]{2}";`
|
||||
const replaceCommit = `const commit = \"[a-z0-9]{40}\"\;`
|
||||
const replace = `this\.version = "[0-9]\.[0-9]{2}\.[0-9]{2}";`
|
||||
const replaceCommit = `this\.commit = \"[a-z0-9]{40}\"\;`
|
||||
|
||||
func main() {
|
||||
fmt.Println("RUNNING: ./source/generate_version.go")
|
||||
|
@ -28,8 +28,8 @@ func main() {
|
|||
|
||||
fmt.Println("git commit: ", gitCommit)
|
||||
|
||||
replaceWith := `const version = "` + strings.TrimSpace(string(version)) + `";`
|
||||
replaceCommitWith := `const commit = "` + gitCommit + `";`
|
||||
replaceWith := `this.version = "` + strings.TrimSpace(string(version)) + `";`
|
||||
replaceCommitWith := `this.commit = "` + gitCommit + `";`
|
||||
|
||||
vRex := regexp.MustCompile(replace)
|
||||
newApiFile := vRex.ReplaceAllString(string(apiJsFile), replaceWith)
|
||||
|
|
Loading…
Reference in New Issue