Merge 97546403b0
into f0fb3a56a8
This commit is contained in:
commit
897d94bf2e
|
@ -20,6 +20,7 @@
|
||||||
- Enhance: 時刻計算のための基準値を一か所で管理するようにし、パフォーマンスを向上
|
- Enhance: 時刻計算のための基準値を一か所で管理するようにし、パフォーマンスを向上
|
||||||
- Fix: iOSで、デバイスがダークモードだと初回読み込み時にエラーになる問題を修正
|
- Fix: iOSで、デバイスがダークモードだと初回読み込み時にエラーになる問題を修正
|
||||||
- Fix: アクティビティウィジェットのグラフモードが動作しない問題を修正
|
- Fix: アクティビティウィジェットのグラフモードが動作しない問題を修正
|
||||||
|
- Fix: サーバー情報が非公開のサーバーで「サーバーメトリクス」ウィジェットが利用できる問題を修正
|
||||||
|
|
||||||
### Server
|
### Server
|
||||||
- Enhance: ユーザーIPを確実に取得できるために設定ファイルにFastifyOptions.trustProxyを追加しました
|
- Enhance: ユーザーIPを確実に取得できるために設定ファイルにFastifyOptions.trustProxyを追加しました
|
||||||
|
|
|
@ -9598,6 +9598,12 @@ export interface Locale extends ILocale {
|
||||||
* サーバーメトリクス
|
* サーバーメトリクス
|
||||||
*/
|
*/
|
||||||
"serverMetric": string;
|
"serverMetric": string;
|
||||||
|
"_serverMetric": {
|
||||||
|
/**
|
||||||
|
* このサーバーではメトリクスが利用できません
|
||||||
|
*/
|
||||||
|
"notAvailable": string;
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* AiScriptコンソール
|
* AiScriptコンソール
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -2523,6 +2523,8 @@ _widgets:
|
||||||
onlineUsers: "オンラインユーザー"
|
onlineUsers: "オンラインユーザー"
|
||||||
jobQueue: "ジョブキュー"
|
jobQueue: "ジョブキュー"
|
||||||
serverMetric: "サーバーメトリクス"
|
serverMetric: "サーバーメトリクス"
|
||||||
|
_serverMetric:
|
||||||
|
notAvailable: "このサーバーではメトリクスが利用できません"
|
||||||
aiscript: "AiScriptコンソール"
|
aiscript: "AiScriptコンソール"
|
||||||
aiscriptApp: "AiScript App"
|
aiscriptApp: "AiScript App"
|
||||||
aichan: "藍"
|
aichan: "藍"
|
||||||
|
|
|
@ -135,6 +135,7 @@ export class MetaEntityService {
|
||||||
noteSearchableScope: (this.config.meilisearch == null || this.config.meilisearch.scope !== 'local') ? 'global' : 'local',
|
noteSearchableScope: (this.config.meilisearch == null || this.config.meilisearch.scope !== 'local') ? 'global' : 'local',
|
||||||
maxFileSize: this.config.maxFileSize,
|
maxFileSize: this.config.maxFileSize,
|
||||||
federation: this.meta.federation,
|
federation: this.meta.federation,
|
||||||
|
enableServerMachineStats: instance.enableServerMachineStats,
|
||||||
};
|
};
|
||||||
|
|
||||||
return packed;
|
return packed;
|
||||||
|
|
|
@ -310,6 +310,10 @@ export const packedMetaLiteSchema = {
|
||||||
enum: ['all', 'specified', 'none'],
|
enum: ['all', 'specified', 'none'],
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
},
|
},
|
||||||
|
enableServerMachineStats: {
|
||||||
|
type: 'boolean',
|
||||||
|
optional: false, nullable: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
|
|
|
@ -68,11 +68,17 @@ const props = defineProps<{
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const _widgetDefs = computed(() => {
|
const _widgetDefs = computed(() => {
|
||||||
|
let wd = widgetDefs;
|
||||||
|
|
||||||
if (instance.federation === 'none') {
|
if (instance.federation === 'none') {
|
||||||
return widgetDefs.filter(x => !federationWidgets.includes(x));
|
wd = wd.filter(x => !federationWidgets.includes(x));
|
||||||
} else {
|
|
||||||
return widgetDefs;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!instance.enableServerMachineStats) {
|
||||||
|
wd = wd.filter(x => x !== 'serverMetric');
|
||||||
|
}
|
||||||
|
|
||||||
|
return wd;
|
||||||
});
|
});
|
||||||
|
|
||||||
const _widgets = computed(() => props.widgets.filter(x => _widgetDefs.value.includes(x.name)));
|
const _widgets = computed(() => props.widgets.filter(x => _widgetDefs.value.includes(x.name)));
|
||||||
|
|
|
@ -10,7 +10,8 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<template #func="{ buttonStyleClass }"><button class="_button" :class="buttonStyleClass" @click="toggleView()"><i class="ti ti-selector"></i></button></template>
|
<template #func="{ buttonStyleClass }"><button class="_button" :class="buttonStyleClass" @click="toggleView()"><i class="ti ti-selector"></i></button></template>
|
||||||
|
|
||||||
<div v-if="meta" data-cy-mkw-serverMetric class="mkw-serverMetric">
|
<div v-if="meta" data-cy-mkw-serverMetric class="mkw-serverMetric">
|
||||||
<XCpuMemory v-if="widgetProps.view === 0" :connection="connection" :meta="meta"/>
|
<div v-if="!instance.enableServerMachineStats" :class="$style.notAvailable">{{ i18n.ts._widgets._serverMetric.notAvailable }}</div>
|
||||||
|
<XCpuMemory v-else-if="widgetProps.view === 0" :connection="connection" :meta="meta"/>
|
||||||
<XNet v-else-if="widgetProps.view === 1" :connection="connection" :meta="meta"/>
|
<XNet v-else-if="widgetProps.view === 1" :connection="connection" :meta="meta"/>
|
||||||
<XCpu v-else-if="widgetProps.view === 2" :connection="connection" :meta="meta"/>
|
<XCpu v-else-if="widgetProps.view === 2" :connection="connection" :meta="meta"/>
|
||||||
<XMemory v-else-if="widgetProps.view === 3" :connection="connection" :meta="meta"/>
|
<XMemory v-else-if="widgetProps.view === 3" :connection="connection" :meta="meta"/>
|
||||||
|
@ -34,6 +35,7 @@ import type { FormWithDefault, GetFormResultType } from '@/utility/form.js';
|
||||||
import { misskeyApiGet } from '@/utility/misskey-api.js';
|
import { misskeyApiGet } from '@/utility/misskey-api.js';
|
||||||
import { useStream } from '@/stream.js';
|
import { useStream } from '@/stream.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
|
import { instance } from '@/instance.js';
|
||||||
|
|
||||||
const name = 'serverMetric';
|
const name = 'serverMetric';
|
||||||
|
|
||||||
|
@ -90,3 +92,12 @@ defineExpose<WidgetComponentExpose>({
|
||||||
id: props.widget ? props.widget.id : null,
|
id: props.widget ? props.widget.id : null,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style module>
|
||||||
|
.notAvailable {
|
||||||
|
text-align: center;
|
||||||
|
padding: 32px 16px;
|
||||||
|
color: var(--text-muted);
|
||||||
|
font-size: 0.9em;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
@ -5449,6 +5449,7 @@ export type components = {
|
||||||
maxFileSize: number;
|
maxFileSize: number;
|
||||||
/** @enum {string} */
|
/** @enum {string} */
|
||||||
federation: 'all' | 'specified' | 'none';
|
federation: 'all' | 'specified' | 'none';
|
||||||
|
enableServerMachineStats: boolean;
|
||||||
};
|
};
|
||||||
MetaDetailedOnly: {
|
MetaDetailedOnly: {
|
||||||
features?: {
|
features?: {
|
||||||
|
|
Loading…
Reference in New Issue