1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-02 06:15:54 +02:00

enhance(frontend): サーバーの初期設定ウィザードをやり直せるように

This commit is contained in:
syuilo
2025-08-01 11:07:09 +09:00
parent a7d1c94f48
commit 4c520fa693
6 changed files with 99 additions and 5 deletions

View File

@@ -196,12 +196,14 @@ const props = withDefaults(defineProps<{
}>(), {
});
const q_name = ref('');
const currentMeta = await misskeyApi('admin/meta');
const q_name = ref(currentMeta.name ?? '');
const q_use = ref('single');
const q_scale = ref('small');
const q_federation = ref('yes');
const q_adminName = ref('');
const q_adminEmail = ref('');
const q_federation = ref(currentMeta.federation === 'none' ? 'no' : 'yes');
const q_adminName = ref(currentMeta.maintainerName ?? '');
const q_adminEmail = ref(currentMeta.maintainerEmail ?? '');
const serverSettings = computed<Misskey.entities.AdminUpdateMetaRequest>(() => {
let enableReactionsBuffering;

View File

@@ -0,0 +1,57 @@
<!--
SPDX-FileCopyrightText: syuilo and other misskey contributors
SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
<MkModalWindow
ref="windowEl"
:withOkButton="false"
:okButtonDisabled="false"
:width="500"
:height="600"
@close="onCloseModalWindow"
@closed="emit('closed')"
>
<template #header>Server setup wizard</template>
<div class="_spacer" style="--MI_SPACER-min: 20px; --MI_SPACER-max: 28px;">
<Suspense>
<template #default>
<MkServerSetupWizard @finished="onWizardFinished"/>
</template>
<template #fallback>
<MkLoading/>
</template>
</Suspense>
</div>
</MkModalWindow>
</template>
<script setup lang="ts">
import { useTemplateRef } from 'vue';
import MkModalWindow from '@/components/MkModalWindow.vue';
import MkServerSetupWizard from '@/components/MkServerSetupWizard.vue';
const emit = defineEmits<{
(ev: 'closed'),
}>();
const windowEl = useTemplateRef('windowEl');
function onWizardFinished() {
windowEl.value?.close();
}
function onCloseModalWindow() {
windowEl.value?.close();
}
</script>
<style module lang="scss">
.root {
max-height: 410px;
height: 410px;
display: flex;
flex-direction: column;
}
</style>

View File

@@ -287,6 +287,10 @@ SPDX-License-Identifier: AGPL-3.0-only
</MkTextarea>
</div>
</MkFolder>
<MkButton primary @click="openSetupWizard">
Open setup wizard
</MkButton>
</div>
</div>
</PageWithHeader>
@@ -425,6 +429,20 @@ const proxyAccountForm = useForm({
fetchInstance(true);
});
async function openSetupWizard() {
const { canceled } = await os.confirm({
type: 'warning',
title: i18n.ts._serverSettings.restartServerSetupWizardConfirm_title,
text: i18n.ts._serverSettings.restartServerSetupWizardConfirm_text,
});
if (canceled) return;
const { dispose } = await os.popupAsyncWithDialog(import('@/components/MkServerSetupWizardDialog.vue').then(x => x.default), {
}, {
closed: () => dispose(),
});
}
const headerTabs = computed(() => []);
definePage(() => ({

View File

@@ -87,7 +87,14 @@ SPDX-License-Identifier: AGPL-3.0-only
<div>{{ i18n.ts._serverSetupWizard.settingsYouMakeHereCanBeChangedLater }}</div>
</div>
<MkServerSetupWizard :token="token" @finished="onWizardFinished"/>
<Suspense>
<template #default>
<MkServerSetupWizard :token="token" @finished="onWizardFinished"/>
</template>
<template #fallback>
<MkLoading/>
</template>
</Suspense>
<MkButton rounded style="margin: 0 auto;" @click="skipSettings">
{{ i18n.ts._serverSetupWizard.skipSettings }}