Welcome to mirror list, hosted at ThFree Co, Russian Federation.

environment_pin.vue « components « environments « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3a219e98b08981c6d5fe38c5f07062fbdb13a6fe (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
<script>
/**
 * Renders a prevent auto-stop button.
 * Used in environments table.
 */
import { GlDeprecatedButton, GlTooltipDirective } from '@gitlab/ui';
import Icon from '~/vue_shared/components/icon.vue';
import { __ } from '~/locale';
import eventHub from '../event_hub';

export default {
  components: {
    Icon,
    GlDeprecatedButton,
  },
  directives: {
    GlTooltip: GlTooltipDirective,
  },
  props: {
    autoStopUrl: {
      type: String,
      required: true,
    },
  },
  methods: {
    onPinClick() {
      eventHub.$emit('cancelAutoStop', this.autoStopUrl);
    },
  },
  title: __('Prevent environment from auto-stopping'),
};
</script>
<template>
  <gl-deprecated-button
    v-gl-tooltip
    :title="$options.title"
    :aria-label="$options.title"
    @click="onPinClick"
  >
    <icon name="thumbtack" />
  </gl-deprecated-button>
</template>