Ngiler SH3LL 360
Home
Information
Create File
Create Folder
:
/
home
/
tbf
/
tbfguest.tbf.ro
/
src
/
views
/
public
/
Information Server
MySQL :
OFF
Perl :
OFF
CURL :
ON
WGET :
OFF
PKEXEC :
OFF
Directive
Local Value
IP Address
89.40.16.97
System
Linux server.atelieruldeit.ro 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64
User
tbf
PHP Version
7.3.33
Software
Apache
Doc root
Writable
close
Edit File :
Users.vue
| Size :
11.25
KB
Copy
<template> <Transition enter-active-class="ease-out duration-500" enter-from-class="opacity-0" enter-to-class="opacity-100" leave-active-class="ease-in duration-200" leave-from-class="opacity-100" leave-to-class="opacity-0"> <div v-if="loaded" class="min-h-screen flex flex-col"> <div class="px-16 pt-12 pb-10"> <div class="sm:flex sm:items-center justify-between"> <div class="sm:flex-auto"> <h1 class="text-base font-semibold leading-6 text-gray-900">Utilizatori</h1> <p class="mt-2 text-sm text-gray-700">Mai jos găsești lista cu toți utilizatorii care au acces la TBF AI</p> </div> <div class="relative"> <button @click="openTutorial" class="p-2 bg-blue-500 hover:bg-blue-400 rounded-full text-white"> <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6"> <path stroke-linecap="round" stroke-linejoin="round" d="M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z" /> </svg> </button> <transition enter-active-class="transition-all ease-out duration-150 origin-top" enter-from-class="opacity-0 scale-75" enter-to-class="opacity-100 scale-105" leave-active-class="transition-all ease-in duration-75 origin-top" leave-from-class="opacity-100 scale-105" leave-to-class="opacity-0 scale-75"> <div v-if="tutorialPopover" class="absolute top-[100%] scal translate-y-3 -right-5 w-[15rem] p-4 rounded-lg text-sm text-center text-white bg-blue-400 shadow-sm transition-all duration-150 z-20"> <div class="relative"> <div class="w-3 h-3 bg-blue-400 absolute -top-5 right-[1.1rem] rotate-45"></div> </div> <div class="p-3 bg-white/20 text-white rounded-full inline-block"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-6 h-6"> <path fill-rule="evenodd" d="M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z" clip-rule="evenodd" /> </svg> </div> <h3 class="mt-2 font-semibold text-base text-center">Atenție</h3> <p class="mt-2 text-center">Urmărește acest video cu instrucțiuni înainte să completezi pagina</p> <button @click="openTutorial" type="button" class="mt-5 mb-0.5 w-full text-center rounded-full px-7 py-2 text-sm font-semibold focus-visible:outline-none bg-white text-blue-500 hover:text-blue-400"> Vezi video </button> </div> </transition> </div> </div> <div class="mt-8 flow-root"> <div class="-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8"> <div class="inline-block min-w-full py-2 align-middle sm:px-6 lg:px-8"> <table class="min-w-full divide-y divide-gray-300"> <thead> <tr> <th scope="col" class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-0">Nume ({{ people.length }})</th> <th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">Poziție</th> <th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">Status</th> <th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-0"> <span class="sr-only">Acțiuni</span> </th> </tr> </thead> <tbody class="divide-y divide-gray-200 bg-white"> <tr v-for="person in people" :key="person.id" class="hover:bg-gray-50"> <td class="whitespace-nowrap py-5 pl-4 pr-3 text-sm"> <div class="flex items-center"> <div class="h-11 w-11 flex-shrink-0"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-11 h-11 text-gray-300"> <path fill-rule="evenodd" d="M18.685 19.097A9.723 9.723 0 0021.75 12c0-5.385-4.365-9.75-9.75-9.75S2.25 6.615 2.25 12a9.723 9.723 0 003.065 7.097A9.716 9.716 0 0012 21.75a9.716 9.716 0 006.685-2.653zm-12.54-1.285A7.486 7.486 0 0112 15a7.486 7.486 0 015.855 2.812A8.224 8.224 0 0112 20.25a8.224 8.224 0 01-5.855-2.438zM15.75 9a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z" clip-rule="evenodd" /> </svg> </div> <div class="ml-4"> <div class="font-medium text-gray-900">{{ person.first_name }}</div> <div class="mt-1 text-gray-500">{{ person.email }}</div> </div> </div> </td> <td class="whitespace-nowrap px-3 py-5 text-sm text-gray-500 flex items-center"> <div v-if="person.positions.length"> <div class="text-gray-900">{{ person.positions[0].name }}</div> <div class="mt-1 text-gray-500">{{ person.positions[0].is_responsible ? "Verificare" : "Documentare" }}</div> </div> <div class="ml-3 rounded-md bg-gray-50 px-2 py-1 ring-1 ring-inset ring-gray-600/20 cursor-default text-xs" v-if="person.positions.length > 1"> <Popper hover :openDelay="500" offsetDistance="5" placement="bottom"> <span class="text-xs"> + {{ person.positions.length - 1 }} </span> <template #content> <div class="bg-gray-900 shadow-sm rounded-lg p-2 whitespace-normal max-w-[10rem] text-center"> <div class="position text-left mb-2 last:mb-0" v-for="position in [...person.positions].slice(1)"> <p class="text-xs font-medium text-white">{{ position.name }}</p> <p class="text-xs text-white/80">{{ position.is_responsible ? "Verificare" : "Documentare" }}</p> </div> </div> </template> </Popper> </div> </td> <td class="whitespace-nowrap px-3 py-5 text-sm text-gray-500"> <Popper v-if="!person.invitation_url" hover :openDelay="500" offsetDistance="5" placement="bottom"> <span class="inline-flex items-center rounded-md bg-green-50 px-2 py-1 text-xs font-medium text-green-700 ring-1 ring-inset ring-green-600/20 cursor-default"> Activ </span> <template #content> <div class="bg-gray-900 shadow-sm rounded-lg p-2 whitespace-normal max-w-[10rem] text-center"> <p class="text-xs text-white">Utilizatorul este activ</p> </div> </template> </Popper> <Popper v-else hover :openDelay="500" offsetDistance="5" placement="bottom"> <span class="inline-flex items-center rounded-md bg-gray-50 px-2 py-1 text-xs font-medium text-gray-700 ring-1 ring-inset ring-gray-600/20 cursor-default"> Inactiv </span> <template #content> <div class="bg-gray-900 shadow-sm rounded-lg p-2 whitespace-normal max-w-[10rem] text-center"> <p class="text-xs text-white">Utilizatorul nu a stabilit parolă și nu s-a logat</p> </div> </template> </Popper> </td> <td class="relative py-5 pl-3 pr-4 text-right text-sm font-medium flex flex-col gap-1 items-end"> <button @click="showLinkInvitation(person)" type="button" class="text-blue-500 font-medium hover:text-blue-600 disabled:text-gray-400 disabled:cursor-not-allowed" :disabled="person.invitation_url ? false : true"> <Popper hover :openDelay="500" offsetDistance="5" placement="bottom" :disabled="person.invitation_url ? true : false"> <span> Link invitație<span class="sr-only">, {{ person.first_name }}</span> </span> <template #content> <div class="bg-gray-900 shadow-sm rounded-lg p-2 whitespace-normal max-w-[10rem] text-center"> <p class="text-xs text-white">Contul este activat</p> </div> </template> </Popper> </button> <button @click="resetPassword(person)" type="button" class="text-blue-500 font-medium hover:text-blue-600 disabled:text-gray-400 disabled:cursor-not-allowed" :disabled="person.invitation_url ? true : false"> <Popper hover :openDelay="500" offsetDistance="5" placement="bottom" :disabled="person.invitation_url ? false : true"> <span> Link resetare parola <span class="sr-only">, {{ person.first_name }}</span> </span> <template #content> <div class="bg-gray-900 shadow-sm rounded-lg p-2 whitespace-normal max-w-[10rem] text-center"> <p class="text-xs text-white">Contul este inactiv. Contul se activează prin intermediul linkului de invitație.</p> </div> </template> </Popper> </button> </td> </tr> </tbody> </table> </div> </div> </div> </div> </div> </Transition> </template> <script> import { useModalsStore } from "@/stores/modals.js"; import { useCookies } from "vue3-cookies"; import { userNotificationsStore } from "@/stores/notifications.js"; export default { setup() { const { cookies } = useCookies(); return { cookies }; }, components: {}, data() { return { tutorialPopover: false, realTimeModals: useModalsStore(), realTimeNotifications: userNotificationsStore(), loaded: false, people: [], }; }, async mounted() { await this.getUsers(); var cookieModalVimeoData = this.cookies.get("modal_vimeo"); if (!(cookieModalVimeoData && JSON.parse(cookieModalVimeoData).includes("users_index"))) { setTimeout(() => { this.tutorialPopover = true; }, 1000); } }, methods: { async getUsers() { await axios .get(`/instances/${this.$auth.user().instance.id}/users`) .then(({ data }) => { this.people = data.data; }) .catch((error) => { var responseError = error.response.data; this.realTimeNotifications.addNotification({ type: "error", title: "TBF ERROR", description: `"${responseError.message}"<br>Vă rugăm să ne contactați și să ne transmiteți eroare. În interesul remedierii acestei probleme cât mai curând posibil.`, }); }) .finally(() => { this.loaded = true; }); }, openTutorial() { var arrayPages = this.cookies.get("modal_vimeo") ? JSON.parse(this.cookies.get("modal_vimeo")) : []; if (!arrayPages.includes("users_index")) { arrayPages.push("users_index"); this.cookies.set("modal_vimeo", JSON.stringify(arrayPages), "30d"); } this.tutorialPopover = false; this.realTimeModals.toggleShowModal("modal_video_vimeo", { videoId: "870604114" }); }, resetPassword(user) { this.realTimeModals.toggleShowModal("modal_reset_password", { id: user.id, first_name: user.first_name, email: user.email }); }, showLinkInvitation(user) { this.realTimeModals.toggleShowModal("modal_link_invitation", { id: user.id, first_name: user.first_name, email: user.email, invitation_link: user.invitation_url }); }, }, }; </script>
Back