wip
This commit is contained in:
parent
3757daa562
commit
202b440d50
|
@ -1022,10 +1022,6 @@ export interface Locale extends ILocale {
|
||||||
* これ以上ピン留めできません
|
* これ以上ピン留めできません
|
||||||
*/
|
*/
|
||||||
"pinLimitExceeded": string;
|
"pinLimitExceeded": string;
|
||||||
/**
|
|
||||||
* Misskeyのインストールが完了しました!管理者アカウントを作成しましょう。
|
|
||||||
*/
|
|
||||||
"intro": string;
|
|
||||||
/**
|
/**
|
||||||
* 完了
|
* 完了
|
||||||
*/
|
*/
|
||||||
|
@ -11616,6 +11612,20 @@ export interface Locale extends ILocale {
|
||||||
*/
|
*/
|
||||||
"serverHostPlaceholder": string;
|
"serverHostPlaceholder": string;
|
||||||
};
|
};
|
||||||
|
"_serverSetupWizard": {
|
||||||
|
/**
|
||||||
|
* Misskeyのインストールが完了しました!
|
||||||
|
*/
|
||||||
|
"installCompleted": string;
|
||||||
|
/**
|
||||||
|
* まずは、管理者アカウントを作成しましょう。
|
||||||
|
*/
|
||||||
|
"firstCreateAccount": string;
|
||||||
|
/**
|
||||||
|
* 管理者アカウントが作成されました!
|
||||||
|
*/
|
||||||
|
"accountCreated": string;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
declare const locales: {
|
declare const locales: {
|
||||||
[lang: string]: Locale;
|
[lang: string]: Locale;
|
||||||
|
|
|
@ -251,7 +251,6 @@ noUsers: "ユーザーはいません"
|
||||||
editProfile: "プロフィールを編集"
|
editProfile: "プロフィールを編集"
|
||||||
noteDeleteConfirm: "このノートを削除しますか?"
|
noteDeleteConfirm: "このノートを削除しますか?"
|
||||||
pinLimitExceeded: "これ以上ピン留めできません"
|
pinLimitExceeded: "これ以上ピン留めできません"
|
||||||
intro: "Misskeyのインストールが完了しました!管理者アカウントを作成しましょう。"
|
|
||||||
done: "完了"
|
done: "完了"
|
||||||
processing: "処理中"
|
processing: "処理中"
|
||||||
preview: "プレビュー"
|
preview: "プレビュー"
|
||||||
|
@ -3106,3 +3105,8 @@ _search:
|
||||||
pleaseEnterServerHost: "サーバーのホストを入力してください"
|
pleaseEnterServerHost: "サーバーのホストを入力してください"
|
||||||
pleaseSelectUser: "ユーザーを選択してください"
|
pleaseSelectUser: "ユーザーを選択してください"
|
||||||
serverHostPlaceholder: "例: misskey.example.com"
|
serverHostPlaceholder: "例: misskey.example.com"
|
||||||
|
|
||||||
|
_serverSetupWizard:
|
||||||
|
installCompleted: "Misskeyのインストールが完了しました!"
|
||||||
|
firstCreateAccount: "まずは、管理者アカウントを作成しましょう。"
|
||||||
|
accountCreated: "管理者アカウントが作成されました!"
|
||||||
|
|
|
@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<template>
|
<template>
|
||||||
<PageWithAnimBg>
|
<PageWithAnimBg>
|
||||||
<div :class="$style.formContainer">
|
<div :class="$style.formContainer">
|
||||||
<form :class="$style.form" class="_panel" @submit.prevent="submit()">
|
<div :class="$style.form" class="_panel">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="z-index:1;position:relative" viewBox="0 0 854 300">
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="z-index:1;position:relative" viewBox="0 0 854 300">
|
||||||
<defs>
|
<defs>
|
||||||
<linearGradient id="linear" x1="0%" y1="0%" x2="100%" y2="0%">
|
<linearGradient id="linear" x1="0%" y1="0%" x2="100%" y2="0%">
|
||||||
|
@ -48,27 +48,52 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<div :class="$style.version">v{{ version }}</div>
|
<div :class="$style.version">v{{ version }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="_gaps_m" style="padding: 32px;">
|
<div class="_gaps_m" style="padding: 32px;">
|
||||||
<div>{{ i18n.ts.intro }}</div>
|
<template v-if="!accountCreated">
|
||||||
<MkInput v-model="setupPassword" type="password" data-cy-admin-initial-password>
|
<div style="text-align: center;" class="_gaps_s">
|
||||||
<template #label>{{ i18n.ts.initialPasswordForSetup }} <div v-tooltip:dialog="i18n.ts.initialPasswordForSetupDescription" class="_button _help"><i class="ti ti-help-circle"></i></div></template>
|
<div><b>{{ i18n.ts._serverSetupWizard.installCompleted }}</b></div>
|
||||||
<template #prefix><i class="ti ti-lock"></i></template>
|
<div>{{ i18n.ts._serverSetupWizard.firstCreateAccount }}</div>
|
||||||
</MkInput>
|
</div>
|
||||||
<MkInput v-model="username" pattern="^[a-zA-Z0-9_]{1,20}$" :spellcheck="false" required data-cy-admin-username>
|
<MkInput v-model="setupPassword" type="password" data-cy-admin-initial-password>
|
||||||
<template #label>{{ i18n.ts.username }}</template>
|
<template #label>{{ i18n.ts.initialPasswordForSetup }} <div v-tooltip:dialog="i18n.ts.initialPasswordForSetupDescription" class="_button _help"><i class="ti ti-help-circle"></i></div></template>
|
||||||
<template #prefix>@</template>
|
<template #prefix><i class="ti ti-lock"></i></template>
|
||||||
<template #suffix>@{{ host }}</template>
|
</MkInput>
|
||||||
</MkInput>
|
<MkInput v-model="username" pattern="^[a-zA-Z0-9_]{1,20}$" :spellcheck="false" required data-cy-admin-username>
|
||||||
<MkInput v-model="password" type="password" data-cy-admin-password>
|
<template #label>{{ i18n.ts.username }}</template>
|
||||||
<template #label>{{ i18n.ts.password }}</template>
|
<template #prefix>@</template>
|
||||||
<template #prefix><i class="ti ti-lock"></i></template>
|
<template #suffix>@{{ host }}</template>
|
||||||
</MkInput>
|
</MkInput>
|
||||||
<div>
|
<MkInput v-model="password" type="password" data-cy-admin-password>
|
||||||
<MkButton gradate large rounded type="submit" :disabled="submitting" data-cy-admin-ok style="margin: 0 auto;">
|
<template #label>{{ i18n.ts.password }}</template>
|
||||||
{{ submitting ? i18n.ts.processing : i18n.ts.done }}<MkEllipsis v-if="submitting"/>
|
<template #prefix><i class="ti ti-lock"></i></template>
|
||||||
|
</MkInput>
|
||||||
|
<div>
|
||||||
|
<MkButton gradate large rounded :disabled="accountCreating" data-cy-admin-ok style="margin: 0 auto;" @click="createAccount">
|
||||||
|
{{ accountCreating ? i18n.ts.processing : i18n.ts.next }}<MkEllipsis v-if="accountCreating"/>
|
||||||
|
</MkButton>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="step === 0">
|
||||||
|
<div style="text-align: center;" class="_gaps_s">
|
||||||
|
<div><b>{{ i18n.ts._serverSetupWizard.accountCreated }}</b></div>
|
||||||
|
</div>
|
||||||
|
<MkButton gradate large rounded data-cy-next style="margin: 0 auto;" @click="step++">
|
||||||
|
{{ i18n.ts.next }}
|
||||||
</MkButton>
|
</MkButton>
|
||||||
</div>
|
</template>
|
||||||
|
<template v-else-if="step === 1">
|
||||||
|
<div style="text-align: center;" class="_gaps_s">
|
||||||
|
<div><b>お願い</b></div>
|
||||||
|
<div>Misskeyは有志によって開発されている無料のソフトウェアです。<br>今後も開発を続けられるように、よろしければぜひカンパをお願いいたします。<br>ご支援特典もあります!</div>
|
||||||
|
</div>
|
||||||
|
<MkLink target="_blank" url="https://misskey-hub.net/docs/donate/" style="margin: 0 auto;">{{ i18n.ts.learnMore }}</MkLink>
|
||||||
|
<div class="_buttonsCenter">
|
||||||
|
<MkButton gradate large rounded data-cy-next style="margin: 0 auto;" @click="step++">
|
||||||
|
{{ i18n.ts.next }}
|
||||||
|
</MkButton>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</PageWithAnimBg>
|
</PageWithAnimBg>
|
||||||
</template>
|
</template>
|
||||||
|
@ -82,24 +107,30 @@ import * as os from '@/os.js';
|
||||||
import { misskeyApi } from '@/utility/misskey-api.js';
|
import { misskeyApi } from '@/utility/misskey-api.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { login } from '@/accounts.js';
|
import { login } from '@/accounts.js';
|
||||||
|
import MkLink from '@/components/MkLink.vue';
|
||||||
|
|
||||||
const username = ref('');
|
const username = ref('');
|
||||||
const password = ref('');
|
const password = ref('');
|
||||||
const setupPassword = ref('');
|
const setupPassword = ref('');
|
||||||
const submitting = ref(false);
|
const accountCreating = ref(false);
|
||||||
|
const accountCreated = ref(true);
|
||||||
|
const step = ref(0);
|
||||||
|
|
||||||
function submit() {
|
let token;
|
||||||
if (submitting.value) return;
|
|
||||||
submitting.value = true;
|
function createAccount() {
|
||||||
|
if (accountCreating.value) return;
|
||||||
|
accountCreating.value = true;
|
||||||
|
|
||||||
misskeyApi('admin/accounts/create', {
|
misskeyApi('admin/accounts/create', {
|
||||||
username: username.value,
|
username: username.value,
|
||||||
password: password.value,
|
password: password.value,
|
||||||
setupPassword: setupPassword.value === '' ? null : setupPassword.value,
|
setupPassword: setupPassword.value === '' ? null : setupPassword.value,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
return login(res.token);
|
token = res.token;
|
||||||
|
accountCreated.value = true;
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
submitting.value = false;
|
accountCreating.value = false;
|
||||||
|
|
||||||
let title = i18n.ts.somethingHappened;
|
let title = i18n.ts.somethingHappened;
|
||||||
let text = err.message + '\n' + err.id;
|
let text = err.message + '\n' + err.id;
|
||||||
|
|
Loading…
Reference in New Issue