cypress updates, change to SQLite database package and settings. BASE PATH fixes

pull/471/head
Hunter Long 2020-03-31 13:22:39 -07:00
parent 1d3418a9f0
commit 21944e7a94
5 changed files with 63 additions and 56 deletions

1
.gitignore vendored
View File

@ -34,3 +34,4 @@ statping
docker
tmp
/frontend/cypress/screenshots/
/frontend/cypress/videos/

View File

@ -1,3 +1,10 @@
# 0.90.21
- Fixed BASE_PATH when using a path for Statping
- Added Cypress testing
- Modified SQLite golang package
- Modified SQLite connection limit, and idle limit. (defaults to 25)
- Fixed installation to use project name and description from form post
# 0.90.20
- Fixed Service Form from sending integer values as strings to API
- Added Cypress e2e testing (working on adding more)

View File

@ -9,194 +9,194 @@ class Api {
}
async core() {
return axios.get('/api').then(response => (response.data))
return axios.get('api').then(response => (response.data))
}
async core_save(obj) {
return axios.post('/api/core', obj).then(response => (response.data))
return axios.post('api/core', obj).then(response => (response.data))
}
async setup_save(data) {
return axios.post('/api/setup', qs.stringify(data)).then(response => (response.data))
return axios.post('api/setup', qs.stringify(data)).then(response => (response.data))
}
async services() {
return axios.get('/api/services').then(response => (response.data))
return axios.get('api/services').then(response => (response.data))
}
async service(id) {
return axios.get('/api/services/' + id).then(response => (response.data))
return axios.get('api/services/' + id).then(response => (response.data))
}
async service_create(data) {
return axios.post('/api/services', data).then(response => (response.data))
return axios.post('api/services', data).then(response => (response.data))
}
async service_update(data) {
return axios.post('/api/services/' + data.id, data).then(response => (response.data))
return axios.post('api/services/' + data.id, data).then(response => (response.data))
}
async service_hits(id, start, end, group, fill=true) {
return axios.get('/api/services/' + id + '/hits_data?start=' + start + '&end=' + end + '&group=' + group + '&fill=' + fill).then(response => (response.data))
return axios.get('api/services/' + id + '/hits_data?start=' + start + '&end=' + end + '&group=' + group + '&fill=' + fill).then(response => (response.data))
}
async service_ping(id, start, end, group, fill=true) {
return axios.get('/api/services/' + id + '/ping_data?start=' + start + '&end=' + end + '&group=' + group + '&fill=' + fill).then(response => (response.data))
return axios.get('api/services/' + id + '/ping_data?start=' + start + '&end=' + end + '&group=' + group + '&fill=' + fill).then(response => (response.data))
}
async service_failures_data(id, start, end, group, fill=true) {
return axios.get('/api/services/' + id + '/failure_data?start=' + start + '&end=' + end + '&group=' + group + '&fill=' + fill).then(response => (response.data))
return axios.get('api/services/' + id + '/failure_data?start=' + start + '&end=' + end + '&group=' + group + '&fill=' + fill).then(response => (response.data))
}
async service_heatmap(id, start, end, group) {
return axios.get('/api/services/' + id + '/heatmap').then(response => (response.data))
return axios.get('api/services/' + id + '/heatmap').then(response => (response.data))
}
async service_failures(id, start, end, limit = 999, offset = 0) {
return axios.get('/api/services/' + id + '/failures?start=' + start + '&end=' + end + '&limit=' + limit+ '&offset=' + offset).then(response => (response.data))
return axios.get('api/services/' + id + '/failures?start=' + start + '&end=' + end + '&limit=' + limit+ '&offset=' + offset).then(response => (response.data))
}
async service_delete(id) {
return axios.delete('/api/services/' + id).then(response => (response.data))
return axios.delete('api/services/' + id).then(response => (response.data))
}
async services_reorder(data) {
return axios.post('/api/reorder/services', data).then(response => (response.data))
return axios.post('api/reorder/services', data).then(response => (response.data))
}
async groups() {
return axios.get('/api/groups').then(response => (response.data))
return axios.get('api/groups').then(response => (response.data))
}
async groups_reorder(data) {
window.console.log('/api/reorder/groups', data)
return axios.post('/api/reorder/groups', data).then(response => (response.data))
window.console.log('api/reorder/groups', data)
return axios.post('api/reorder/groups', data).then(response => (response.data))
}
async group_delete(id) {
return axios.delete('/api/groups/' + id).then(response => (response.data))
return axios.delete('api/groups/' + id).then(response => (response.data))
}
async group_create(data) {
return axios.post('/api/groups', data).then(response => (response.data))
return axios.post('api/groups', data).then(response => (response.data))
}
async group_update(data) {
return axios.post('/api/groups/' + data.id, data).then(response => (response.data))
return axios.post('api/groups/' + data.id, data).then(response => (response.data))
}
async users() {
return axios.get('/api/users').then(response => (response.data))
return axios.get('api/users').then(response => (response.data))
}
async user_create(data) {
return axios.post('/api/users', data).then(response => (response.data))
return axios.post('api/users', data).then(response => (response.data))
}
async user_update(data) {
return axios.post('/api/users/' + data.id, data).then(response => (response.data))
return axios.post('api/users/' + data.id, data).then(response => (response.data))
}
async user_delete(id) {
return axios.delete('/api/users/' + id).then(response => (response.data))
return axios.delete('api/users/' + id).then(response => (response.data))
}
async incident_updates(incident) {
return axios.post('/api/incidents/'+incident.id+'/updates', data).then(response => (response.data))
return axios.post('api/incidents/'+incident.id+'/updates', data).then(response => (response.data))
}
async incident_update_create(incident, data) {
return axios.post('/api/incidents/'+incident.id+'/updates', data).then(response => (response.data))
return axios.post('api/incidents/'+incident.id+'/updates', data).then(response => (response.data))
}
async incidents_service(service) {
return axios.get('/api/services/'+service.id+'/incidents').then(response => (response.data))
return axios.get('api/services/'+service.id+'/incidents').then(response => (response.data))
}
async incident_create(service, data) {
return axios.post('/api/services/'+service.id+'/incidents', data).then(response => (response.data))
return axios.post('api/services/'+service.id+'/incidents', data).then(response => (response.data))
}
async incident_delete(incident) {
return axios.delete('/api/incidents/'+incident.id).then(response => (response.data))
return axios.delete('api/incidents/'+incident.id).then(response => (response.data))
}
async messages() {
return axios.get('/api/messages').then(response => (response.data))
return axios.get('api/messages').then(response => (response.data))
}
async message_create(data) {
return axios.post('/api/messages', data).then(response => (response.data))
return axios.post('api/messages', data).then(response => (response.data))
}
async message_update(data) {
return axios.post('/api/messages/' + data.id, data).then(response => (response.data))
return axios.post('api/messages/' + data.id, data).then(response => (response.data))
}
async message_delete(id) {
return axios.delete('/api/messages/' + id).then(response => (response.data))
return axios.delete('api/messages/' + id).then(response => (response.data))
}
async group(id) {
return axios.get('/api/groups/' + id).then(response => (response.data))
return axios.get('api/groups/' + id).then(response => (response.data))
}
async notifiers() {
return axios.get('/api/notifiers').then(response => (response.data))
return axios.get('api/notifiers').then(response => (response.data))
}
async notifier_save(data) {
return axios.post('/api/notifier/' + data.method, data).then(response => (response.data))
return axios.post('api/notifier/' + data.method, data).then(response => (response.data))
}
async notifier_test(data) {
return axios.post('/api/notifier/' + data.method + '/test', data).then(response => (response.data))
return axios.post('api/notifier/' + data.method + '/test', data).then(response => (response.data))
}
async renewApiKeys() {
return axios.get('/api/renew').then(response => (response.data))
return axios.get('api/renew').then(response => (response.data))
}
async cache() {
return axios.get('/api/cache').then(response => (response.data))
return axios.get('api/cache').then(response => (response.data))
}
async clearCache() {
return axios.get('/api/clear_cache').then(response => (response.data))
return axios.get('api/clear_cache').then(response => (response.data))
}
async logs() {
return axios.get('/api/logs').then(response => (response.data))
return axios.get('api/logs').then(response => (response.data))
}
async logs_last() {
return axios.get('/api/logs/last').then(response => (response.data))
return axios.get('api/logs/last').then(response => (response.data))
}
async theme() {
return axios.get('/api/theme').then(response => (response.data))
return axios.get('api/theme').then(response => (response.data))
}
async theme_generate(create = true) {
if (create) {
return axios.get('/api/theme/create').then(response => (response.data))
return axios.get('api/theme/create').then(response => (response.data))
} else {
return axios.delete('/api/theme').then(response => (response.data))
return axios.delete('api/theme').then(response => (response.data))
}
}
async theme_save(data) {
return axios.post('/api/theme', data).then(response => (response.data))
return axios.post('api/theme', data).then(response => (response.data))
}
async login(username, password) {
const f = {username: username, password: password}
return axios.post('/api/login', qs.stringify(f))
return axios.post('api/login', qs.stringify(f))
.then(response => (response.data))
}
async logout() {
await axios.get('/api/logout').then(response => (response.data))
await axios.get('api/logout').then(response => (response.data))
return localStorage.removeItem(tokenKey)
}

