ConfiguracoesView.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <script setup>
  2. import { computed } from "vue";
  3. import { useRouter } from "vue-router";
  4. import LayoutSistema from "../../layout/LayoutSistema.vue";
  5. import BotaoAlterarTema from "../../components/BotaoAlterarTema.vue";
  6. import { useAuth } from "../../composables/useAuth.js";
  7. const router = useRouter();
  8. const { user } = useAuth();
  9. const isAdmin = computed(() => String(user.value?.Nivel) === "3");
  10. function irParaUsuarios() {
  11. router.push({ name: "usuarios" });
  12. }
  13. </script>
  14. <template>
  15. <LayoutSistema>
  16. <div
  17. class="min-h-[calc(100vh-var(--layout-header-height))] flex items-start justify-center px-4 pt-8 pb-12"
  18. >
  19. <div class="w-full max-w-[640px] space-y-6">
  20. <section
  21. class="rounded-2xl border border-gray-200 bg-gray-100/50 p-6 shadow-sm backdrop-blur-md dark:border-gray-700 dark:bg-secondary/50"
  22. >
  23. <div class="flex items-center gap-4">
  24. <div
  25. class="flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary dark:bg-primary/20"
  26. >
  27. <svg class="h-5 w-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8">
  28. <path stroke-linecap="round" stroke-linejoin="round" d="M4 21v-7" />
  29. <path stroke-linecap="round" stroke-linejoin="round" d="M4 10V3" />
  30. <path stroke-linecap="round" stroke-linejoin="round" d="M12 21v-9" />
  31. <path stroke-linecap="round" stroke-linejoin="round" d="M12 8V3" />
  32. <path stroke-linecap="round" stroke-linejoin="round" d="M20 21v-5" />
  33. <path stroke-linecap="round" stroke-linejoin="round" d="M20 12V3" />
  34. <path stroke-linecap="round" stroke-linejoin="round" d="M1 14h6" />
  35. <path stroke-linecap="round" stroke-linejoin="round" d="M9 8h6" />
  36. <path stroke-linecap="round" stroke-linejoin="round" d="M17 16h6" />
  37. </svg>
  38. </div>
  39. <div class="min-w-0">
  40. <h2 class="text-base font-semibold text-gray-900 dark:text-gray-100">
  41. Configurações do Sistema
  42. </h2>
  43. <p class="mt-0.5 text-sm text-gray-500 dark:text-gray-400">
  44. Gerencie usuários e preferências da plataforma.
  45. </p>
  46. </div>
  47. </div>
  48. </section>
  49. <section v-if="isAdmin">
  50. <div class="mb-3 text-xs font-semibold uppercase tracking-[0.16em] text-gray-500 dark:text-gray-400">
  51. Usuários & Acesso
  52. </div>
  53. <button
  54. type="button"
  55. class="w-full rounded-2xl border border-gray-200 !bg-none bg-background/70 p-5 text-left shadow-sm dark:border-gray-700 dark:bg-background/20"
  56. @click="irParaUsuarios"
  57. >
  58. <div class="flex items-center justify-between gap-4">
  59. <div class="flex items-center gap-3">
  60. <div class="flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary dark:bg-primary/20">
  61. <svg class="h-5 w-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8">
  62. <path stroke-linecap="round" stroke-linejoin="round" d="M16 19a4 4 0 0 0-8 0" />
  63. <path stroke-linecap="round" stroke-linejoin="round" d="M12 12a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z" />
  64. <path stroke-linecap="round" stroke-linejoin="round" d="M7.5 18.5A3.5 3.5 0 0 0 4 15" />
  65. <path stroke-linecap="round" stroke-linejoin="round" d="M16.5 18.5A3.5 3.5 0 0 1 20 15" />
  66. <path stroke-linecap="round" stroke-linejoin="round" d="M5 12a2.25 2.25 0 1 0 0-4.5A2.25 2.25 0 0 0 5 12Z" />
  67. <path stroke-linecap="round" stroke-linejoin="round" d="M19 12a2.25 2.25 0 1 0 0-4.5A2.25 2.25 0 0 0 19 12Z" />
  68. </svg>
  69. </div>
  70. <div>
  71. <div class="text-sm font-semibold text-gray-900 dark:text-gray-100">Gerenciar Usuários</div>
  72. <div class="text-xs text-gray-500 dark:text-gray-400">Cadastre e gerencie usuários, perfis e níveis de acesso.</div>
  73. </div>
  74. </div>
  75. <span class="inline-flex items-center justify-center rounded-md !p-2 !bg-none !bg-transparent !border-0 !text-current hover:!bg-black/10 dark:hover:!bg-white/10 motion-safe:transition-colors">
  76. <svg class="h-5 w-5 shrink-0 text-gray-400 dark:text-gray-500" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8">
  77. <path stroke-linecap="round" stroke-linejoin="round" d="m9 6 6 6-6 6" />
  78. </svg>
  79. </span>
  80. </div>
  81. </button>
  82. </section>
  83. <section>
  84. <div class="mb-3 text-xs font-semibold uppercase tracking-[0.16em] text-gray-500 dark:text-gray-400">
  85. Aparência
  86. </div>
  87. <div class="w-full rounded-2xl border border-gray-200 bg-background/70 p-5 shadow-sm dark:border-gray-700 dark:bg-background/20">
  88. <div class="flex items-center justify-between gap-4">
  89. <div class="flex items-center gap-3">
  90. <div class="flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary dark:bg-primary/20">
  91. <svg class="h-5 w-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8">
  92. <path stroke-linecap="round" stroke-linejoin="round" d="M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z" />
  93. </svg>
  94. </div>
  95. <div>
  96. <div class="text-sm font-semibold text-gray-900 dark:text-gray-100">Tema</div>
  97. <div class="text-xs text-gray-500 dark:text-gray-400">Alternar entre tema claro e escuro</div>
  98. </div>
  99. </div>
  100. <BotaoAlterarTema />
  101. </div>
  102. </div>
  103. </section>
  104. </div>
  105. </div>
  106. </LayoutSistema>
  107. </template>