Ngiler SH3LL 360
Home
Information
Create File
Create Folder
:
/
home
/
tbf
/
tbfguest.tbf.ro
/
src
/
components
/
public
/
users
/
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 :
ModalResetPassword.vue
| Size :
5.56
KB
Copy
<template> <div class="fixed inset-0 z-10 w-screen overflow-y-auto"> <div class="flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0"> <TransitionChild as="template" enter="ease-out duration-300" enter-from="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95" enter-to="opacity-100 translate-y-0 sm:scale-100" leave="ease-in duration-200" leave-from="opacity-100 translate-y-0 sm:scale-100" leave-to="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"> <DialogPanel class="relative transform overflow-hidden rounded-lg bg-white px-4 pb-4 pt-5 text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg sm:p-6"> <div class="mt-3 text-center sm:mt-5"> <DialogTitle as="h3" class="text-base font-semibold leading-6 text-gray-900">Resetare parola</DialogTitle> <div class="mt-2"> <p class="text-sm text-gray-500"> Ai solicitat resetarea parolei pentru utilizatorul <span class="font-semibold">{{ realTimeModals.dataModal.first_name }}</span> cu adresa de e-mail <span class="font-semibold">{{ realTimeModals.dataModal.email }}</span> </p> </div> </div> <div class="mt-6"> <label class="block text-sm font-semibold leading-6 text-gray-900"> Link pentru resetarea parolei <Popper hover :openDelay="200" offsetDistance="10" placement="right"> <span class="text-gray-400">(?)</span> <template #content> <div role="tooltip" class="bg-gray-900 shadow-sm ring-1 ring-gray-900/5 rounded-lg px-4 py-3 text-white text-xs relative max-w-[15rem]"> <div class="w-3 h-3 bg-gray-900 absolute top-[50%] -translate-y-[50%] -left-1 rotate-45"></div> <p>Copiază link-ul și trimite-l colegului tău pentru a-i permite să-și reseteze parola.</p> </div> </template> </Popper> </label> <div class="mt-2 relative"> <input type="text" v-model="reset_password_link" readonly id="divToCopy" autocomplete="new-password-link" class="block w-full rounded-md border-0 py-1.5 ring-1 ring-inset focus:ring-2 focus:ring-inset sm:text-sm sm:leading-6 text-gray-900 ring-gray-300 placeholder:text-gray-400 focus:ring-blue-500" placeholder="" :disabled="!loaded" @click="copyToClipboard" /> <div class="absolute top-0 left-0 w-full rounded-lg h-full flex items-center justify-start px-5 bg-white/50 z-50" v-if="!loaded"> <LoaderTbf color="text-blue-500" /> </div> </div> </div> <div class="mt-5 sm:mt-6 sm:grid sm:grid-flow-row-dense sm:grid-cols-2 sm:gap-3"> <button :disabled="!loaded" type="button" class="w-full sm:col-start-2 rounded-md inline-flex items-center justify-center px-3 py-2 text-sm font-semibold shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500 bg-blue-500 text-white hover:bg-blue-400 disabled:cursor-not-allowed disabled:bg-blue-400" @click="copyToClipboard"> Copiază </button> <button type="button" class="mt-3 w-full rounded-md inline-flex items-center justify-center px-3 py-2 text-sm font-semibold shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500 bg-white border-gray-300 text-gray-900 hover:bg-gray-50 border sm:col-start-1 sm:mt-0" @click="closeModal"> Închide </button> </div> </DialogPanel> </TransitionChild> </div> </div> </template> <script> // Import the required components import { DialogPanel, DialogTitle, TransitionChild } from "@headlessui/vue"; import { useModalsStore } from "@/stores/modals.js"; import { userNotificationsStore } from "@/stores/notifications.js"; import LoaderTbf from "@/components/public/LoadingTbf.vue"; export default { components: { DialogPanel, DialogTitle, TransitionChild, LoaderTbf, }, data() { return { realTimeModals: useModalsStore(), realTimeNotifications: userNotificationsStore(), loadingSubmit: false, reset_password_link: "", loaded: false, }; }, async mounted() { await this.getResetPasswordLink(); }, methods: { closeModal() { this.realTimeModals.closeModal(); }, async getResetPasswordLink() { await axios .get(`auth/reset-password-link/${this.realTimeModals.dataModal.id}`) .then(({ data }) => { this.reset_password_link = data.reset_link; }) .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; }); }, async copyToClipboard() { try { var copyText = document.getElementById("divToCopy"); copyText.select(); copyText.setSelectionRange(0, 99999); document.execCommand("copy"); this.realTimeNotifications.addNotification({ type: "success", title: "Succes!", description: `Link-ul a fost salvat în clipboard.`, }); } catch (err) { try { await navigator.clipboard.writeText(this.reset_password_link); } catch (err) { this.realTimeNotifications.addNotification({ type: "error", title: "Oops!", description: `A apărut o problemă. Link-ul nu a fost copiat. Te rugăm să încerci manual.`, }); } } }, }, }; </script>
Back