diff --git a/src/client/app/desktop/views/pages/admin/admin.chart.vue b/src/client/app/desktop/views/pages/admin/admin.chart.vue index f40f89b2e0..b02f6c31b7 100644 --- a/src/client/app/desktop/views/pages/admin/admin.chart.vue +++ b/src/client/app/desktop/views/pages/admin/admin.chart.vue @@ -44,13 +44,9 @@ export default Vue.extend({ components: { XChart }, - props: { - chart: { - required: true - } - }, data() { return { + chart: null, chartType: 'local-notes', span: 'hour' }; @@ -85,6 +81,11 @@ export default Vue.extend({ ); } }, + created() { + (this as any).api('chart').then(chart => { + this.chart = chart; + }); + }, methods: { notesChart(local: boolean): any { const data = this.stats.slice().reverse().map(x => ({ diff --git a/src/client/app/desktop/views/pages/admin/admin.vue b/src/client/app/desktop/views/pages/admin/admin.vue index 066c1a4f4f..0bb5ed0a0f 100644 --- a/src/client/app/desktop/views/pages/admin/admin.vue +++ b/src/client/app/desktop/views/pages/admin/admin.vue @@ -11,7 +11,7 @@
- +
@@ -49,11 +49,6 @@ export default Vue.extend({ chart: null }; }, - created() { - (this as any).api('admin/chart').then(chart => { - this.chart = chart; - }); - }, methods: { nav(page: string) { this.page = page; diff --git a/src/server/api/endpoints/admin/chart.ts b/src/server/api/endpoints/chart.ts similarity index 95% rename from src/server/api/endpoints/admin/chart.ts rename to src/server/api/endpoints/chart.ts index 1b88af00bd..a58f0b163e 100644 --- a/src/server/api/endpoints/admin/chart.ts +++ b/src/server/api/endpoints/chart.ts @@ -1,10 +1,8 @@ -import Stats, { IStats } from '../../../../models/stats'; +import Stats, { IStats } from '../../../models/stats'; type Omit = Pick>; export const meta = { - requireCredential: true, - requireAdmin: true }; export default (params: any) => new Promise(async (res, rej) => {