1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
<script>
import { mapState } from 'vuex';
import { GlButton, GlTooltipDirective } from '@gitlab/ui';
import { s__ } from '~/locale';
import { DASHBOARD_PAGE } from '../router/constants';
import DashboardPanelBuilder from '../components/dashboard_panel_builder.vue';
export default {
components: {
GlButton,
DashboardPanelBuilder,
},
directives: {
GlTooltip: GlTooltipDirective,
},
computed: {
...mapState('monitoringDashboard', ['panelPreviewYml']),
dashboardPageLocation() {
return {
...this.$route,
name: DASHBOARD_PAGE,
};
},
},
i18n: {
backToDashboard: s__('Metrics|Back to dashboard'),
},
};
</script>
<template>
<div class="gl-mt-5">
<div class="gl-display-flex gl-align-items-baseline gl-mb-5">
<gl-button
v-gl-tooltip
icon="go-back"
:to="dashboardPageLocation"
:aria-label="$options.i18n.backToDashboard"
:title="$options.i18n.backToDashboard"
class="gl-mr-5"
/>
<h1 class="gl-font-size-h1 gl-my-0">{{ s__('Metrics|Add panel') }}</h1>
</div>
<dashboard-panel-builder />
</div>
</template>
|