summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/environments/components/environment_stop.js.es6
blob: 1ae02d8080c2c3e9cc96d675d05638e13999b200 (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
/*= require vue
/* global Vue */

(() => {
  window.gl = window.gl || {};
  window.gl.environmentsList = window.gl.environmentsList || {};

  window.gl.environmentsList.StopComponent = Vue.component('stop-component', {
    props: {
      stop_url: {
        type: String,
        default: '',
      },
    },

    methods: {
      openConfirmDialog() {
        return window.confirm('Are you sure you want to stop this environment?');
      },
    },

    template: `
      <a v-on:click="openConfirmDialog"
        class="btn stop-env-link"
        :href="stop_url"
        method="post"
        rel="nofollow">
        <i class="fa fa-stop stop-env-icon"></i>
      </a>
    `,
  });
})();