2020-03-13 15:44:24 +05:30
|
|
|
<script>
|
|
|
|
/**
|
|
|
|
* Renders a prevent auto-stop button.
|
|
|
|
* Used in environments table.
|
|
|
|
*/
|
2020-04-22 19:07:51 +05:30
|
|
|
import { GlDeprecatedButton, GlTooltipDirective } from '@gitlab/ui';
|
2020-03-13 15:44:24 +05:30
|
|
|
import Icon from '~/vue_shared/components/icon.vue';
|
|
|
|
import { __ } from '~/locale';
|
|
|
|
import eventHub from '../event_hub';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
Icon,
|
2020-04-22 19:07:51 +05:30
|
|
|
GlDeprecatedButton,
|
2020-03-13 15:44:24 +05:30
|
|
|
},
|
|
|
|
directives: {
|
|
|
|
GlTooltip: GlTooltipDirective,
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
autoStopUrl: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
onPinClick() {
|
|
|
|
eventHub.$emit('cancelAutoStop', this.autoStopUrl);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
title: __('Prevent environment from auto-stopping'),
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
<template>
|
2020-04-22 19:07:51 +05:30
|
|
|
<gl-deprecated-button
|
|
|
|
v-gl-tooltip
|
|
|
|
:title="$options.title"
|
|
|
|
:aria-label="$options.title"
|
|
|
|
@click="onPinClick"
|
|
|
|
>
|
2020-03-13 15:44:24 +05:30
|
|
|
<icon name="thumbtack" />
|
2020-04-22 19:07:51 +05:30
|
|
|
</gl-deprecated-button>
|
2020-03-13 15:44:24 +05:30
|
|
|
</template>
|