2023-07-27 05:31:52 +00:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2020-01-29 19:37:25 +00:00
|
|
|
<template>
|
2023-01-06 00:41:14 +00:00
|
|
|
<MkModalWindow
|
2022-07-20 13:24:26 +00:00
|
|
|
ref="dialog"
|
2020-10-17 11:12:00 +00:00
|
|
|
:width="370"
|
|
|
|
:height="400"
|
2022-05-19 11:28:08 +00:00
|
|
|
@close="onClose"
|
2022-01-15 21:59:35 +00:00
|
|
|
@closed="emit('closed')"
|
2020-10-17 11:12:00 +00:00
|
|
|
>
|
2022-07-20 13:24:26 +00:00
|
|
|
<template #header>{{ i18n.ts.login }}</template>
|
2020-10-17 11:12:00 +00:00
|
|
|
|
2023-05-19 04:58:09 +00:00
|
|
|
<MkSpacer :marginMin="20" :marginMax="28">
|
|
|
|
<MkSignin :autoSet="autoSet" :message="message" @login="onLogin"/>
|
2023-01-06 00:41:14 +00:00
|
|
|
</MkSpacer>
|
|
|
|
</MkModalWindow>
|
2020-01-29 19:37:25 +00:00
|
|
|
</template>
|
|
|
|
|
2022-01-15 21:59:35 +00:00
|
|
|
<script lang="ts" setup>
|
2023-12-07 05:42:09 +00:00
|
|
|
import { shallowRef } from 'vue';
|
2022-08-30 15:24:33 +00:00
|
|
|
import MkSignin from '@/components/MkSignin.vue';
|
2023-01-06 00:41:14 +00:00
|
|
|
import MkModalWindow from '@/components/MkModalWindow.vue';
|
2023-09-19 07:37:43 +00:00
|
|
|
import { i18n } from '@/i18n.js';
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2023-03-09 05:27:16 +00:00
|
|
|
withDefaults(defineProps<{
|
2022-01-15 21:59:35 +00:00
|
|
|
autoSet?: boolean;
|
2022-05-19 11:28:08 +00:00
|
|
|
message?: string,
|
2022-01-15 21:59:35 +00:00
|
|
|
}>(), {
|
|
|
|
autoSet: false,
|
2022-07-20 13:24:26 +00:00
|
|
|
message: '',
|
2022-01-15 21:59:35 +00:00
|
|
|
});
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2022-01-15 21:59:35 +00:00
|
|
|
const emit = defineEmits<{
|
2023-03-09 05:27:16 +00:00
|
|
|
(ev: 'done', v: any): void;
|
2022-05-19 11:28:08 +00:00
|
|
|
(ev: 'closed'): void;
|
|
|
|
(ev: 'cancelled'): void;
|
2022-01-15 21:59:35 +00:00
|
|
|
}>();
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2023-12-07 05:42:09 +00:00
|
|
|
const dialog = shallowRef<InstanceType<typeof MkModalWindow>>();
|
2020-10-17 11:12:00 +00:00
|
|
|
|
2022-05-19 11:28:08 +00:00
|
|
|
function onClose() {
|
|
|
|
emit('cancelled');
|
2023-12-07 05:42:09 +00:00
|
|
|
if (dialog.value) dialog.value.close();
|
2022-05-19 11:28:08 +00:00
|
|
|
}
|
|
|
|
|
2022-01-15 21:59:35 +00:00
|
|
|
function onLogin(res) {
|
|
|
|
emit('done', res);
|
2023-12-07 05:42:09 +00:00
|
|
|
if (dialog.value) dialog.value.close();
|
2022-01-15 21:59:35 +00:00
|
|
|
}
|
2020-01-29 19:37:25 +00:00
|
|
|
</script>
|