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.

50 lines
1.1 KiB
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
},
2022-07-23 23:45:48 +05:30
i18n: {
registrationToken: s__('Runners|Registration token'),
},
2021-12-11 22:18:48 +05:30
props: {
2022-07-23 23:45:48 +05:30
inputId: {
type: String,
required: true,
},
2021-12-11 22:18:48 +05:30
value: {
type: String,
required: false,
default: '',
},
},
2022-07-23 23:45:48 +05:30
computed: {
formInputGroupProps() {
return {
id: this.inputId,
};
},
},
2021-12-11 22:18:48 +05:30
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"
2022-07-23 23:45:48 +05:30
:label="$options.i18n.registrationToken"
:label-for="inputId"
2022-06-21 17:19:12 +05:30
:copy-button-title="$options.I18N_COPY_BUTTON_TITLE"
2022-07-23 23:45:48 +05:30
:form-input-group-props="formInputGroupProps"
2022-06-21 17:19:12 +05:30
@copy="onCopy"
/>
2021-12-11 22:18:48 +05:30
</template>