Skip to content

Commit

Permalink
PR merges, version bump, removed internal cache, removed unused http …
Browse files Browse the repository at this point in the history
…server complexities
  • Loading branch information
hunterlong committed Dec 15, 2020
1 parent 1a56afe commit a03f93b
Show file tree
Hide file tree
Showing 23 changed files with 118 additions and 332 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 0.90.73 (12-15-2020)
- Removed complexity in code for http server
- Removed internal cache functionality (not useful, needs refactor)
- Merged PR https://github.com/statping/statping/pull/909
- Merged PR https://github.com/statping/statping/pull/880
- Merged PR https://github.com/statping/statping/pull/859

# 0.90.72 (10-28-2020)
- Fixed issue with graphs becoming stuck on reload

Expand Down
2 changes: 1 addition & 1 deletion frontend/config/sentry.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[defaults]
org=Statping
project=statping_frontend
project=frontend
url=https://sentry.statping.com

[auth]
Expand Down
2 changes: 2 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
"@fortawesome/vue-fontawesome": "^0.1.9",
"@sentry/browser": "^5.20.1",
"@sentry/integrations": "^5.20.1",
"@sentry/tracing": "^5.29.0",
"@sentry/vue": "^5.29.0",
"apexcharts": "^3.6.6",
"axios": "^0.19.1",
"codemirror-colorpicker": "^1.9.66",
Expand Down
8 changes: 0 additions & 8 deletions frontend/src/API.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,6 @@ class Api {
return axios.get('api/renew').then(response => (response.data))
}

async cache() {
return axios.get('api/cache').then(response => (response.data))
}

async clearCache() {
return axios.get('api/clear_cache').then(response => (response.data))
}

async logs() {
return axios.get('api/logs').then(response => (response.data)) || []
}
Expand Down
53 changes: 0 additions & 53 deletions frontend/src/components/Dashboard/Cache.vue

This file was deleted.

9 changes: 6 additions & 3 deletions frontend/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import VueClipboard from 'vue-clipboard2'
import VueCookies from 'vue-cookies'
import VueI18n from 'vue-i18n'
import * as Sentry from "@sentry/browser";
import * as Integrations from "@sentry/integrations";
import { Integrations as TracingIntegrations } from "@sentry/tracing";
import router from './routes'
import "./mixin"
import "./icons"
import store from './store'
import language from './languages'

const errorReporter = "https://bed4d75404924cb3a799e370733a1b64@sentry.statping.com/3"
const errorReporter = "https://f674a4b91578476a99809f1dea56b63b@sentry.statping.com/3"

const App = () => import(/* webpackChunkName: "index" */ '@/App.vue')

