blob: 67a178b5f981b6fa02671a534cd3b98581259081 (
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, GlTooltip } from '@gitlab/ui';
import { s__ } from '~/locale';
import { CREATE_TOKEN_MODAL } from '../constants';
export default {
components: {
GlButton,
GlTooltip,
},
directives: {
GlModalDirective,
},
inject: ['canAdminCluster'],
modalId: CREATE_TOKEN_MODAL,
i18n: {
createTokenButton: s__('ClusterAgents|Create token'),
dropdownDisabledHint: s__(
'ClusterAgents|Requires a Maintainer or greater role to perform these actions',
),
},
};
</script>
<template>
<div>
<div ref="addToken" class="gl-display-inline-block">
<gl-button
v-gl-modal-directive="$options.modalId"
:disabled="!canAdminCluster"
category="primary"
variant="confirm"
>{{ $options.i18n.createTokenButton }}
</gl-button>
<gl-tooltip
v-if="!canAdminCluster"
:target="() => $refs.addToken"
:title="$options.i18n.dropdownDisabledHint"
/>
</div>
</div>
</template>
|