summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/pipelines/components/nav_controls.vue
blob: efb80d3a3c0029dc7469b615bbdbf4874ab2bb8f (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
58
59
60
61
62
63
64
65
66
67
<script>
import LoadingButton from '../../vue_shared/components/loading_button.vue';

export default {
  name: 'PipelineNavControls',
  components: {
    LoadingButton,
  },
  props: {
    newPipelinePath: {
      type: String,
      required: false,
      default: null,
    },

    resetCachePath: {
      type: String,
      required: false,
      default: null,
    },

    ciLintPath: {
      type: String,
      required: false,
      default: null,
    },

    isResetCacheButtonLoading: {
      type: Boolean,
      required: false,
      default: false,
    },
  },
  methods: {
    onClickResetCache() {
      this.$emit('resetRunnersCache', this.resetCachePath);
    },
  },
};
</script>
<template>
  <div class="nav-controls">
    <a
      v-if="newPipelinePath"
      :href="newPipelinePath"
      class="btn btn-success js-run-pipeline"
    >
      {{ s__('Pipelines|Run Pipeline') }}
    </a>

    <loading-button
      v-if="resetCachePath"
      :loading="isResetCacheButtonLoading"
      :label="s__('Pipelines|Clear Runner Caches')"
      class="btn btn-default js-clear-cache"
      @click="onClickResetCache"
    />

    <a
      v-if="ciLintPath"
      :href="ciLintPath"
      class="btn btn-default js-ci-lint"
    >
      {{ s__('Pipelines|CI Lint') }}
    </a>
  </div>
</template>