mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 14:33:33 -07:00
Added copy icons to first-login message
Also inputs the email/password when clicked.
This commit is contained in:
parent
6b98a7cd74
commit
719409580a
2 changed files with 25 additions and 1 deletions
|
@ -86,6 +86,7 @@ import {
|
|||
mdiLogout,
|
||||
mdiContentCopy,
|
||||
mdiClipboardCheck,
|
||||
mdiClipboard,
|
||||
mdiCloudUpload,
|
||||
mdiDatabase,
|
||||
mdiGithub,
|
||||
|
@ -191,6 +192,7 @@ export const icons = {
|
|||
checkboxMarkedCircle: mdiCheckboxMarkedCircle,
|
||||
chefHat: mdiChefHat,
|
||||
clipboardCheck: mdiClipboardCheck,
|
||||
clipboard: mdiClipboard,
|
||||
clockOutline: mdiClockTimeFourOutline,
|
||||
codeBraces: mdiCodeJson,
|
||||
codeJson: mdiCodeJson,
|
||||
|
@ -322,5 +324,4 @@ export const icons = {
|
|||
preserveLines: mdiText,
|
||||
preserveBlocks: mdiTextBoxOutline,
|
||||
flatten: mdiMinus,
|
||||
|
||||
};
|
||||
|
|
|
@ -19,9 +19,15 @@
|
|||
</p>
|
||||
<p class="mb-1">
|
||||
<strong>{{ $t('user.username') }}:</strong> changeme@example.com
|
||||
<v-icon start size="smaller" @click="copy('email')">
|
||||
{{ $globals.icons.clipboard }}
|
||||
</v-icon>
|
||||
</p>
|
||||
<p class="mb-3">
|
||||
<strong>{{ $t('user.password') }}:</strong> MyPassword
|
||||
<v-icon start size="smaller" @click="copy('password')">
|
||||
{{ $globals.icons.clipboard }}
|
||||
</v-icon>
|
||||
</p>
|
||||
<p>
|
||||
{{ $t('user.dont-want-to-see-this-anymore-be-sure-to-change-your-email') }}
|
||||
|
@ -325,6 +331,22 @@ export default defineNuxtComponent({
|
|||
}
|
||||
}
|
||||
|
||||
async function copy(thingToCopy: "email" | "password") {
|
||||
try {
|
||||
if (thingToCopy === "email") {
|
||||
await navigator.clipboard.writeText("changeme@example.com");
|
||||
form.email = "changeme@example.com";
|
||||
}
|
||||
else {
|
||||
await navigator.clipboard.writeText("MyPassword");
|
||||
form.password = "MyPassword";
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
};
|
||||
|
||||
async function authenticate() {
|
||||
if (form.email.length === 0 || form.password.length === 0) {
|
||||
alert.error(i18n.t("user.please-enter-your-email-and-password"));
|
||||
|
@ -376,6 +398,7 @@ export default defineNuxtComponent({
|
|||
oidcProviderName,
|
||||
oidcLoggingIn,
|
||||
passwordIcon,
|
||||
copy,
|
||||
inputType,
|
||||
togglePasswordShow,
|
||||
isFirstLogin,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue