enhance: 「サーバーのマシン情報を公開する」設定が無効になっている場合、コントロールパネルでサーバーメトリクスを出力できないという案内文を表示するように

This commit is contained in:
NoriDev 2023-09-07 17:37:15 +09:00
parent 4b10884bb3
commit 58ad0387f4
6 changed files with 19 additions and 6 deletions

View file

@ -57,6 +57,7 @@
- Enhance: 데이터 절약 모드가 활성화되면 페이지의 이미지도 숨기도록 (misskey-dev/misskey#11779)
- Enhance: 데이터 절약 모드 활성화 시 URL 미리보기 썸네일을 표시하지 않도록 (misskey-dev/misskey#11779)
- Enhance: 네비게이션 메뉴 디자인 개선
- Enhance: '서버의 머신 사양을 공개하기' 설정이 비활성화 상태인 경우, 제어판에서 서버 통계를 출력할 수 없다는 안내 문구를 표시하도록
- Fix: (Friendly) 흐림 효과를 사용할 때 하단 내비게이션 바의 가독성이 매우 떨어지는 문제
- Fix: (Friendly) 위젯 버튼에서 'UI 애니메이션 줄이기' 옵션이 적용되지 않는 문제
- Fix: (Friendly) 스크롤을 해도 위젯 버튼이 숨겨지지 않는 문제

View file

@ -1,5 +1,6 @@
---
_lang_: "English"
disabledServerMachineStats: "The 'Publish server hardware stats' setting is turned off.\nTo view server metrics, please enable the 'Publish server hardware stats' setting in 'Control Panel - Other'."
replayUserSetupDialog: "Replay initial setting"
replayTutorial: "Replay tutorial"
nya: "Nyan!"

1
locales/index.d.ts vendored
View file

@ -3,6 +3,7 @@
// Do not edit this file directly.
export interface Locale {
"_lang_": string;
"disabledServerMachineStats": string;
"replayUserSetupDialog": string;
"replayTutorial": string;
"nya": string;

View file

@ -1,5 +1,6 @@
_lang_: "日本語"
disabledServerMachineStats: "「サーバーのマシン情報を公開する」設定がオフになっています。\nサーバーメトリクスを表示するには、「コントロールパネル - その他」で「サーバーのマシン情報を公開する」設定を有効にしてください。"
replayUserSetupDialog: "初期設定のリプレイ"
replayTutorial: "チュートリアルのリプレイ"
nya: "にゃん!"

View file

@ -1,5 +1,6 @@
---
_lang_: "한국어"
disabledServerMachineStats: "'서버의 머신 사양을 공개하기' 설정이 꺼져 있습니다.\n서버 통계를 보려면 '제어판 - 기타'에서 '서버의 머신 사양을 공개하기' 설정을 활성화하세요."
replayUserSetupDialog: "초기 설정 다시 보기"
replayTutorial: "튜토리얼 다시 보기"
nya: "냥!"

View file

@ -14,9 +14,10 @@ SPDX-License-Identifier: AGPL-3.0-only
<XStats/>
</MkFoldableSection>
<MkFoldableSection class="item">
<MkFoldableSection v-if="meta" class="item">
<template #header>Server Metric</template>
<XCpuMemoryNetCompact :connection="connection" :meta="meta"/>
<XCpuMemoryNetCompact v-if="meta.enableServerMachineStats" :connection="connection" :meta="serverInfo"/>
<div v-else :class="$style.disabledServerMachineStats" v-html="i18n.ts.disabledServerMachineStats.replaceAll('\n', '<br>')"></div>
</MkFoldableSection>
<MkFoldableSection class="item">
@ -115,10 +116,6 @@ const filesPagination = {
const meta = ref(null);
os.api('server-info', {}).then(res => {
meta.value = res;
});
function onInstanceClick(i) {
os.pageWindow(`/instance-info/${i.host}`);
}
@ -178,6 +175,10 @@ onMounted(async () => {
activeInstances = res;
});
os.api('admin/meta', {}).then(res => {
meta.value = res;
});
nextTick(() => {
queueStatsConnection.send('requestLog', {
id: Math.random().toString().substring(2, 10),
@ -210,4 +211,11 @@ definePageMetadata({
grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
grid-gap: 16px;
}
.disabledServerMachineStats {
color: var(--fgTransparentWeak);
margin: 10px;
font-size: 0.9em;
text-align: center;
}
</style>