mirror of
https://github.com/hi2shark/nazhua.git
synced 2026-01-20 02:59:37 +08:00
Compare commits
No commits in common. "ff751484f4b27b22b3494e8210a14a236ad5de06" and "0606ba918de2fb681be5c55e6bd67e1776463235" have entirely different histories.
ff751484f4
...
0606ba918d
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "nazhua",
|
"name": "nazhua",
|
||||||
"version": "0.4.15",
|
"version": "0.4.14",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@ -59,28 +59,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
|
||||||
v-if="temperatureData.list.length"
|
|
||||||
class="server-info-group server-info--temperature"
|
|
||||||
>
|
|
||||||
<div class="server-info-label">
|
|
||||||
温度
|
|
||||||
</div>
|
|
||||||
<div class="server-info-content">
|
|
||||||
<div class="server-info-item-group">
|
|
||||||
<span
|
|
||||||
v-for="(ttItem, ttIndex) in temperatureData.list"
|
|
||||||
:key="`${info.ID}_temperature_${ttIndex}`"
|
|
||||||
class="server-info-item"
|
|
||||||
:class="`temperature--${ttItem.type}`"
|
|
||||||
:title="ttItem?.title || ''"
|
|
||||||
>
|
|
||||||
<span class="server-info-item-label">{{ ttItem.label }}</span>
|
|
||||||
<span class="server-info-item-value">{{ ttItem.value }}</span>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="server-info-group server-info--system-os">
|
<div class="server-info-group server-info--system-os">
|
||||||
<div class="server-info-label">
|
<div class="server-info-label">
|
||||||
系统
|
系统
|
||||||
@ -296,107 +274,6 @@ const sysLoadInfo = computed(() => {
|
|||||||
return '-';
|
return '-';
|
||||||
});
|
});
|
||||||
|
|
||||||
const temperatureData = computed(() => {
|
|
||||||
const data = [];
|
|
||||||
if (props.info?.State?.Temperatures) {
|
|
||||||
const acpitz = [];
|
|
||||||
const coretemp_package_id = [];
|
|
||||||
const coretemp_core = [];
|
|
||||||
const other = [];
|
|
||||||
props.info.State.Temperatures.forEach((item) => {
|
|
||||||
if (item.Name.indexOf('acpitz') === 0) {
|
|
||||||
acpitz.push(item.Temperature);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (item.Name.indexOf('coretemp_package_id_') === 0) {
|
|
||||||
const coreIndex = parseInt(item.Name.replace('coretemp_package_id_', ''), 10);
|
|
||||||
coretemp_package_id.push({
|
|
||||||
index: coreIndex,
|
|
||||||
value: `${item.Temperature}℃`,
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (item.Name.indexOf('coretemp_core_') === 0) {
|
|
||||||
const coreIndex = parseInt(item.Name.replace('coretemp_core_', ''), 10);
|
|
||||||
coretemp_core.push({
|
|
||||||
index: coreIndex,
|
|
||||||
value: item.Temperature,
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// console.log(item);
|
|
||||||
other.push({
|
|
||||||
label: item.Name,
|
|
||||||
value: `${item.Temperature}℃`,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
if (acpitz.length) {
|
|
||||||
data.push({
|
|
||||||
label: '主板',
|
|
||||||
value: `${acpitz[0]}℃`,
|
|
||||||
type: 'acpitz',
|
|
||||||
});
|
|
||||||
if (acpitz.length) {
|
|
||||||
const acpitzMean = (acpitz.reduce((a, b) => a + b, 0) / acpitz.length).toFixed(1) * 1;
|
|
||||||
data.push({
|
|
||||||
label: '主板平均',
|
|
||||||
value: `${acpitzMean}℃`,
|
|
||||||
title: acpitz.map((i, index) => `传感器${index + 1}: ${i}℃`).join('\n'),
|
|
||||||
type: 'acpitz-mean',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (coretemp_package_id.length) {
|
|
||||||
data.push({
|
|
||||||
label: 'CPU温度',
|
|
||||||
value: coretemp_package_id.map((i) => i.value).join(', '),
|
|
||||||
title: coretemp_package_id.length > 1
|
|
||||||
? coretemp_package_id.map((i) => `CPU.${i.index + 1}: ${i.value}`).join('\n')
|
|
||||||
: '',
|
|
||||||
type: 'coretemp-package',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (coretemp_core.length) {
|
|
||||||
const coretempCoreMean = (coretemp_core.reduce((a, b) => a + b.value, 0) / coretemp_core.length).toFixed(1) * 1;
|
|
||||||
data.push({
|
|
||||||
label: '核心平均',
|
|
||||||
value: `${coretempCoreMean}℃`,
|
|
||||||
title: coretemp_core.map((i) => `核心${i.index + 1}: ${i.value}℃`).join('\n'),
|
|
||||||
type: 'coretemp-core',
|
|
||||||
});
|
|
||||||
// 最高温度的核心
|
|
||||||
let max;
|
|
||||||
let maxCore;
|
|
||||||
coretemp_core.forEach((i) => {
|
|
||||||
if (max === undefined || i.value > max) {
|
|
||||||
max = i.value;
|
|
||||||
maxCore = i.index;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// 当最高温度的核心温度比平均温度高 20% 时,显示
|
|
||||||
if (max / coretempCoreMean > 1.2) {
|
|
||||||
data.push({
|
|
||||||
label: `最热核心.${maxCore + 1}`,
|
|
||||||
value: `${max}℃`,
|
|
||||||
type: 'coretemp-max-core',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (other.length) {
|
|
||||||
data.push({
|
|
||||||
type: 'other',
|
|
||||||
label: '其它',
|
|
||||||
value: '...',
|
|
||||||
title: other.map((i) => `${i.label}: ${i.value}`).join('\n'),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
list: data,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
billAndPlan,
|
billAndPlan,
|
||||||
} = handleServerBillAndPlan({
|
} = handleServerBillAndPlan({
|
||||||
@ -515,13 +392,6 @@ const processCount = computed(() => props.info?.State?.ProcessCount);
|
|||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
gap: 0 12px;
|
gap: 0 12px;
|
||||||
|
|
||||||
&.temperature--other {
|
|
||||||
// 移动端不显示
|
|
||||||
@media screen and (max-width: 768px) {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.server-info-item {
|
.server-info-item {
|
||||||
|
|||||||
@ -48,7 +48,7 @@
|
|||||||
>
|
>
|
||||||
<span class="text">
|
<span class="text">
|
||||||
<span class="text-item value-text">{{ billAndPlan.billing.value }}</span>
|
<span class="text-item value-text">{{ billAndPlan.billing.value }}</span>
|
||||||
<template v-if="!billAndPlan.billing.isFree && billAndPlan.billing.cycleLabel">
|
<template v-if="!billAndPlan.billing.isFree">
|
||||||
<span class="text-item">/</span>
|
<span class="text-item">/</span>
|
||||||
<span class="text-item label-text">{{ billAndPlan.billing.cycleLabel }}</span>
|
<span class="text-item label-text">{{ billAndPlan.billing.cycleLabel }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user