blob: d886a67fff7dc8a0dba23491ee8b971f80fdac97 (
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
43
|
<script>
import { GlButton, GlModalDirective } from '@gitlab/ui';
import { s__ } from '~/locale';
import RunnerInstructionsModal from './runner_instructions_modal.vue';
export default {
components: {
GlButton,
RunnerInstructionsModal,
},
directives: {
GlModalDirective,
},
modalId: 'runner-instructions-modal',
i18n: {
buttonText: s__('Runners|Show Runner installation instructions'),
},
data() {
return {
opened: false,
};
},
methods: {
onClick() {
// lazily mount modal to prevent premature instructions requests
this.opened = true;
},
},
};
</script>
<template>
<div>
<gl-button
v-gl-modal-directive="$options.modalId"
class="gl-mt-4"
data-testid="show-modal-button"
@click="onClick"
>
{{ $options.i18n.buttonText }}
</gl-button>
<runner-instructions-modal v-if="opened" :modal-id="$options.modalId" />
</div>
</template>
|