Skip to content

Commit

Permalink
enhance: 「サーバーのマシン情報を公開する」設定が無効になっている場合、コントロールパネルでサーバーメトリクスを出力できないという…
Browse files Browse the repository at this point in the history
…案内文を表示するように
  • Loading branch information
noridev committed Sep 7, 2023
1 parent 4b10884 commit 58ad038
Showing 6 changed files with 19 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG_CHERRYPICK.md
Original file line number Diff line number Diff line change
@@ -57,6 +57,7 @@
- Enhance: 데이터 절약 모드가 활성화되면 페이지의 이미지도 숨기도록 (misskey-dev/misskey#11779)
- Enhance: 데이터 절약 모드 활성화 시 URL 미리보기 썸네일을 표시하지 않도록 (misskey-dev/misskey#11779)
- Enhance: 네비게이션 메뉴 디자인 개선
- Enhance: '서버의 머신 사양을 공개하기' 설정이 비활성화 상태인 경우, 제어판에서 서버 통계를 출력할 수 없다는 안내 문구를 표시하도록
- Fix: (Friendly) 흐림 효과를 사용할 때 하단 내비게이션 바의 가독성이 매우 떨어지는 문제
- Fix: (Friendly) 위젯 버튼에서 'UI 애니메이션 줄이기' 옵션이 적용되지 않는 문제
- Fix: (Friendly) 스크롤을 해도 위젯 버튼이 숨겨지지 않는 문제
1 change: 1 addition & 0 deletions locales/en-US.yml
Original file line number Diff line number Diff line change
@@ -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 change: 1 addition & 0 deletions locales/index.d.ts
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
// Do not edit this file directly.
export interface Locale {
"_lang_": string;
"disabledServerMachineStats": string;
"replayUserSetupDialog": string;
"replayTutorial": string;
"nya": string;
1 change: 1 addition & 0 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
_lang_: "日本語"

disabledServerMachineStats: "「サーバーのマシン情報を公開する」設定がオフになっています。\nサーバーメトリクスを表示するには、「コントロールパネル - その他」で「サーバーのマシン情報を公開する」設定を有効にしてください。"
replayUserSetupDialog: "初期設定のリプレイ"
replayTutorial: "チュートリアルのリプレイ"
nya: "にゃん!"
1 change: 1 addition & 0 deletions locales/ko-KR.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
_lang_: "한국어"
disabledServerMachineStats: "'서버의 머신 사양을 공개하기' 설정이 꺼져 있습니다.\n서버 통계를 보려면 '제어판 - 기타'에서 '서버의 머신 사양을 공개하기' 설정을 활성화하세요."
replayUserSetupDialog: "초기 설정 다시 보기"
replayTutorial: "튜토리얼 다시 보기"
nya: "냥!"
20 changes: 14 additions & 6 deletions packages/frontend/src/pages/admin/overview.vue
Original file line number Diff line number Diff line change
@@ -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>

0 comments on commit 58ad038

Please sign in to comment.