debian-mirror-gitlab/app/assets/javascripts/runner/components/registration/registration_token.vue

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
767 B
Vue
Raw Normal View History

2021-12-11 22:18:48 +05:30
<script>
2022-06-21 17:19:12 +05:30
import { s__ } from '~/locale';
import InputCopyToggleVisibility from '~/vue_shared/components/form/input_copy_toggle_visibility.vue';
2021-12-11 22:18:48 +05:30
export default {
components: {
2022-06-21 17:19:12 +05:30
InputCopyToggleVisibility,
2021-12-11 22:18:48 +05:30
},
props: {
value: {
type: String,
required: false,
default: '',
},
},
methods: {
2022-06-21 17:19:12 +05:30
onCopy() {
2021-12-11 22:18:48 +05:30
// value already in the clipboard, simply notify the user
this.$toast?.show(s__('Runners|Registration token copied!'));
},
},
2022-06-21 17:19:12 +05:30
I18N_COPY_BUTTON_TITLE: s__('Runners|Copy registration token'),
2021-12-11 22:18:48 +05:30
};
</script>
<template>
2022-06-21 17:19:12 +05:30
<input-copy-toggle-visibility
class="gl-m-0"
:value="value"
data-testid="token-value"
:copy-button-title="$options.I18N_COPY_BUTTON_TITLE"
@copy="onCopy"
/>
2021-12-11 22:18:48 +05:30
</template>