Skip to content
Snippets Groups Projects
Commit 8fddb11a authored by Sascha Eggenberger's avatar Sascha Eggenberger :speech_balloon:
Browse files

Admin AI settings: Migrate to use PageHeading component

parent 0c0e54ad
No related branches found
No related tags found
2 merge requests!170053Security patch upgrade alert: Only expose to admins 17-4,!168047Admin AI settings: Migrate to use PageHeading component
This commit is part of merge request !168047. Comments created here will be created in the context of that merge request.
<script>
import { GlEmptyState, GlButton, GlSkeletonLoader } from '@gitlab/ui';
import EmptyEnvironmentSvg from '@gitlab/svgs/dist/illustrations/empty-state/empty-environment-md.svg?url';
import PageHeading from '~/vue_shared/components/page_heading.vue';
import { s__ } from '~/locale';
import { createAlert } from '~/alert';
import getSelfHostedModelsQuery from '../graphql/queries/get_self_hosted_models.query.graphql';
......@@ -13,6 +14,7 @@ export default {
GlButton,
GlSkeletonLoader,
SelfHostedModelsTable,
PageHeading,
},
props: {
basePath: {
......@@ -77,23 +79,20 @@ export default {
</div>
</div>
<div v-else>
<section>
<h1 class="page-title gl-text-size-h-display">
{{ s__('AdminSelfHostedModels|Self-hosted models') }}
</h1>
<div class="gl-items-top gl-flex gl-justify-between gl-pb-2">
<p>
{{
s__('AdminSelfHostedModels|Manage AI models that can be used for GitLab AI features.')
}}
</p>
<div v-if="hasModels" class="gl-pb-4">
<gl-button category="primary" variant="confirm" :href="newSelfHostedModelPath"
>{{ s__('AdminSelfHostedModels|Add self-hosted model') }}
</gl-button>
</div>
</div>
</section>
<page-heading :heading="s__('AdminSelfHostedModels|Self-hosted models')">
<template #description>
{{
s__('AdminSelfHostedModels|Manage AI models that can be used for GitLab AI features.')
}}
</template>
<template v-if="hasModels" #actions>
<gl-button category="primary" variant="confirm" :href="newSelfHostedModelPath"
>{{ s__('AdminSelfHostedModels|Add self-hosted model') }}
</gl-button>
</template>
</page-heading>
<gl-skeleton-loader v-if="isLoading" />
<self-hosted-models-table v-else :models="selfHostedModels" :base-path="basePath" />
</div>
......
......@@ -2,6 +2,7 @@
import { GlBadge, GlAlert, GlSprintf } from '@gitlab/ui';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { __, s__, sprintf } from '~/locale';
import PageHeading from '~/vue_shared/components/page_heading.vue';
import { isInFuture } from '~/lib/utils/datetime/date_calculation_utility';
import getAddOnPurchasesQuery from 'ee/usage_quotas/add_on/graphql/get_add_on_purchases.query.graphql';
import getCurrentLicense from 'ee/admin/subscriptions/show/graphql/queries/get_current_license.query.graphql';
......@@ -52,6 +53,7 @@ export default {
GlBadge,
GlAlert,
GlSprintf,
PageHeading,
},
inject: { isSaaS: {}, isStandalonePage: { default: false }, groupId: { default: null } },
addOnErrorDictionary: ADD_ON_ERROR_DICTIONARY,
......@@ -240,24 +242,25 @@ export default {
</gl-alert>
<template v-if="showTitleAndSubtitle">
<section>
<header class="gl-flex gl-items-center">
<h1 data-testid="code-suggestions-title" class="page-title gl-text-size-h-display">
{{ $options.i18n.codeSuggestionTitle }}
</h1>
<gl-badge variant="tier" icon="license" class="gl-ml-3 gl-px-3 gl-py-2 gl-capitalize">{{
duoTier
}}</gl-badge>
</header>
<page-heading>
<template #heading>
<span class="gl-flex gl-items-center gl-gap-3">
<span data-testid="code-suggestions-title">{{
$options.i18n.codeSuggestionTitle
}}</span>
<gl-badge variant="tier" icon="license" class="gl-capitalize">{{ duoTier }}</gl-badge>
</span>
</template>
<p v-if="isSaaS" data-testid="code-suggestions-subtitle">
{{ saasSubtitle }}
</p>
<p v-else data-testid="code-suggestions-subtitle">
{{ selfManagedSubtitle }}
</p>
</section>
<template #description>
<span v-if="isSaaS" data-testid="code-suggestions-subtitle">
{{ saasSubtitle }}
</span>
<span v-else data-testid="code-suggestions-subtitle">
{{ selfManagedSubtitle }}
</span>
</template>
</page-heading>
<health-check-list v-if="statusCheckEnabled" />
</template>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment