2023-07-27 07:31:52 +02:00
|
|
|
<!--
|
2024-02-13 16:50:11 +01:00
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
2023-07-27 07:31:52 +02:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2021-04-22 15:29:33 +02:00
|
|
|
<template>
|
2022-06-20 10:38:49 +02:00
|
|
|
<MkStickyContainer>
|
|
|
|
<template #header><XHeader :actions="headerActions" :tabs="headerTabs"/></template>
|
2023-05-19 06:35:46 +02:00
|
|
|
<MkSpacer :contentMax="700" :marginMin="16" :marginMax="32">
|
2022-06-20 10:38:49 +02:00
|
|
|
<FormSuspense :p="init">
|
2023-07-08 01:46:42 +02:00
|
|
|
<div class="_gaps">
|
|
|
|
<div class="_panel" style="padding: 16px;">
|
|
|
|
<MkSwitch v-model="enableServerMachineStats">
|
|
|
|
<template #label>{{ i18n.ts.enableServerMachineStats }}</template>
|
|
|
|
<template #caption>{{ i18n.ts.turnOffToImprovePerformance }}</template>
|
|
|
|
</MkSwitch>
|
|
|
|
</div>
|
2023-07-02 09:02:32 +02:00
|
|
|
|
2023-07-08 01:46:42 +02:00
|
|
|
<div class="_panel" style="padding: 16px;">
|
|
|
|
<MkSwitch v-model="enableIdenticonGeneration">
|
|
|
|
<template #label>{{ i18n.ts.enableIdenticonGeneration }}</template>
|
|
|
|
<template #caption>{{ i18n.ts.turnOffToImprovePerformance }}</template>
|
|
|
|
</MkSwitch>
|
|
|
|
</div>
|
2023-07-02 09:02:32 +02:00
|
|
|
|
2023-07-08 01:46:42 +02:00
|
|
|
<div class="_panel" style="padding: 16px;">
|
|
|
|
<MkSwitch v-model="enableChartsForRemoteUser">
|
|
|
|
<template #label>{{ i18n.ts.enableChartsForRemoteUser }}</template>
|
|
|
|
<template #caption>{{ i18n.ts.turnOffToImprovePerformance }}</template>
|
|
|
|
</MkSwitch>
|
|
|
|
</div>
|
2023-05-19 06:35:46 +02:00
|
|
|
|
2023-07-08 01:46:42 +02:00
|
|
|
<div class="_panel" style="padding: 16px;">
|
|
|
|
<MkSwitch v-model="enableChartsForFederatedInstances">
|
|
|
|
<template #label>{{ i18n.ts.enableChartsForFederatedInstances }}</template>
|
|
|
|
<template #caption>{{ i18n.ts.turnOffToImprovePerformance }}</template>
|
|
|
|
</MkSwitch>
|
|
|
|
</div>
|
2023-05-19 06:35:46 +02:00
|
|
|
</div>
|
2022-06-20 10:38:49 +02:00
|
|
|
</FormSuspense>
|
|
|
|
</MkSpacer>
|
|
|
|
</MkStickyContainer>
|
2021-04-22 15:29:33 +02:00
|
|
|
</template>
|
|
|
|
|
2022-05-25 09:38:18 +02:00
|
|
|
<script lang="ts" setup>
|
2023-12-07 06:42:09 +01:00
|
|
|
import { ref, computed } from 'vue';
|
2022-06-20 10:38:49 +02:00
|
|
|
import XHeader from './_header_.vue';
|
2022-01-04 13:16:41 +01:00
|
|
|
import FormSuspense from '@/components/form/suspense.vue';
|
2023-09-19 09:37:43 +02:00
|
|
|
import * as os from '@/os.js';
|
2024-01-04 10:32:46 +01:00
|
|
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
2023-09-19 09:37:43 +02:00
|
|
|
import { fetchInstance } from '@/instance.js';
|
|
|
|
import { i18n } from '@/i18n.js';
|
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
2023-05-19 06:35:46 +02:00
|
|
|
import MkSwitch from '@/components/MkSwitch.vue';
|
|
|
|
|
2023-12-07 06:42:09 +01:00
|
|
|
const enableServerMachineStats = ref<boolean>(false);
|
|
|
|
const enableIdenticonGeneration = ref<boolean>(false);
|
|
|
|
const enableChartsForRemoteUser = ref<boolean>(false);
|
|
|
|
const enableChartsForFederatedInstances = ref<boolean>(false);
|
2021-04-22 15:29:33 +02:00
|
|
|
|
2022-05-25 09:38:18 +02:00
|
|
|
async function init() {
|
2024-01-04 10:32:46 +01:00
|
|
|
const meta = await misskeyApi('admin/meta');
|
2023-12-07 06:42:09 +01:00
|
|
|
enableServerMachineStats.value = meta.enableServerMachineStats;
|
|
|
|
enableIdenticonGeneration.value = meta.enableIdenticonGeneration;
|
|
|
|
enableChartsForRemoteUser.value = meta.enableChartsForRemoteUser;
|
|
|
|
enableChartsForFederatedInstances.value = meta.enableChartsForFederatedInstances;
|
2022-05-25 09:38:18 +02:00
|
|
|
}
|
2021-04-22 15:29:33 +02:00
|
|
|
|
2022-05-25 09:38:18 +02:00
|
|
|
function save() {
|
2023-05-19 06:35:46 +02:00
|
|
|
os.apiWithDialog('admin/update-meta', {
|
2023-12-07 06:42:09 +01:00
|
|
|
enableServerMachineStats: enableServerMachineStats.value,
|
|
|
|
enableIdenticonGeneration: enableIdenticonGeneration.value,
|
|
|
|
enableChartsForRemoteUser: enableChartsForRemoteUser.value,
|
|
|
|
enableChartsForFederatedInstances: enableChartsForFederatedInstances.value,
|
2023-05-19 06:35:46 +02:00
|
|
|
}).then(() => {
|
2022-05-25 09:38:18 +02:00
|
|
|
fetchInstance();
|
|
|
|
});
|
|
|
|
}
|
2021-04-22 15:29:33 +02:00
|
|
|
|
2023-12-07 06:42:09 +01:00
|
|
|
const headerActions = computed(() => [{
|
2022-06-20 10:38:49 +02:00
|
|
|
asFullButton: true,
|
2022-12-19 11:01:30 +01:00
|
|
|
icon: 'ti ti-check',
|
2022-06-20 10:38:49 +02:00
|
|
|
text: i18n.ts.save,
|
|
|
|
handler: save,
|
|
|
|
}]);
|
|
|
|
|
2023-12-07 06:42:09 +01:00
|
|
|
const headerTabs = computed(() => []);
|
2022-06-20 10:38:49 +02:00
|
|
|
|
|
|
|
definePageMetadata({
|
|
|
|
title: i18n.ts.other,
|
2022-12-19 11:01:30 +01:00
|
|
|
icon: 'ti ti-adjustments',
|
2021-04-22 15:29:33 +02:00
|
|
|
});
|
|
|
|
</script>
|