fix: 🐛 don't show server stats in widget if reporting is disabled

Closes #10527
This commit is contained in:
ThatOneCalculator 2023-07-25 21:49:09 -07:00
parent 92a0952794
commit 03ddc970d5
No known key found for this signature in database
GPG Key ID: 8703CACD01000000
2 changed files with 12 additions and 1 deletions

View File

@ -394,6 +394,12 @@ export const meta = {
optional: "true", optional: "true",
nullable: true, nullable: true,
}, },
enableServerMachineStats: {
type: "boolean",
optional: "true",
nullable: false,
default: false,
},
}, },
}, },
} as const; } as const;
@ -497,6 +503,8 @@ export default define(meta, paramDef, async (ps, me) => {
instance.deeplAuthKey != null || instance.libreTranslateApiUrl != null, instance.deeplAuthKey != null || instance.libreTranslateApiUrl != null,
defaultReaction: instance.defaultReaction, defaultReaction: instance.defaultReaction,
donationLink: instance.donationLink, donationLink: instance.donationLink,
enableServerMachineStats: instance.enableServerMachineStats,
enableIdenticonGeneration: instance.enableIdenticonGeneration,
...(ps.detail ...(ps.detail
? { ? {

View File

@ -12,7 +12,10 @@
<i class="ph-sort-ascending ph-bold ph-lg"></i></button <i class="ph-sort-ascending ph-bold ph-lg"></i></button
></template> ></template>
<div v-if="meta" class="mkw-serverMetric"> <div
v-if="meta && instance.enableServerMachineStats"
class="mkw-serverMetric"
>
<XCpuMemory <XCpuMemory
v-if="widgetProps.view === 0" v-if="widgetProps.view === 0"
:connection="connection" :connection="connection"