debian-mirror-gitlab/app/assets/javascripts/monitoring/pages/dashboard_page.vue
2020-08-09 17:41:57 +05:30

29 lines
818 B
Vue

<script>
import { mapActions } from 'vuex';
import Dashboard from '../components/dashboard.vue';
export default {
components: {
Dashboard,
},
props: {
dashboardProps: {
type: Object,
required: true,
},
},
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']),
},
};
</script>
<template>
<dashboard v-bind="{ ...dashboardProps }" />
</template>