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,
|
mdiLogout,
|
||||||
mdiContentCopy,
|
mdiContentCopy,
|
||||||
mdiClipboardCheck,
|
mdiClipboardCheck,
|
||||||
|
mdiClipboard,
|
||||||
mdiCloudUpload,
|
mdiCloudUpload,
|
||||||
mdiDatabase,
|
mdiDatabase,
|
||||||
mdiGithub,
|
mdiGithub,
|
||||||
|
@ -191,6 +192,7 @@ export const icons = {
|
||||||
checkboxMarkedCircle: mdiCheckboxMarkedCircle,
|
checkboxMarkedCircle: mdiCheckboxMarkedCircle,
|
||||||
chefHat: mdiChefHat,
|
chefHat: mdiChefHat,
|
||||||
clipboardCheck: mdiClipboardCheck,
|
clipboardCheck: mdiClipboardCheck,
|
||||||
|
clipboard: mdiClipboard,
|
||||||
clockOutline: mdiClockTimeFourOutline,
|
clockOutline: mdiClockTimeFourOutline,
|
||||||
codeBraces: mdiCodeJson,
|
codeBraces: mdiCodeJson,
|
||||||
codeJson: mdiCodeJson,
|
codeJson: mdiCodeJson,
|
||||||
|
@ -322,5 +324,4 @@ export const icons = {
|
||||||
preserveLines: mdiText,
|
preserveLines: mdiText,
|
||||||
preserveBlocks: mdiTextBoxOutline,
|
preserveBlocks: mdiTextBoxOutline,
|
||||||
flatten: mdiMinus,
|
flatten: mdiMinus,
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -19,9 +19,15 @@
|
||||||
</p>
|
</p>
|
||||||
<p class="mb-1">
|
<p class="mb-1">
|
||||||
<strong>{{ $t('user.username') }}:</strong> changeme@example.com
|
<strong>{{ $t('user.username') }}:</strong> changeme@example.com
|
||||||
|
<v-icon start size="smaller" @click="copy('email')">
|
||||||
|
{{ $globals.icons.clipboard }}
|
||||||
|
</v-icon>
|
||||||
</p>
|
</p>
|
||||||
<p class="mb-3">
|
<p class="mb-3">
|
||||||
<strong>{{ $t('user.password') }}:</strong> MyPassword
|
<strong>{{ $t('user.password') }}:</strong> MyPassword
|
||||||
|
<v-icon start size="smaller" @click="copy('password')">
|
||||||
|
{{ $globals.icons.clipboard }}
|
||||||
|
</v-icon>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
{{ $t('user.dont-want-to-see-this-anymore-be-sure-to-change-your-email') }}
|
{{ $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() {
|
async function authenticate() {
|
||||||
if (form.email.length === 0 || form.password.length === 0) {
|
if (form.email.length === 0 || form.password.length === 0) {
|
||||||
alert.error(i18n.t("user.please-enter-your-email-and-password"));
|
alert.error(i18n.t("user.please-enter-your-email-and-password"));
|
||||||
|
@ -376,6 +398,7 @@ export default defineNuxtComponent({
|
||||||
oidcProviderName,
|
oidcProviderName,
|
||||||
oidcLoggingIn,
|
oidcLoggingIn,
|
||||||
passwordIcon,
|
passwordIcon,
|
||||||
|
copy,
|
||||||
inputType,
|
inputType,
|
||||||
togglePasswordShow,
|
togglePasswordShow,
|
||||||
isFirstLogin,
|
isFirstLogin,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue