debian-mirror-gitlab/app/assets/javascripts/clusters_list/components/agent_empty_state.vue

56 lines
1.3 KiB
Vue
Raw Normal View History

2021-11-18 22:05:49 +05:30
<script>
2022-01-26 12:08:38 +05:30
import { GlButton, GlEmptyState, GlLink, GlSprintf, GlModalDirective } from '@gitlab/ui';
2021-12-11 22:18:48 +05:30
import { helpPagePath } from '~/helpers/help_page_helper';
import { INSTALL_AGENT_MODAL_ID, I18N_AGENTS_EMPTY_STATE } from '../constants';
2021-11-18 22:05:49 +05:30
export default {
2021-12-11 22:18:48 +05:30
i18n: I18N_AGENTS_EMPTY_STATE,
2021-11-18 22:05:49 +05:30
modalId: INSTALL_AGENT_MODAL_ID,
2022-01-26 12:08:38 +05:30
agentDocsUrl: helpPagePath('user/clusters/agent/index'),
2021-11-18 22:05:49 +05:30
components: {
GlButton,
GlEmptyState,
GlLink,
GlSprintf,
},
directives: {
GlModalDirective,
},
2022-01-26 12:08:38 +05:30
inject: ['emptyStateImage'],
2021-11-18 22:05:49 +05:30
props: {
2021-12-11 22:18:48 +05:30
isChildComponent: {
default: false,
required: false,
type: Boolean,
},
2021-11-18 22:05:49 +05:30
},
};
</script>
<template>
2021-12-11 22:18:48 +05:30
<gl-empty-state :svg-path="emptyStateImage" title="" class="agents-empty-state">
2021-11-18 22:05:49 +05:30
<template #description>
2022-01-26 12:08:38 +05:30
<p class="gl-text-left">
<gl-sprintf :message="$options.i18n.introText">
2021-11-18 22:05:49 +05:30
<template #link="{ content }">
2022-01-26 12:08:38 +05:30
<gl-link :href="$options.agentDocsUrl">
2021-11-18 22:05:49 +05:30
{{ content }}
</gl-link>
</template>
</gl-sprintf>
</p>
</template>
<template #actions>
<gl-button
2021-12-11 22:18:48 +05:30
v-if="!isChildComponent"
2021-11-18 22:05:49 +05:30
v-gl-modal-directive="$options.modalId"
category="primary"
2021-12-11 22:18:48 +05:30
variant="confirm"
2021-11-18 22:05:49 +05:30
>
2022-01-26 12:08:38 +05:30
{{ $options.i18n.buttonText }}
2021-11-18 22:05:49 +05:30
</gl-button>
</template>
</gl-empty-state>
</template>