summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/serverless/components/missing_prometheus.vue
blob: 0023c64e3e4394d572f7e8072256349377991be5 (plain)
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
46
47
48
49
50
51
52
53
54
55
56
57
<script>
import { GlButton, GlLink } from '@gitlab/ui';
import { mapState } from 'vuex';
import { s__ } from '../../locale';

export default {
  components: {
    GlButton,
    GlLink,
  },
  props: {
    missingData: {
      type: Boolean,
      required: true,
    },
  },
  computed: {
    ...mapState(['clustersPath', 'helpPath']),
    missingStateClass() {
      return this.missingData ? 'missing-prometheus-state' : 'empty-prometheus-state';
    },
    prometheusHelpPath() {
      return `${this.helpPath}#prometheus-support`;
    },
    description() {
      return this.missingData
        ? s__(`ServerlessDetails|Invocation metrics loading or not available at this time.`)
        : s__(
            `ServerlessDetails|Function invocation metrics require the Prometheus cluster integration.`,
          );
    },
  },
};
</script>

<template>
  <div class="row" :class="missingStateClass">
    <div class="col-12">
      <div class="text-content">
        <h4 class="state-title text-left">{{ s__(`ServerlessDetails|Invocations`) }}</h4>
        <p class="state-description">
          {{ description }}
          <gl-link :href="prometheusHelpPath">{{
            s__(`ServerlessDetails|More information`)
          }}</gl-link
          >.
        </p>

        <div v-if="!missingData" class="text-left">
          <gl-button :href="clustersPath" variant="success" category="primary">
            {{ s__('ServerlessDetails|Configure cluster.') }}
          </gl-button>
        </div>
      </div>
    </div>
  </div>
</template>