debian-mirror-gitlab/app/assets/javascripts/monitoring/pages/dashboard_page.vue

30 lines
818 B
Vue
Raw Normal View History

2020-06-23 00:09:42 +05:30
<script>
2020-07-28 23:09:34 +05:30
import { mapActions } from 'vuex';
2020-06-23 00:09:42 +05:30
import Dashboard from '../components/dashboard.vue';
export default {
components: {
Dashboard,
},
props: {
dashboardProps: {
type: Object,
required: true,
},
},
2020-07-28 23:09:34 +05:30
created() {
// This is to support the older URL <project>/-/environments/:env_id/metrics?dashboard=:path
// and the new format <project>/-/metrics/:dashboardPath
const encodedDashboard = this.$route.query.dashboard || this.$route.params.dashboard;
const currentDashboard = encodedDashboard ? decodeURIComponent(encodedDashboard) : null;
this.setCurrentDashboard({ currentDashboard });
},
methods: {
...mapActions('monitoringDashboard', ['setCurrentDashboard']),
},
2020-06-23 00:09:42 +05:30
};
</script>
<template>
<dashboard v-bind="{ ...dashboardProps }" />
</template>