View File

@ -60,12 +60,12 @@ func Router() *mux.Router {
}
r.Use(sendLog)
if source.UsingAssets(dir) {
indexHandler := http.FileServer(http.Dir(dir + "/assets/"))
r.PathPrefix("/css/").Handler(Gzip(staticAssets("css")))
r.PathPrefix("/font/").Handler(staticAssets("font"))
r.PathPrefix("/js/").Handler(Gzip(staticAssets("js")))
r.PathPrefix("/css/").Handler(http.StripPrefix(basePath, Gzip(staticAssets("css"))))
r.PathPrefix("/js/").Handler(http.StripPrefix(basePath, Gzip(staticAssets("js"))))
r.PathPrefix("/robots.txt").Handler(http.StripPrefix(basePath, indexHandler))
r.PathPrefix("/favicon.ico").Handler(http.StripPrefix(basePath, indexHandler))
r.PathPrefix("/banner.png").Handler(http.StripPrefix(basePath, indexHandler))
@ -73,10 +73,9 @@ func Router() *mux.Router {
tmplFileSrv := http.FileServer(source.TmplBox.HTTPBox())
tmplBoxHandler := http.StripPrefix(basePath, tmplFileSrv)
r.PathPrefix("/css/").Handler(Gzip(tmplFileSrv))
r.PathPrefix("/scss/").Handler(Gzip(tmplFileSrv))
r.PathPrefix("/font/").Handler(tmplFileSrv)
r.PathPrefix("/js/").Handler(Gzip(tmplFileSrv))
r.PathPrefix("/css/").Handler(http.StripPrefix(basePath, Gzip(tmplFileSrv)))
r.PathPrefix("/scss/").Handler(http.StripPrefix(basePath, Gzip(tmplFileSrv)))
r.PathPrefix("/js/").Handler(http.StripPrefix(basePath, Gzip(tmplFileSrv)))
r.PathPrefix("/robots.txt").Handler(tmplBoxHandler)
r.PathPrefix("/favicon.ico").Handler(tmplBoxHandler)
r.PathPrefix("/banner.png").Handler(tmplBoxHandler)

View File

@ -1 +1 @@
0.90.20
0.90.21