Expand All @@ -33,8 +33,11 @@ const i18n = new VueI18n({
Vue.$cookies.config('3d')

Sentry.init({
Vue: Vue,
dsn: errorReporter,
integrations: [new Integrations.Vue({Vue, attachProps: true, logErrors: true})],
integrations: [new TracingIntegrations.BrowserTracing()],
tracesSampleRate: 0.2,
environment: process.env.NODE_ENV === 'production' ? 'production' : 'development',
});

Vue.config.productionTip = process.env.NODE_ENV !== 'production'
Expand Down
7 changes: 3 additions & 4 deletions frontend/src/pages/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

<script>
import Api from "@/API";
const Group = () => import(/* webpackChunkName: "index" */ '@/components/Index/Group')
const Header = () => import(/* webpackChunkName: "index" */ '@/components/Index/Header')
const MessageBlock = () => import(/* webpackChunkName: "index" */ '@/components/Index/MessageBlock')
Expand All @@ -63,9 +64,7 @@ export default {
},
computed: {
loading_text() {
if (!this.$store.getters.core.version) {
return "Loading Core"
} else if (this.$store.getters.groups.length === 0) {
if (this.$store.getters.groups.length === 0) {
return "Loading Groups"
} else if (this.$store.getters.services.length === 0) {
return "Loading Services"
Expand All @@ -74,7 +73,7 @@ export default {
}
},
loaded() {
return this.$store.getters.core.version && this.$store.getters.services.length !== 0
return this.$store.getters.services.length !== 0
},
core() {
return this.$store.getters.core
Expand Down
10 changes: 0 additions & 10 deletions frontend/src/pages/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
<a @click.prevent="changeTab" class="nav-link" v-bind:class="{active: liClass('v-pills-style-tab')}" id="v-pills-style-tab" data-toggle="pill" href="#v-pills-style" role="tab" aria-controls="v-pills-style" aria-selected="false">
<font-awesome-icon icon="image" class="mr-2"/> {{ $t('theme') }}
</a>
<a @click.prevent="changeTab" class="nav-link" v-bind:class="{active: liClass('v-pills-cache-tab')}" id="v-pills-cache-tab" data-toggle="pill" href="#v-pills-cache" role="tab" aria-controls="v-pills-cache" aria-selected="false">
<font-awesome-icon icon="paperclip" class="mr-2"/> {{ $t('cache') }}
</a>
<a @click.prevent="changeTab" class="nav-link" v-bind:class="{active: liClass('v-pills-oauth-tab')}" id="v-pills-oauth-tab" data-toggle="pill" href="#v-pills-oauth" role="tab" aria-controls="v-pills-oauth" aria-selected="false">
<font-awesome-icon icon="key" class="mr-2"/> {{ $t('authentication') }}
</a>
Expand Down Expand Up @@ -110,10 +107,6 @@
<ThemeEditor/>
</div>

<div class="tab-pane fade" v-bind:class="{active: liClass('v-pills-cache-tab'), show: liClass('v-pills-cache-tab')}" id="v-pills-cache" role="tabpanel" aria-labelledby="v-pills-cache-tab">
<Cache/>
</div>

<div class="tab-pane fade" v-bind:class="{active: liClass('v-pills-oauth-tab'), show: liClass('v-pills-oauth-tab')}" id="v-pills-oauth" role="tabpanel" aria-labelledby="v-pills-oauth-tab">
<OAuth/>
</div>
Expand Down Expand Up @@ -150,7 +143,6 @@
const Notifier = () => import(/* webpackChunkName: "dashboard" */ '@/forms/Notifier')
const OAuth = () => import(/* webpackChunkName: "dashboard" */ '@/forms/OAuth')
const ThemeEditor = () => import(/* webpackChunkName: "dashboard" */ '@/components/Dashboard/ThemeEditor')
const Cache = () => import(/* webpackChunkName: "dashboard" */ '@/components/Dashboard/Cache')
const Importer = () => import(/* webpackChunkName: "dashboard" */ '@/components/Dashboard/Importer')
const Variables = () => import(/* webpackChunkName: "dashboard" */ '@/components/Dashboard/Variables')
const Configs = () => import(/* webpackChunkName: "dashboard" */ '@/components/Dashboard/Configs')
Expand All @@ -162,7 +154,6 @@
Importer,
Variables,
OAuth,
Cache,
ThemeEditor,
FormIntegration,
Notifier,
Expand Down Expand Up @@ -196,7 +187,6 @@
},
methods: {
async update() {
this.cache = await Api.cache()
await this.getGithub()
},
async getGithub() {
Expand Down
75 changes: 75 additions & 0 deletions frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1094,6 +1094,16 @@
"@nodelib/fs.scandir" "2.1.3"
fastq "^1.6.0"

"@sentry/[email protected]":
version "5.29.0"
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-5.29.0.tgz#a8cab91729c759c456bd2254cef65bafa5cdc4ea"
integrity sha512-kRlt1mE2wrYjspnIupNnPxqsUrRuy02SuXhbpP7J6uu8QasoEmJ78hk0hHz4jOZRmuWwfs2zIXD4tLGgWOKq8A==
dependencies:
"@sentry/core" "5.29.0"
"@sentry/types" "5.29.0"
"@sentry/utils" "5.29.0"
tslib "^1.9.3"

"@sentry/browser@^5.20.1":
version "5.20.1"
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-5.20.1.tgz#be59522d0914d58309e1367d997d4b3cd5385d7e"
Expand All @@ -1115,6 +1125,17 @@
"@sentry/utils" "5.20.1"
tslib "^1.9.3"

"@sentry/[email protected]":
version "5.29.0"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.29.0.tgz#4410ca0dc5785abf3df02fa23c18e83ad90d7cda"
integrity sha512-a1sZBJ2u3NG0YDlGvOTwUCWiNjhfmDtAQiKK1o6RIIbcrWy9TlSps7CYDkBP239Y3A4pnvohjEEKEP3v3L3LZQ==
dependencies:
"@sentry/hub" "5.29.0"
"@sentry/minimal" "5.29.0"
"@sentry/types" "5.29.0"
"@sentry/utils" "5.29.0"
tslib "^1.9.3"

"@sentry/[email protected]":
version "5.20.1"
resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.20.1.tgz#05e83ba972a96e9d7225a64c7d3728aa9fcefc4e"
Expand All @@ -1124,6 +1145,15 @@
"@sentry/utils" "5.20.1"
tslib "^1.9.3"

"@sentry/[email protected]":
version "5.29.0"
resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.29.0.tgz#d018b978fdffc6c8261744b0d08e8d25a3f4dc58"
integrity sha512-kcDPQsRG4cFdmqDh+TzjeO7lWYxU8s1dZYAbbl1J4uGKmhNB0J7I4ak4SGwTsXLY6fhbierxr6PRaoNojCxjPw==
dependencies:
"@sentry/types" "5.29.0"
"@sentry/utils" "5.29.0"
tslib "^1.9.3"

"@sentry/integrations@^5.20.1":
version "5.20.1"
resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-5.20.1.tgz#c42dd53c2162b96bf4da641cd1c2bd53c0bbdce3"
Expand All @@ -1142,11 +1172,36 @@
"@sentry/types" "5.20.1"
tslib "^1.9.3"

"@sentry/[email protected]":
version "5.29.0"
resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.29.0.tgz#bd8b52f388abcec2234dbbc6d6721ff65aa30e35"
integrity sha512-nhXofdjtO41/caiF1wk1oT3p/QuhOZDYdF/b29DoD2MiAMK9IjhhOXI/gqaRpDKkXlDvd95fDTcx4t/MqqcKXA==
dependencies:
"@sentry/hub" "5.29.0"
"@sentry/types" "5.29.0"
tslib "^1.9.3"

"@sentry/tracing@^5.29.0":
version "5.29.0"
resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-5.29.0.tgz#8ed515b3f9d409137357c38c8622858f9e684e4a"
integrity sha512-2ZITUH7Eur7IkmRAd5gw8Xt2Sfc28btCnT7o2P2J8ZPD65e99ATqjxXPokx0+6zEkTsstIDD3mbyuwkpbuvuTA==
dependencies:
"@sentry/hub" "5.29.0"
"@sentry/minimal" "5.29.0"
"@sentry/types" "5.29.0"
"@sentry/utils" "5.29.0"
tslib "^1.9.3"

"@sentry/[email protected]":
version "5.20.1"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.20.1.tgz#ccc4fa4c9d0f94d93014b04e674762d5d5cd30a2"
integrity sha512-OU+i/lcjGpDJv0XkNpsKrI2r1VPp8qX0H6Knq8NuZrlZe3AbvO3jRJJK0pH14xFv8Xok5jbZZpKKoQLxYfxqsw==

"@sentry/[email protected]":
version "5.29.0"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.29.0.tgz#af5cec98cde54316c14df3121f0e8106e56b578e"
integrity sha512-iDkxT/9sT3UF+Xb+JyLjZ5caMXsgLfRyV9VXQEiR2J6mgpMielj184d9jeF3bm/VMuAf/VFFqrHlcVsVgmrrMw==

"@sentry/[email protected]":
version "5.20.1"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.20.1.tgz#68cfae0d0e3b321b4649b59f30265024b29eae63"
Expand All @@ -1155,6 +1210,26 @@
"@sentry/types" "5.20.1"
tslib "^1.9.3"

"@sentry/[email protected]":
version "5.29.0"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.29.0.tgz#b4c1223ba362a94cf4850e9ca2cb24655b006b53"
integrity sha512-b2B1gshw2u3EHlAi84PuI5sfmLKXW1z9enMMhNuuNT/CoRp+g5kMAcUv/qYTws7UNnYSvTuVGuZG30v1e0hP9A==
dependencies:
"@sentry/types" "5.29.0"
tslib "^1.9.3"

"@sentry/vue@^5.29.0":
version "5.29.0"
resolved "https://registry.yarnpkg.com/@sentry/vue/-/vue-5.29.0.tgz#606e0c7fe3e6860934eb19461d8fc6cf97b1a198"
integrity sha512-AIlPWdC6uNhLcFUBFfvY2CblHSQK0IK7y+qdOKVhpQFNBz6zOEHleg98UEv4uVmXeKqmpESkIDeCcAP7MqCCyQ==
dependencies:
"@sentry/browser" "5.29.0"
"@sentry/core" "5.29.0"
"@sentry/minimal" "5.29.0"
"@sentry/types" "5.29.0"
"@sentry/utils" "5.29.0"
tslib "^1.9.3"

"@soda/friendly-errors-webpack-plugin@^1.7.1":
version "1.7.1"
resolved "https://registry.yarnpkg.com/@soda/friendly-errors-webpack-plugin/-/friendly-errors-webpack-plugin-1.7.1.tgz#706f64bcb4a8b9642b48ae3ace444c70334d615d"
Expand Down
21 changes: 0 additions & 21 deletions handlers/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,27 +116,6 @@ type cacheJson struct {
Size int `json:"size"`
}

func apiCacheHandler(w http.ResponseWriter, r *http.Request) {
var cacheList []cacheJson
for k, v := range CacheStorage.List() {
cacheList = append(cacheList, cacheJson{
URL: k,
Expiration: time.Unix(0, v.Expiration).UTC(),
Size: len(v.Content),
})
}
returnJson(cacheList, w, r)
}

func apiClearCacheHandler(w http.ResponseWriter, r *http.Request) {
CacheStorage.StopRoutine()
CacheStorage = NewStorage()
output := apiResponse{
Status: "success",
}
returnJson(output, w, r)
}

func sendErrorJson(err error, w http.ResponseWriter, r *http.Request) {
errCode := 0
e, ok := err.(errors.Error)
Expand Down
28 changes: 0 additions & 28 deletions handlers/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/pkg/errors"
_ "github.com/statping/statping/notifiers"
"github.com/statping/statping/source"
"github.com/statping/statping/types"
"github.com/statping/statping/types/checkins"
"github.com/statping/statping/types/core"
"github.com/statping/statping/types/groups"
Expand Down Expand Up @@ -168,33 +167,6 @@ func TestMainApiRoutes(t *testing.T) {
BeforeTest: SetTestENV,
SecureRoute: true,
},
{
Name: "Statping View Cache",
URL: "/api/cache",
Method: "GET",
ExpectedStatus: 200,
BeforeTest: SetTestENV,
SecureRoute: true,
ResponseLen: 0,
},
{
Name: "Statping Clear Cache",
URL: "/api/clear_cache",
Method: "POST",
ExpectedStatus: 200,
SecureRoute: true,
BeforeTest: func(t *testing.T) error {
CacheStorage.Set("test", []byte("data here"), types.Day)
list := CacheStorage.List()
assert.Len(t, list, 1)
return nil
},
AfterTest: func(t *testing.T) error {
list := CacheStorage.List()
assert.Len(t, list, 0)
return nil
},
},
{
Name: "Update Core",
URL: "/api/core",
Expand Down
Loading

0 comments on commit a03f93b

Please sign in to comment.