mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-04 16:34:52 +03:00
fix(overview): report the CPU clock speed
This commit is contained in:
@@ -268,7 +268,11 @@ export default function IndexPage() {
|
||||
detail={
|
||||
status.resourceScope === 'container'
|
||||
? `${status.logicalPro} vCPU`
|
||||
: `${CPUFormatter.cpuCoreFormat(status.cpuCores)} / ${status.logicalPro}T · ${CPUFormatter.cpuSpeedFormat(status.cpuSpeedMhz)}`
|
||||
: CPUFormatter.cpuSpecFormat(
|
||||
status.cpuCores,
|
||||
status.logicalPro,
|
||||
status.cpuSpeedMhz,
|
||||
)
|
||||
}
|
||||
footLeft={metricFoot(
|
||||
t('pages.index.avg'),
|
||||
|
||||
@@ -763,6 +763,11 @@ export class CPUFormatter {
|
||||
static cpuCoreFormat(cores: number): string {
|
||||
return cores === 1 ? '1 Core' : cores + ' Cores';
|
||||
}
|
||||
|
||||
static cpuSpecFormat(cores: number, threads: number, speedMhz: number): string {
|
||||
const spec = `${CPUFormatter.cpuCoreFormat(cores)} / ${threads}T`;
|
||||
return speedMhz > 0 ? `${spec} · ${CPUFormatter.cpuSpeedFormat(speedMhz)}` : spec;
|
||||
}
|
||||
}
|
||||
|
||||
export class TimeFormatter {
|
||||
|
||||
Reference in New Issue
Block a user