wip
This commit is contained in:
parent
623773d3e0
commit
c1cbe97b7b
|
@ -11634,7 +11634,7 @@ export interface Locale extends ILocale {
|
||||||
*/
|
*/
|
||||||
"serverSetting": string;
|
"serverSetting": string;
|
||||||
/**
|
/**
|
||||||
* このウィザードで簡単に最適なサーバーの設定を行えます。
|
* このウィザードで簡単に最適なサーバーの設定が行えます。
|
||||||
*/
|
*/
|
||||||
"youCanEasilyConfigureOptimalServerSettingsWithThisWizard": string;
|
"youCanEasilyConfigureOptimalServerSettingsWithThisWizard": string;
|
||||||
/**
|
/**
|
||||||
|
@ -11698,7 +11698,7 @@ export interface Locale extends ILocale {
|
||||||
"large": string;
|
"large": string;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* 大規模なサーバーでは、データベースのレプリケーションなど、高度なインフラストラクチャーの知識が必要になる場合があります。
|
* 大規模なサーバーでは、ロードバランシングやデータベースのレプリケーションなど、高度なインフラストラクチャーの知識が必要になる場合があります。
|
||||||
*/
|
*/
|
||||||
"largeScaleServerAdvice": string;
|
"largeScaleServerAdvice": string;
|
||||||
/**
|
/**
|
||||||
|
@ -11713,14 +11713,30 @@ export interface Locale extends ILocale {
|
||||||
* Fediverseと接続することは「連合」とも呼ばれます。
|
* Fediverseと接続することは「連合」とも呼ばれます。
|
||||||
*/
|
*/
|
||||||
"doYouConnectToFediverse_description2": string;
|
"doYouConnectToFediverse_description2": string;
|
||||||
|
/**
|
||||||
|
* 連合可能なサーバーの指定など、高度な設定も後ほど可能です。
|
||||||
|
*/
|
||||||
|
"youCanConfigureMoreFederationSettingsLater": string;
|
||||||
/**
|
/**
|
||||||
* 以下の設定が推奨されます
|
* 以下の設定が推奨されます
|
||||||
*/
|
*/
|
||||||
"followingSettingsAreRecommended": string;
|
"followingSettingsAreRecommended": string;
|
||||||
/**
|
/**
|
||||||
* この設定で始める
|
* この設定を適用
|
||||||
*/
|
*/
|
||||||
"startWithTheseSettings": string;
|
"applyTheseSettings": string;
|
||||||
|
/**
|
||||||
|
* 設定をスキップ
|
||||||
|
*/
|
||||||
|
"skipSettings": string;
|
||||||
|
/**
|
||||||
|
* 設定が完了しました!
|
||||||
|
*/
|
||||||
|
"settingsCompleted": string;
|
||||||
|
/**
|
||||||
|
* お疲れ様でした。準備が整ったので、さっそくサーバーの使用を開始できます。
|
||||||
|
*/
|
||||||
|
"settingsCompleted_description": string;
|
||||||
/**
|
/**
|
||||||
* 寄付のお願い
|
* 寄付のお願い
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -3112,7 +3112,7 @@ _serverSetupWizard:
|
||||||
firstCreateAccount: "まずは、管理者アカウントを作成しましょう。"
|
firstCreateAccount: "まずは、管理者アカウントを作成しましょう。"
|
||||||
accountCreated: "管理者アカウントが作成されました!"
|
accountCreated: "管理者アカウントが作成されました!"
|
||||||
serverSetting: "サーバーの設定"
|
serverSetting: "サーバーの設定"
|
||||||
youCanEasilyConfigureOptimalServerSettingsWithThisWizard: "このウィザードで簡単に最適なサーバーの設定を行えます。"
|
youCanEasilyConfigureOptimalServerSettingsWithThisWizard: "このウィザードで簡単に最適なサーバーの設定が行えます。"
|
||||||
settingsYouMakeHereCanBeChangedLater: "ここでの設定は、あとからでも変更できます。"
|
settingsYouMakeHereCanBeChangedLater: "ここでの設定は、あとからでも変更できます。"
|
||||||
howWillYouUseMisskey: "Misskeyをどのように使いますか?"
|
howWillYouUseMisskey: "Misskeyをどのように使いますか?"
|
||||||
_use:
|
_use:
|
||||||
|
@ -3129,12 +3129,16 @@ _serverSetupWizard:
|
||||||
small: "100人以下 (小規模)"
|
small: "100人以下 (小規模)"
|
||||||
medium: "100人以上1000人以下 (中規模)"
|
medium: "100人以上1000人以下 (中規模)"
|
||||||
large: "1000人以上 (大規模)"
|
large: "1000人以上 (大規模)"
|
||||||
largeScaleServerAdvice: "大規模なサーバーでは、データベースのレプリケーションなど、高度なインフラストラクチャーの知識が必要になる場合があります。"
|
largeScaleServerAdvice: "大規模なサーバーでは、ロードバランシングやデータベースのレプリケーションなど、高度なインフラストラクチャーの知識が必要になる場合があります。"
|
||||||
doYouConnectToFediverse: "Fediverseと接続しますか?"
|
doYouConnectToFediverse: "Fediverseと接続しますか?"
|
||||||
doYouConnectToFediverse_description1: "分散型サーバーで構成されるネットワーク(Fediverse)に接続すると、他のサーバーと相互にコンテンツのやり取りが可能です。"
|
doYouConnectToFediverse_description1: "分散型サーバーで構成されるネットワーク(Fediverse)に接続すると、他のサーバーと相互にコンテンツのやり取りが可能です。"
|
||||||
doYouConnectToFediverse_description2: "Fediverseと接続することは「連合」とも呼ばれます。"
|
doYouConnectToFediverse_description2: "Fediverseと接続することは「連合」とも呼ばれます。"
|
||||||
|
youCanConfigureMoreFederationSettingsLater: "連合可能なサーバーの指定など、高度な設定も後ほど可能です。"
|
||||||
followingSettingsAreRecommended: "以下の設定が推奨されます"
|
followingSettingsAreRecommended: "以下の設定が推奨されます"
|
||||||
startWithTheseSettings: "この設定で始める"
|
applyTheseSettings: "この設定を適用"
|
||||||
|
skipSettings: "設定をスキップ"
|
||||||
|
settingsCompleted: "設定が完了しました!"
|
||||||
|
settingsCompleted_description: "お疲れ様でした。準備が整ったので、さっそくサーバーの使用を開始できます。"
|
||||||
donationRequest: "寄付のお願い"
|
donationRequest: "寄付のお願い"
|
||||||
_donationRequest:
|
_donationRequest:
|
||||||
text1: "Misskeyは有志によって開発されている無料のソフトウェアです。"
|
text1: "Misskeyは有志によって開発されている無料のソフトウェアです。"
|
||||||
|
|
|
@ -547,18 +547,24 @@ export function success(): Promise<void> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function waiting(text?: string | null): Promise<void> {
|
export function waiting(text?: string | null): () => void {
|
||||||
return new Promise(resolve => {
|
window.document.body.setAttribute('inert', 'true');
|
||||||
const showing = ref(true);
|
|
||||||
const { dispose } = popup(MkWaitingDialog, {
|
const showing = ref(true);
|
||||||
success: false,
|
const { dispose } = popup(MkWaitingDialog, {
|
||||||
showing: showing,
|
success: false,
|
||||||
text,
|
showing: showing,
|
||||||
}, {
|
text,
|
||||||
done: () => resolve(),
|
}, {
|
||||||
closed: () => dispose(),
|
closed: () => {
|
||||||
});
|
window.document.body.removeAttribute('inert');
|
||||||
|
dispose();
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
showing.value = false;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function form<F extends Form>(title: string, f: F): Promise<{ canceled: true, result?: undefined } | { canceled?: false, result: GetFormResultType<F> }> {
|
export function form<F extends Form>(title: string, f: F): Promise<{ canceled: true, result?: undefined } | { canceled?: false, result: GetFormResultType<F> }> {
|
||||||
|
|
|
@ -110,15 +110,15 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<div class="_gaps_s">
|
<div class="_gaps_s">
|
||||||
<MkRadios v-model="q_use" :vertical="true">
|
<MkRadios v-model="q_use" :vertical="true">
|
||||||
<option value="one">
|
<option value="one">
|
||||||
<div><b>{{ i18n.ts._serverSetupWizard._use.one }}</b></div>
|
<div><i class="ti ti-user"></i> <b>{{ i18n.ts._serverSetupWizard._use.one }}</b></div>
|
||||||
<div>{{ i18n.ts._serverSetupWizard._use.one_description }}</div>
|
<div>{{ i18n.ts._serverSetupWizard._use.one_description }}</div>
|
||||||
</option>
|
</option>
|
||||||
<option value="group">
|
<option value="group">
|
||||||
<div><b>{{ i18n.ts._serverSetupWizard._use.group }}</b></div>
|
<div><i class="ti ti-lock"></i> <b>{{ i18n.ts._serverSetupWizard._use.group }}</b></div>
|
||||||
<div>{{ i18n.ts._serverSetupWizard._use.group_description }}</div>
|
<div>{{ i18n.ts._serverSetupWizard._use.group_description }}</div>
|
||||||
</option>
|
</option>
|
||||||
<option value="open">
|
<option value="open">
|
||||||
<div><b>{{ i18n.ts._serverSetupWizard._use.open }}</b></div>
|
<div><i class="ti ti-world"></i> <b>{{ i18n.ts._serverSetupWizard._use.open }}</b></div>
|
||||||
<div>{{ i18n.ts._serverSetupWizard._use.open_description }}</div>
|
<div>{{ i18n.ts._serverSetupWizard._use.open_description }}</div>
|
||||||
</option>
|
</option>
|
||||||
</MkRadios>
|
</MkRadios>
|
||||||
|
@ -134,9 +134,9 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
<div class="_gaps_s">
|
<div class="_gaps_s">
|
||||||
<MkRadios v-model="q_scale" :vertical="true">
|
<MkRadios v-model="q_scale" :vertical="true">
|
||||||
<option value="small">{{ i18n.ts._serverSetupWizard._scale.small }}</option>
|
<option value="small"><i class="ti ti-user"></i> {{ i18n.ts._serverSetupWizard._scale.small }}</option>
|
||||||
<option value="medium">{{ i18n.ts._serverSetupWizard._scale.medium }}</option>
|
<option value="medium"><i class="ti ti-users"></i> {{ i18n.ts._serverSetupWizard._scale.medium }}</option>
|
||||||
<option value="large">{{ i18n.ts._serverSetupWizard._scale.large }}</option>
|
<option value="large"><i class="ti ti-users-group"></i> {{ i18n.ts._serverSetupWizard._scale.large }}</option>
|
||||||
</MkRadios>
|
</MkRadios>
|
||||||
|
|
||||||
<MkInfo v-if="q_scale === 'large'"><b>{{ i18n.ts.advice }}:</b> {{ i18n.ts._serverSetupWizard.largeScaleServerAdvice }}</MkInfo>
|
<MkInfo v-if="q_scale === 'large'"><b>{{ i18n.ts.advice }}:</b> {{ i18n.ts._serverSetupWizard.largeScaleServerAdvice }}</MkInfo>
|
||||||
|
@ -148,12 +148,14 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<template #icon><i class="ti ti-planet"></i></template>
|
<template #icon><i class="ti ti-planet"></i></template>
|
||||||
|
|
||||||
<div class="_gaps_s">
|
<div class="_gaps_s">
|
||||||
<MkInfo>{{ i18n.ts._serverSetupWizard.doYouConnectToFediverse_description1 }}<br>{{ i18n.ts._serverSetupWizard.doYouConnectToFediverse_description2 }}</MkInfo>
|
<div>{{ i18n.ts._serverSetupWizard.doYouConnectToFediverse_description1 }}<br>{{ i18n.ts._serverSetupWizard.doYouConnectToFediverse_description2 }}</div>
|
||||||
|
|
||||||
<MkRadios v-model="q_federation" :vertical="true">
|
<MkRadios v-model="q_federation" :vertical="true">
|
||||||
<option value="yes">{{ i18n.ts.yes }}</option>
|
<option value="yes">{{ i18n.ts.yes }}</option>
|
||||||
<option value="no">{{ i18n.ts.no }}</option>
|
<option value="no">{{ i18n.ts.no }}</option>
|
||||||
</MkRadios>
|
</MkRadios>
|
||||||
|
|
||||||
|
<MkInfo v-if="q_federation === 'yes'">{{ i18n.ts._serverSetupWizard.youCanConfigureMoreFederationSettingsLater }}</MkInfo>
|
||||||
</div>
|
</div>
|
||||||
</MkFolder>
|
</MkFolder>
|
||||||
|
|
||||||
|
@ -166,19 +168,32 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<div><b>{{ i18n.ts._serverSettings.openRegistration }}:</b></div>
|
<div><b>{{ i18n.ts._serverSettings.openRegistration }}:</b></div>
|
||||||
<div>{{ !serverSettings.disableRegistration ? i18n.ts.yes : i18n.ts.no }}</div>
|
<div>{{ !serverSettings.disableRegistration ? i18n.ts.yes : i18n.ts.no }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<div><b>{{ i18n.ts.emailRequiredForSignup }}:</b></div>
|
||||||
|
<div>{{ serverSettings.emailRequiredForSignup ? i18n.ts.yes : i18n.ts.no }}</div>
|
||||||
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div><b>{{ i18n.ts.federation }}:</b></div>
|
<div><b>{{ i18n.ts.federation }}:</b></div>
|
||||||
<div>{{ serverSettings.federation === 'none' ? i18n.ts.no : i18n.ts.all }}</div>
|
<div>{{ serverSettings.federation === 'none' ? i18n.ts.no : i18n.ts.all }}</div>
|
||||||
</div>
|
</div>
|
||||||
<MkButton gradate large rounded data-cy-next style="margin: 0 auto;" @click="step++">
|
<MkButton gradate large rounded data-cy-next style="margin: 0 auto;" @click="applySettings">
|
||||||
{{ i18n.ts._serverSetupWizard.startWithTheseSettings }}
|
<i class="ti ti-check"></i> {{ i18n.ts._serverSetupWizard.applyTheseSettings }}
|
||||||
</MkButton>
|
</MkButton>
|
||||||
</div>
|
</div>
|
||||||
</MkFolder>
|
</MkFolder>
|
||||||
|
|
||||||
<div v-if="qStep === 999" class="_buttonsCenter">
|
<MkButton rounded style="margin: 0 auto;" @click="skipSettings">
|
||||||
<MkButton gradate large rounded data-cy-next style="margin: 0 auto;" @click="step++">
|
{{ i18n.ts._serverSetupWizard.skipSettings }}
|
||||||
{{ i18n.ts.next }}
|
</MkButton>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="step === 3" class="_gaps_m">
|
||||||
|
<div style="text-align: center;" class="_gaps_s">
|
||||||
|
<div><b>{{ i18n.ts._serverSetupWizard.settingsCompleted }}</b></div>
|
||||||
|
<div>{{ i18n.ts._serverSetupWizard.settingsCompleted_description }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="_buttonsCenter">
|
||||||
|
<MkButton gradate large rounded data-cy-next style="margin: 0 auto;" @click="finish">
|
||||||
|
{{ i18n.ts.start }}
|
||||||
</MkButton>
|
</MkButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -192,6 +207,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
import { computed, ref } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
import { host, version } from '@@/js/config.js';
|
import { host, version } from '@@/js/config.js';
|
||||||
|
import { ROLE_POLICIES } from '@@/js/const.js';
|
||||||
import MkButton from '@/components/MkButton.vue';
|
import MkButton from '@/components/MkButton.vue';
|
||||||
import MkInput from '@/components/MkInput.vue';
|
import MkInput from '@/components/MkInput.vue';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
|
@ -209,7 +225,6 @@ const setupPassword = ref('');
|
||||||
const accountCreating = ref(false);
|
const accountCreating = ref(false);
|
||||||
const accountCreated = ref(false);
|
const accountCreated = ref(false);
|
||||||
const step = ref(0);
|
const step = ref(0);
|
||||||
const qStep = ref(0);
|
|
||||||
const q_name = ref('');
|
const q_name = ref('');
|
||||||
const q_use = ref('one');
|
const q_use = ref('one');
|
||||||
const q_scale = ref('small');
|
const q_scale = ref('small');
|
||||||
|
@ -218,16 +233,50 @@ const q_federation = ref('yes');
|
||||||
const serverSettings = computed<Misskey.entities.AdminUpdateMetaRequest>(() => {
|
const serverSettings = computed<Misskey.entities.AdminUpdateMetaRequest>(() => {
|
||||||
return {
|
return {
|
||||||
disableRegistration: q_use.value !== 'open',
|
disableRegistration: q_use.value !== 'open',
|
||||||
|
emailRequiredForSignup: q_use.value === 'open',
|
||||||
federation: q_federation.value === 'yes' ? 'all' : 'none',
|
federation: q_federation.value === 'yes' ? 'all' : 'none',
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const defaultPolicies = computed<Misskey.entities.AdminRolesUpdateDefaultPoliciesRequest>(() => {
|
||||||
|
let driveCapacityMb;
|
||||||
|
if (q_use.value === 'one') {
|
||||||
|
driveCapacityMb = 8192;
|
||||||
|
} else if (q_use.value === 'group') {
|
||||||
|
driveCapacityMb = 1000;
|
||||||
|
} else if (q_use.value === 'open') {
|
||||||
|
driveCapacityMb = 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
let rateLimitFactor;
|
||||||
|
if (q_use.value === 'one') {
|
||||||
|
rateLimitFactor = 0.3;
|
||||||
|
} else if (q_use.value === 'group') {
|
||||||
|
rateLimitFactor = 0.7;
|
||||||
|
} else if (q_use.value === 'open') {
|
||||||
|
if (q_scale.value === 'small') {
|
||||||
|
rateLimitFactor = 1;
|
||||||
|
} else if (q_scale.value === 'medium') {
|
||||||
|
rateLimitFactor = 1.25;
|
||||||
|
} else if (q_scale.value === 'large') {
|
||||||
|
rateLimitFactor = 1.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
rateLimitFactor,
|
||||||
|
driveCapacityMb,
|
||||||
|
} satisfies Partial<Record<typeof ROLE_POLICIES[number], any>>;
|
||||||
|
});
|
||||||
|
|
||||||
let token;
|
let token;
|
||||||
|
|
||||||
function createAccount() {
|
function createAccount() {
|
||||||
if (accountCreating.value) return;
|
if (accountCreating.value) return;
|
||||||
accountCreating.value = true;
|
accountCreating.value = true;
|
||||||
|
|
||||||
|
const _close = os.waiting();
|
||||||
|
|
||||||
misskeyApi('admin/accounts/create', {
|
misskeyApi('admin/accounts/create', {
|
||||||
username: username.value,
|
username: username.value,
|
||||||
password: password.value,
|
password: password.value,
|
||||||
|
@ -254,8 +303,41 @@ function createAccount() {
|
||||||
title,
|
title,
|
||||||
text,
|
text,
|
||||||
});
|
});
|
||||||
|
}).finally(() => {
|
||||||
|
_close();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function applySettings() {
|
||||||
|
const _close = os.waiting();
|
||||||
|
Promise.all([
|
||||||
|
misskeyApi('admin/update-meta', {
|
||||||
|
...serverSettings.value,
|
||||||
|
name: q_name.value === '' ? undefined : q_name.value,
|
||||||
|
}, token),
|
||||||
|
misskeyApi('admin/roles/update-default-policies', {
|
||||||
|
policies: defaultPolicies.value,
|
||||||
|
}, token),
|
||||||
|
]).then(() => {
|
||||||
|
step.value++;
|
||||||
|
}).catch((err) => {
|
||||||
|
os.alert({
|
||||||
|
type: 'error',
|
||||||
|
title: err.code,
|
||||||
|
text: err.message,
|
||||||
|
});
|
||||||
|
}).finally(() => {
|
||||||
|
_close();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function skipSettings() {
|
||||||
|
step.value++;
|
||||||
|
}
|
||||||
|
|
||||||
|
function finish() {
|
||||||
|
login(token);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" module>
|
<style lang="scss" module>
|
||||||
|
|
Loading…
Reference in New Issue