Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@ -1,12 +1,12 @@
|
||||
<template>
|
||||
<form class="mk-signup" @submit.prevent="onSubmit" :autocomplete="Math.random()">
|
||||
<form class="qlvuhzng" @submit.prevent="onSubmit" :autocomplete="Math.random()">
|
||||
<template v-if="meta">
|
||||
<MkInput v-if="meta.disableRegistration" v-model="invitationCode" type="text" :autocomplete="Math.random()" spellcheck="false" required>
|
||||
<MkInput class="_inputNoTopMargin" v-if="meta.disableRegistration" v-model="invitationCode" type="text" :autocomplete="Math.random()" spellcheck="false" required>
|
||||
<template #label>{{ $ts.invitationCode }}</template>
|
||||
<template #prefix><i class="fas fa-key"></i></template>
|
||||
</MkInput>
|
||||
<MkInput v-model="username" type="text" pattern="^[a-zA-Z0-9_]{1,20}$" :autocomplete="Math.random()" spellcheck="false" required @update:modelValue="onChangeUsername" data-cy-signup-username>
|
||||
<template #label>{{ $ts.username }}</template>
|
||||
<MkInput class="_inputNoTopMargin" v-model="username" type="text" pattern="^[a-zA-Z0-9_]{1,20}$" :autocomplete="Math.random()" spellcheck="false" required @update:modelValue="onChangeUsername" data-cy-signup-username>
|
||||
<template #label>{{ $ts.username }} <div class="_button _help" v-tooltip:dialog="$ts.usernameInfo"><i class="far fa-question-circle"></i></div></template>
|
||||
<template #prefix>@</template>
|
||||
<template #suffix>@{{ host }}</template>
|
||||
<template #caption>
|
||||
@ -205,7 +205,7 @@ export default defineComponent({
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.mk-signup {
|
||||
.qlvuhzng {
|
||||
.captcha {
|
||||
margin: 16px 0;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Directive, ref } from 'vue';
|
||||
import { isDeviceTouch } from '@client/scripts/is-device-touch';
|
||||
import { popup } from '@client/os';
|
||||
import { popup, dialog } from '@client/os';
|
||||
|
||||
const start = isDeviceTouch ? 'touchstart' : 'mouseover';
|
||||
const end = isDeviceTouch ? 'touchend' : 'mouseleave';
|
||||
@ -24,6 +24,18 @@ export default {
|
||||
}
|
||||
};
|
||||
|
||||
if (binding.arg === 'dialog') {
|
||||
el.addEventListener('click', (ev) => {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
dialog({
|
||||
type: 'info',
|
||||
text: binding.value,
|
||||
});
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
const show = e => {
|
||||
if (!document.body.contains(el)) return;
|
||||
if (self._close) return;
|
||||
|
@ -101,15 +101,12 @@ window.addEventListener('resize', () => {
|
||||
});
|
||||
//#endregion
|
||||
|
||||
// Get the <head> element
|
||||
const head = document.getElementsByTagName('head')[0];
|
||||
|
||||
// If mobile, insert the viewport meta tag
|
||||
if (isMobile || window.innerWidth <= 1024) {
|
||||
const viewport = document.getElementsByName('viewport').item(0);
|
||||
viewport.setAttribute('content',
|
||||
`${viewport.getAttribute('content')},minimum-scale=1,maximum-scale=1,user-scalable=no`);
|
||||
head.appendChild(viewport);
|
||||
document.head.appendChild(viewport);
|
||||
}
|
||||
|
||||
//#region Set lang attr
|
||||
|
@ -214,7 +214,11 @@ export function modalPageWindow(path: string) {
|
||||
}, {}, 'closed');
|
||||
}
|
||||
|
||||
export function dialog(props: Record<string, any>) {
|
||||
export function dialog(props: {
|
||||
type: 'error' | 'info' | 'success' | 'warning' | 'waiting';
|
||||
title?: string | null;
|
||||
text?: string | null;
|
||||
}) {
|
||||
return new Promise((resolve, reject) => {
|
||||
popup(import('@client/components/dialog.vue'), props, {
|
||||
done: result => {
|
||||
|
@ -60,7 +60,7 @@ import FormBase from '@client/components/form/base.vue';
|
||||
import FormGroup from '@client/components/form/group.vue';
|
||||
import FormKeyValueView from '@client/components/form/key-value-view.vue';
|
||||
import MkLink from '@client/components/link.vue';
|
||||
import { physics } from '@client/scripts/physics.ts';
|
||||
import { physics } from '@client/scripts/physics';
|
||||
import * as symbols from '@client/symbols';
|
||||
|
||||
const patrons = [
|
||||
|
@ -12,6 +12,9 @@
|
||||
<template #prefix><i class="fas fa-key"></i></template>
|
||||
DeepL Auth Key
|
||||
</FormInput>
|
||||
<FormSwitch v-model:value="deeplIsPro">
|
||||
Pro account
|
||||
</FormSwitch>
|
||||
</FormGroup>
|
||||
<FormButton @click="save" primary><i class="fas fa-save"></i> {{ $ts.save }}</FormButton>
|
||||
</FormSuspense>
|
||||
@ -50,6 +53,7 @@ export default defineComponent({
|
||||
},
|
||||
summalyProxy: '',
|
||||
deeplAuthKey: '',
|
||||
deeplIsPro: false,
|
||||
}
|
||||
},
|
||||
|
||||
@ -62,11 +66,13 @@ export default defineComponent({
|
||||
const meta = await os.api('meta', { detail: true });
|
||||
this.summalyProxy = meta.summalyProxy;
|
||||
this.deeplAuthKey = meta.deeplAuthKey;
|
||||
this.deeplIsPro = meta.deeplIsPro;
|
||||
},
|
||||
save() {
|
||||
os.apiWithDialog('admin/update-meta', {
|
||||
summalyProxy: this.summalyProxy,
|
||||
deeplAuthKey: this.deeplAuthKey,
|
||||
deeplIsPro: this.deeplIsPro,
|
||||
}).then(() => {
|
||||
fetchInstance();
|
||||
});
|
||||
|
@ -156,8 +156,10 @@ hr {
|
||||
|
||||
._button {
|
||||
appearance: none;
|
||||
display: inline-block;
|
||||
padding: 0;
|
||||
margin: 0; // for Safari
|
||||
width: max-content;
|
||||
background: none;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
@ -201,6 +203,11 @@ hr {
|
||||
}
|
||||
}
|
||||
|
||||
._help {
|
||||
color: var(--accent);
|
||||
cursor: help
|
||||
}
|
||||
|
||||
._textButton {
|
||||
@extend ._button;
|
||||
color: var(--accent);
|
||||
|
Reference in New Issue
Block a user