diff --git a/locales/index.d.ts b/locales/index.d.ts index e564b47270..b94150113a 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -1022,10 +1022,6 @@ export interface Locale extends ILocale { * これ以上ピン留めできません */ "pinLimitExceeded": string; - /** - * Misskeyのインストールが完了しました!管理者アカウントを作成しましょう。 - */ - "intro": string; /** * 完了 */ @@ -11616,6 +11612,20 @@ export interface Locale extends ILocale { */ "serverHostPlaceholder": string; }; + "_serverSetupWizard": { + /** + * Misskeyのインストールが完了しました! + */ + "installCompleted": string; + /** + * まずは、管理者アカウントを作成しましょう。 + */ + "firstCreateAccount": string; + /** + * 管理者アカウントが作成されました! + */ + "accountCreated": string; + }; } declare const locales: { [lang: string]: Locale; diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 7d2edf7194..d857264b92 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -251,7 +251,6 @@ noUsers: "ユーザーはいません" editProfile: "プロフィールを編集" noteDeleteConfirm: "このノートを削除しますか?" pinLimitExceeded: "これ以上ピン留めできません" -intro: "Misskeyのインストールが完了しました!管理者アカウントを作成しましょう。" done: "完了" processing: "処理中" preview: "プレビュー" @@ -3106,3 +3105,8 @@ _search: pleaseEnterServerHost: "サーバーのホストを入力してください" pleaseSelectUser: "ユーザーを選択してください" serverHostPlaceholder: "例: misskey.example.com" + +_serverSetupWizard: + installCompleted: "Misskeyのインストールが完了しました!" + firstCreateAccount: "まずは、管理者アカウントを作成しましょう。" + accountCreated: "管理者アカウントが作成されました!" diff --git a/packages/frontend/src/pages/welcome.setup.vue b/packages/frontend/src/pages/welcome.setup.vue index f8d9d7a5e8..3e43896d73 100644 --- a/packages/frontend/src/pages/welcome.setup.vue +++ b/packages/frontend/src/pages/welcome.setup.vue @@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only @@ -82,24 +107,30 @@ import * as os from '@/os.js'; import { misskeyApi } from '@/utility/misskey-api.js'; import { i18n } from '@/i18n.js'; import { login } from '@/accounts.js'; +import MkLink from '@/components/MkLink.vue'; const username = ref(''); const password = ref(''); const setupPassword = ref(''); -const submitting = ref(false); +const accountCreating = ref(false); +const accountCreated = ref(true); +const step = ref(0); -function submit() { - if (submitting.value) return; - submitting.value = true; +let token; + +function createAccount() { + if (accountCreating.value) return; + accountCreating.value = true; misskeyApi('admin/accounts/create', { username: username.value, password: password.value, setupPassword: setupPassword.value === '' ? null : setupPassword.value, }).then(res => { - return login(res.token); + token = res.token; + accountCreated.value = true; }).catch((err) => { - submitting.value = false; + accountCreating.value = false; let title = i18n.ts.somethingHappened; let text = err.message + '\n' + err.id;