super_admin.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <div>
  3. <LayoutParametersSection>
  4. <div class="explanation">
  5. <div class="px-4 d-flex flex-row align-center justify-center py-2">
  6. <v-icon class="theme-info">fa fa-info</v-icon>
  7. </div>
  8. <div class="px-2 d-flex flex-row align-center justify-center">
  9. {{ $t('super_admin_explanation_text') }}
  10. </div>
  11. </div>
  12. <UiLoadingPanel v-if="pending" />
  13. <UiForm
  14. v-else-if="adminAccess"
  15. ref="form"
  16. v-model="adminAccess"
  17. class="w-100"
  18. >
  19. <v-table class="mb-4">
  20. <tbody>
  21. <tr>
  22. <td>{{ $t('username') }} :</td>
  23. <td>
  24. <b>{{ adminAccess.username }}</b>
  25. </td>
  26. </tr>
  27. </tbody>
  28. </v-table>
  29. <UiInputEmail
  30. v-model="adminAccess.email"
  31. field="email"
  32. label="associated_email"
  33. class="mx-4"
  34. />
  35. </UiForm>
  36. <span v-else>{{ $t('no_admin_access_recorded') }}</span>
  37. </LayoutParametersSection>
  38. </div>
  39. </template>
  40. <script setup lang="ts">
  41. import { useEntityFetch } from '~/composables/data/useEntityFetch'
  42. import { useAccessProfileStore } from '~/stores/accessProfile'
  43. import AdminAccess from '~/models/Access/AdminAccess'
  44. definePageMeta({
  45. name: 'parameters_super_admin_page',
  46. })
  47. const { fetch } = useEntityFetch()
  48. const accessProfile = useAccessProfileStore()
  49. if (accessProfile.id === null) {
  50. throw new Error('Missing access profile id')
  51. }
  52. const { data: adminAccess, pending } = fetch(AdminAccess, accessProfile.id)
  53. </script>
  54. <style scoped lang="scss">
  55. .explanation {
  56. display: flex;
  57. flex-direction: row;
  58. margin: 32px;
  59. padding: 8px 4px;
  60. border-radius: 6px;
  61. text-align: justify;
  62. color: rgb(var(--v-theme-info));
  63. border: solid 1px rgb(var(--v-theme-info));
  64. .v-icon {
  65. color: rgb(var(--v-theme-info));
  66. font-size: 22px;
  67. border-radius: 16px;
  68. margin: 3px 1px;
  69. padding: 3px;
  70. height: 28px;
  71. width: 28px;
  72. }
  73. @media (max-width: 600px) {
  74. flex-direction: column;
  75. justify-content: center;
  76. }
  77. }
  78. .v-table td:first-child {
  79. width: 180px;
  80. }
  81. </style>