| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <template>
- <div>
- <div class="explanation">
- <div class="px-6 d-flex flex-row align-center">
- <v-icon class="theme-primary">fa fa-info</v-icon>
- </div>
- <div class="px-2">
- {{ $t('super_admin_explanation_text') }}
- </div>
- </div>
- <UiLoadingPanel v-if="pending" />
- <UiForm
- v-else-if="adminAccess"
- ref="form"
- :model="AdminAccess"
- :entity="adminAccess"
- class="w-100"
- action-position="bottom"
- >
- <v-table class="mb-4">
- <tbody>
- <tr>
- <td>{{ $t('username') }} :</td>
- <td>{{ adminAccess.username }}</td>
- </tr>
- </tbody>
- </v-table>
- <UiInputText
- v-model="adminAccess.email"
- field="email"
- :rules="rules()"
- class="mx-4"
- variant="underlined"
- />
- </UiForm>
- <span v-else>{{ $t('no_admin_access_recorded') }}</span>
- </div>
- </template>
- <script setup lang="ts">
- import { useEntityFetch } from '~/composables/data/useEntityFetch'
- import { useAccessProfileStore } from '~/stores/accessProfile'
- import AdminAccess from '~/models/Access/AdminAccess'
- import { useValidationUtils } from '~/composables/utils/useValidationUtils'
- const { fetch } = useEntityFetch()
- const accessProfile = useAccessProfileStore()
- if (accessProfile.id === null) {
- throw new Error('Missing access profile id')
- }
- const { data: adminAccess, pending } = fetch(AdminAccess, accessProfile.id)
- const i18n = useI18n()
- const validationUtils = useValidationUtils()
- const rules = () => [
- (email: string | null) =>
- (email && validationUtils.validEmail(email)) || i18n.t('email_error'),
- ]
- </script>
- <style scoped lang="scss">
- .explanation {
- display: flex;
- flex-direction: row;
- padding: 60px 26px;
- text-align: justify;
- color: rgb(var(--v-theme-neutral-strong));
- .v-icon {
- background-color: rgb(var(--v-theme-primary));
- font-size: 22px;
- border-radius: 16px;
- margin: 3px;
- padding: 3px;
- height: 28px;
- width: 28px;
- }
- div:first-child {
- border-right: solid 1px rgb(var(--v-theme-primary));
- }
- }
- .v-table td:first-child {
- width: 180px;
- }
- </style>
|