mirror of https://github.com/statping/statping
parent
c65ad7b2a7
commit
3c2bd33aad
|
@ -12,6 +12,7 @@ source/rice-box.go
|
||||||
vendor
|
vendor
|
||||||
servers
|
servers
|
||||||
dev
|
dev
|
||||||
|
!dev/postman_environment.json
|
||||||
!build/alpine-linux-amd64
|
!build/alpine-linux-amd64
|
||||||
config.yml
|
config.yml
|
||||||
statup.db
|
statup.db
|
||||||
|
|
|
@ -1,16 +1,7 @@
|
||||||
FROM golang:1.11-alpine as base
|
FROM postman/newman
|
||||||
MAINTAINER "Hunter Long (https://github.com/hunterlong)"
|
|
||||||
ARG VERSION
|
|
||||||
ENV DEP_VERSION v0.5.0
|
|
||||||
RUN apk add --no-cache libstdc++ gcc g++ make git ca-certificates linux-headers wget curl jq
|
|
||||||
RUN curl -L -s https://github.com/golang/dep/releases/download/$DEP_VERSION/dep-linux-amd64 -o /go/bin/dep && \
|
|
||||||
chmod +x /go/bin/dep
|
|
||||||
RUN curl -L -s https://assets.statup.io/sass -o /usr/local/bin/sass && \
|
|
||||||
chmod +x /usr/local/bin/sass
|
|
||||||
WORKDIR /go/src/github.com/hunterlong/statping
|
|
||||||
ADD . /go/src/github.com/hunterlong/statping
|
|
||||||
RUN make dep
|
|
||||||
RUN make dev-deps
|
|
||||||
RUN make install
|
|
||||||
|
|
||||||
CMD ["make", "test-api"]
|
WORKDIR /app
|
||||||
|
ADD dev/postman_environment.json /app/
|
||||||
|
ADD source/tmpl/postman.json /app/
|
||||||
|
|
||||||
|
ENTRYPOINT sleep 15 && newman run /app/postman.json -e /app/postman_environment.json
|
1
Makefile
1
Makefile
|
@ -245,7 +245,6 @@ 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
|
||||||
find . -name "*.test" -type f -delete
|
|
||||||
|
|
||||||
# tag version using git
|
# tag version using git
|
||||||
tag:
|
tag:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
sut:
|
sut:
|
||||||
|
container_name: statping_sut
|
||||||
build: .
|
build: .
|
||||||
dockerfile: Dockerfile.test
|
dockerfile: Dockerfile.test
|
||||||
links:
|
links:
|
||||||
|
@ -6,3 +7,6 @@ sut:
|
||||||
statping:
|
statping:
|
||||||
build: .
|
build: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
|
environment:
|
||||||
|
DB_CONN: sqlite
|
||||||
|
NAME: Docker Tester
|
||||||
|
|
|
@ -135,6 +135,7 @@ func Router() *mux.Router {
|
||||||
r.Handle("/metrics", http.HandlerFunc(prometheusHandler))
|
r.Handle("/metrics", http.HandlerFunc(prometheusHandler))
|
||||||
r.Handle("/health", http.HandlerFunc(healthCheckHandler))
|
r.Handle("/health", http.HandlerFunc(healthCheckHandler))
|
||||||
r.Handle("/tray", http.HandlerFunc(trayHandler))
|
r.Handle("/tray", http.HandlerFunc(trayHandler))
|
||||||
|
r.Handle("/.well-known/", http.StripPrefix("/.well-known/", http.FileServer(http.Dir(dir+"/.well-known"))))
|
||||||
r.NotFoundHandler = http.HandlerFunc(error404Handler)
|
r.NotFoundHandler = http.HandlerFunc(error404Handler)
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,6 +109,12 @@ function AjaxChart(chart, service, start=0, end=9999999999, group="hour") {
|
||||||
url: "/api/services/"+service+"/data?start="+start+"&end="+end+"&group="+group,
|
url: "/api/services/"+service+"/data?start="+start+"&end="+end+"&group="+group,
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
|
if (data.data.length <= 3) {
|
||||||
|
AjaxChart(chart, service, 0, 9999999999, "second")
|
||||||
|
return;
|
||||||
|
} else if (data.data.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
chart.data.labels.pop();
|
chart.data.labels.pop();
|
||||||
data.data.forEach(function(d) {
|
data.data.forEach(function(d) {
|
||||||
chart.data.datasets[0].data.push(d);
|
chart.data.datasets[0].data.push(d);
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, maximum-scale=1.0, user-scalable=0">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, maximum-scale=1.0, user-scalable=0">
|
||||||
<meta name="description" content="{{block "description" .}}{{end}}">
|
<meta name="description" content="{{block "description" .}}{{end}}">
|
||||||
{{if USE_CDN}}
|
{{if USE_CDN}}
|
||||||
<link rel="shortcut icon" type="image/x-icon" href="https://assets.statping.com/favicon.ico">
|
<link rel="shortcut icon" type="image/x-icon" href="https://assets.statup.io/favicon.ico">
|
||||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
|
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
|
||||||
<link rel="stylesheet" href="https://assets.statping.com/base.css">
|
<link rel="stylesheet" href="https://assets.statup.io/base.css">
|
||||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css" integrity="sha384-5sAR7xN1Nv6T6+dT2mhtzEpVJvfS3NScPQTrOxhwjIuvcA67KV2R5Jz6kr4abQsz" crossorigin="anonymous">
|
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css" integrity="sha384-5sAR7xN1Nv6T6+dT2mhtzEpVJvfS3NScPQTrOxhwjIuvcA67KV2R5Jz6kr4abQsz" crossorigin="anonymous">
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
|
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
|
||||||
|
|
|
@ -223,11 +223,11 @@
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{define "extra_css"}}
|
{{define "extra_css"}}
|
||||||
<link rel="stylesheet" href="https://assets.statping.com/codemirror.css">
|
<link rel="stylesheet" href="https://assets.statup.io/codemirror.css">
|
||||||
<link rel="stylesheet" href="https://assets.statping.com/codemirror-colorpicker.css"/>
|
<link rel="stylesheet" href="https://assets.statup.io/codemirror-colorpicker.css"/>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{define "extra_scripts"}}
|
{{define "extra_scripts"}}
|
||||||
<script src="https://assets.statping.com/codemirror.js"></script>
|
<script src="https://assets.statup.io/codemirror.js"></script>
|
||||||
<script src="https://assets.statping.com/css.js"></script>
|
<script src="https://assets.statup.io/css.js"></script>
|
||||||
<script src="https://assets.statping.com/codemirror-colorpicker.min.js"></script>
|
<script src="https://assets.statup.io/codemirror-colorpicker.min.js"></script>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
0.79.96
|
0.79.97
|
Loading…
Reference in New Issue