-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add ui for self reset amidaware/tacticalrmm#1378
- Loading branch information
Showing
3 changed files
with
145 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<template> | ||
<q-dialog ref="dialogRef" @hide="onDialogHide"> | ||
<q-card class="q-dialog-plugin" style="width: 60vw"> | ||
<q-card-section class="row"> | ||
<div class="col-3">New password:</div> | ||
<div class="col-9"> | ||
<q-input | ||
outlined | ||
dense | ||
v-model="pass" | ||
:type="isPwd ? 'password' : 'text'" | ||
:rules="[(val) => !!val || '*Required']" | ||
> | ||
<template v-slot:append> | ||
<q-icon | ||
:name="isPwd ? 'visibility_off' : 'visibility'" | ||
class="cursor-pointer" | ||
@click="isPwd = !isPwd" | ||
/> | ||
</template> | ||
</q-input> | ||
</div> | ||
<div class="col-3">Confirm password:</div> | ||
<div class="col-9"> | ||
<q-input | ||
outlined | ||
dense | ||
v-model="pass2" | ||
:type="isPwd ? 'password' : 'text'" | ||
:rules="[(val) => val === pass || 'Passwords do not match']" | ||
> | ||
<template v-slot:append> | ||
<q-icon | ||
:name="isPwd ? 'visibility_off' : 'visibility'" | ||
class="cursor-pointer" | ||
@click="isPwd = !isPwd" | ||
/> | ||
</template> | ||
</q-input> | ||
</div> | ||
</q-card-section> | ||
<q-card-actions align="right"> | ||
<q-btn | ||
color="primary" | ||
label="Reset" | ||
@click="onOKClick" | ||
:disable="!pass || pass !== pass2" | ||
/> | ||
<q-btn color="negative" label="Cancel" @click="onDialogCancel" /> | ||
</q-card-actions> | ||
</q-card> | ||
</q-dialog> | ||
</template> | ||
|
||
<script setup> | ||
import { ref } from "vue"; | ||
import { useDialogPluginComponent } from "quasar"; | ||
import { resetPass } from "@/api/accounts"; | ||
import { notifySuccess } from "@/utils/notify"; | ||
const pass = ref(""); | ||
const pass2 = ref(""); | ||
const isPwd = ref(true); | ||
defineEmits([...useDialogPluginComponent.emits]); | ||
const { dialogRef, onDialogHide, onDialogOK, onDialogCancel } = | ||
useDialogPluginComponent(); | ||
async function onOKClick() { | ||
const ret = await resetPass(pass.value); | ||
notifySuccess(ret); | ||
onDialogOK(); | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters