debian-mirror-gitlab/app/assets/javascripts/pipelines/components/nav_controls.vue
2020-04-22 19:07:51 +05:30

66 lines
1.4 KiB
Vue

<script>
import { GlDeprecatedButton } from '@gitlab/ui';
import LoadingButton from '../../vue_shared/components/loading_button.vue';
export default {
name: 'PipelineNavControls',
components: {
LoadingButton,
GlDeprecatedButton,
},
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">
<gl-deprecated-button
v-if="newPipelinePath"
:href="newPipelinePath"
variant="success"
class="js-run-pipeline"
>
{{ s__('Pipelines|Run Pipeline') }}
</gl-deprecated-button>
<loading-button
v-if="resetCachePath"
:loading="isResetCacheButtonLoading"
:label="s__('Pipelines|Clear Runner Caches')"
class="js-clear-cache"
@click="onClickResetCache"
/>
<gl-deprecated-button v-if="ciLintPath" :href="ciLintPath" class="js-ci-lint">
{{ s__('Pipelines|CI Lint') }}
</gl-deprecated-button>
</div>
</template>