summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/environments/components/environment_pin.vue
blob: 0b753d53ee372431693c05b326226e568aaeadef (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
<script>
/**
 * Renders a prevent auto-stop button.
 * Used in environments table.
 */
import { GlDropdownItem } from '@gitlab/ui';
import { __ } from '~/locale';
import eventHub from '../event_hub';

export default {
  components: {
    GlDropdownItem,
  },
  props: {
    autoStopUrl: {
      type: String,
      required: true,
    },
  },
  methods: {
    onPinClick() {
      eventHub.$emit('cancelAutoStop', this.autoStopUrl);
    },
  },
  title: __('Prevent auto-stopping'),
};
</script>
<template>
  <gl-dropdown-item @click="onPinClick">
    {{ $options.title }}
  </gl-dropdown-item>
</template>