debian-mirror-gitlab/app/assets/javascripts/environments/components/environment_pin.vue

33 lines
607 B
Vue
Raw Normal View History

2020-03-13 15:44:24 +05:30
<script>
/**
* Renders a prevent auto-stop button.
* Used in environments table.
*/
2021-11-18 22:05:49 +05:30
import { GlDropdownItem } from '@gitlab/ui';
2020-03-13 15:44:24 +05:30
import { __ } from '~/locale';
import eventHub from '../event_hub';
export default {
components: {
2021-11-18 22:05:49 +05:30
GlDropdownItem,
2020-03-13 15:44:24 +05:30
},
props: {
autoStopUrl: {
type: String,
required: true,
},
},
methods: {
onPinClick() {
eventHub.$emit('cancelAutoStop', this.autoStopUrl);
},
},
2021-11-18 22:05:49 +05:30
title: __('Prevent auto-stopping'),
2020-03-13 15:44:24 +05:30
};
</script>
<template>
2021-11-18 22:05:49 +05:30
<gl-dropdown-item @click="onPinClick">
{{ $options.title }}
</gl-dropdown-item>
2020-03-13 15:44:24 +05:30
</template>