mirror of
https://github.com/hi2shark/nazhua.git
synced 2026-01-17 09:40:42 +08:00
合并最新的变动到i18n分支
This commit is contained in:
commit
1222c2c825
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "nazhua",
|
"name": "nazhua",
|
||||||
"version": "0.6.0",
|
"version": "0.6.2",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@ -27,6 +27,7 @@ window.$$nazhuaConfig = {
|
|||||||
// hideListItemStatusDonut: false, // 隐藏列表项的饼图
|
// hideListItemStatusDonut: false, // 隐藏列表项的饼图
|
||||||
// hideListItemStat: false, // 隐藏列表项的统计信息
|
// hideListItemStat: false, // 隐藏列表项的统计信息
|
||||||
// hideListItemBill: false, // 隐藏列表项的账单信息
|
// hideListItemBill: false, // 隐藏列表项的账单信息
|
||||||
|
hideListItemLink: true, // 隐藏列表项的购买链接
|
||||||
// hideFilter: false, // 隐藏筛选
|
// hideFilter: false, // 隐藏筛选
|
||||||
// hideTag: false, // 隐藏标签
|
// hideTag: false, // 隐藏标签
|
||||||
// hideDotBG: true, // 隐藏框框里面的点点背景
|
// hideDotBG: true, // 隐藏框框里面的点点背景
|
||||||
|
|||||||
@ -46,68 +46,146 @@ export function getCPUInfo(text = '') {
|
|||||||
[cpuInfo.model] = modelMatch;
|
[cpuInfo.model] = modelMatch;
|
||||||
}
|
}
|
||||||
if (text.includes('Ryzen')) {
|
if (text.includes('Ryzen')) {
|
||||||
// 5900X 5950X 7900X 7950X 9900X 9950X
|
// 匹配各种Ryzen型号:
|
||||||
const modelNumReg = /Ryzen.*(\d{4}X)/;
|
// - 标准型号: 5900X, 5950X, 7900X, 7950X, 9900X, 9950X
|
||||||
|
// - 普通型号: 3600, 5600, 7600
|
||||||
|
// - G系列APU: 5700G, 3400G
|
||||||
|
// - XT系列: 3600XT, 5600XT
|
||||||
|
// - 移动版: 4800U, 5800H, 6800HS
|
||||||
|
const modelNumReg = /Ryzen\s*(?:\d|(?:TR))\s*(?:\d{4}(?:[A-Z]{1,2})?)/;
|
||||||
const modelNumMatch = text.match(modelNumReg);
|
const modelNumMatch = text.match(modelNumReg);
|
||||||
if (modelNumMatch) {
|
if (modelNumMatch) {
|
||||||
[, cpuInfo.modelNum] = modelNumMatch;
|
cpuInfo.modelNum = modelNumMatch[0].replace(/Ryzen\s*(?:\d|(?:TR))\s*/, '');
|
||||||
|
} else {
|
||||||
|
// 备用正则表达式,尝试匹配其他可能的格式
|
||||||
|
const altModelNumReg = /Ryzen.*?(\d{3,4}(?:[A-Z]{0,2}))/;
|
||||||
|
const altModelNumMatch = text.match(altModelNumReg);
|
||||||
|
if (altModelNumMatch) {
|
||||||
|
[, cpuInfo.modelNum] = altModelNumMatch;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (text.includes('EPYC')) {
|
if (text.includes('EPYC')) {
|
||||||
// 7B13 7B13 9654...
|
// 匹配各种EPYC型号:
|
||||||
const modelNumReg = /EPYC (\w{4})/;
|
// - 第一代: 7001系列 (7351, 7551, 7601)
|
||||||
|
// - 第二代: 7002系列 (7252, 7542, 7742)
|
||||||
|
// - 第三代: 7003系列 (7313, 7543, 7763)
|
||||||
|
// - 第四代: 9004系列 (9124, 9354, 9654)
|
||||||
|
// - 特殊系列: 7Fxx, 7Hxx, 7Bxx (7F72, 7H12, 7B13)
|
||||||
|
const modelNumReg = /EPYC\s+(\d[A-Z0-9]{2,4})/i;
|
||||||
const modelNumMatch = text.match(modelNumReg);
|
const modelNumMatch = text.match(modelNumReg);
|
||||||
if (modelNumMatch) {
|
if (modelNumMatch) {
|
||||||
[, cpuInfo.modelNum] = modelNumMatch;
|
[, cpuInfo.modelNum] = modelNumMatch;
|
||||||
|
} else {
|
||||||
|
// 备用匹配,处理可能的其他格式
|
||||||
|
const altModelNumReg = /EPYC.*?(\d{4,5}[A-Z]?)/i;
|
||||||
|
const altModelNumMatch = text.match(altModelNumReg);
|
||||||
|
if (altModelNumMatch) {
|
||||||
|
[, cpuInfo.modelNum] = altModelNumMatch;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 匹配特定的CPU型号编号
|
// 匹配特定的CPU型号编号
|
||||||
if (text.includes('Xeon')) {
|
if (text.includes('Xeon')) {
|
||||||
|
// 匹配所有Xeon处理器系列
|
||||||
|
// - E系列: E3, E5, E7等
|
||||||
|
// - 金属系列: Platinum, Gold, Silver, Bronze
|
||||||
|
// - 数字系列: W-1290, D-1653N等
|
||||||
|
// - 扩展名系列: L, X, M, D等(如X7560, L5640)
|
||||||
if (text.includes(' E')) {
|
if (text.includes(' E')) {
|
||||||
// Xeon型号
|
const modelNumReg = /(E\d-\d{4}(?:\s?v\d)?)/;
|
||||||
const modelNumReg = /(E\d-\w+)/;
|
|
||||||
const modelNumMatch = text.match(modelNumReg);
|
const modelNumMatch = text.match(modelNumReg);
|
||||||
if (modelNumMatch) {
|
if (modelNumMatch) {
|
||||||
[, cpuInfo.modelNum] = modelNumMatch;
|
[, cpuInfo.modelNum] = modelNumMatch;
|
||||||
}
|
}
|
||||||
}
|
} else if (text.includes('Platinum')) {
|
||||||
if (text.includes('Gold')) {
|
const modelNumReg = /(?:Platinum\s+)(\d{4}(?:\w)?)/;
|
||||||
// Xeon型号
|
|
||||||
const modelNumReg = /(Gold\s\w+)/;
|
|
||||||
const modelNumMatch = text.match(modelNumReg);
|
const modelNumMatch = text.match(modelNumReg);
|
||||||
if (modelNumMatch) {
|
if (modelNumMatch) {
|
||||||
[, cpuInfo.modelNum] = modelNumMatch;
|
[, cpuInfo.modelNum] = modelNumMatch;
|
||||||
}
|
}
|
||||||
|
} else if (text.includes('Gold')) {
|
||||||
|
const modelNumReg = /(?:Gold\s+)(\d{4}(?:\w)?)/;
|
||||||
|
const modelNumMatch = text.match(modelNumReg);
|
||||||
|
if (modelNumMatch) {
|
||||||
|
[, cpuInfo.modelNum] = modelNumMatch;
|
||||||
|
}
|
||||||
|
} else if (text.includes('Silver')) {
|
||||||
|
const modelNumReg = /(?:Silver\s+)(\d{4}(?:\w)?)/;
|
||||||
|
const modelNumMatch = text.match(modelNumReg);
|
||||||
|
if (modelNumMatch) {
|
||||||
|
[, cpuInfo.modelNum] = modelNumMatch;
|
||||||
|
}
|
||||||
|
} else if (text.includes('Bronze')) {
|
||||||
|
const modelNumReg = /(?:Bronze\s+)(\d{4}(?:\w)?)/;
|
||||||
|
const modelNumMatch = text.match(modelNumReg);
|
||||||
|
if (modelNumMatch) {
|
||||||
|
[, cpuInfo.modelNum] = modelNumMatch;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 通用Xeon型号匹配
|
||||||
|
const genericXeonReg = /Xeon(?:\(R\))?\s+(?:\w+-)?((?:W|D)?-?\d{4,5}(?:\w)?)/;
|
||||||
|
const genericMatch = text.match(genericXeonReg);
|
||||||
|
if (genericMatch) {
|
||||||
|
[, cpuInfo.modelNum] = genericMatch;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (text.includes('Core(TM)')) {
|
|
||||||
const modelNumReg = /Core\(TM\) (\w+-\w+)/;
|
if (text.includes('Core')) {
|
||||||
|
if (text.includes('Core(TM)')) {
|
||||||
|
// 匹配如 Core(TM) i7-10700K 等格式
|
||||||
|
const modelNumReg = /Core\(TM\)\s+(\w\d+-\w+)/;
|
||||||
|
const modelNumMatch = text.match(modelNumReg);
|
||||||
|
if (modelNumMatch) {
|
||||||
|
[, cpuInfo.modelNum] = modelNumMatch;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 匹配如 Core i9-12900K, Core i5-13600K 等格式
|
||||||
|
const coreReg = /Core\s+(i[3579]-\d{4,5}(?:\w+)?)/i;
|
||||||
|
const coreMatch = text.match(coreReg);
|
||||||
|
if (coreMatch) {
|
||||||
|
[, cpuInfo.modelNum] = coreMatch;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (text.includes('Celeron')) {
|
||||||
|
const modelNumReg = /Celeron(?:\(R\))?\s+(\w+\d+(?:\w+)?)/;
|
||||||
const modelNumMatch = text.match(modelNumReg);
|
const modelNumMatch = text.match(modelNumReg);
|
||||||
if (modelNumMatch) {
|
if (modelNumMatch) {
|
||||||
[, cpuInfo.modelNum] = modelNumMatch;
|
[, cpuInfo.modelNum] = modelNumMatch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (text.includes('Celeron(R)')) {
|
|
||||||
const modelNumReg = /Celeron\(R\) (\w+)/;
|
if (text.includes('Pentium')) {
|
||||||
const modelNumMatch = text.match(modelNumReg);
|
const modelNumReg = /Pentium(?:\(R\))?\s+(\w+\d+(?:\w+)?)/;
|
||||||
if (modelNumMatch) {
|
|
||||||
[, cpuInfo.modelNum] = modelNumMatch;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (text.includes('Pentium(R)')) {
|
|
||||||
const modelNumReg = /Pentium\(R\) (\w+)/;
|
|
||||||
const modelNumMatch = text.match(modelNumReg);
|
const modelNumMatch = text.match(modelNumReg);
|
||||||
if (modelNumMatch) {
|
if (modelNumMatch) {
|
||||||
[, cpuInfo.modelNum] = modelNumMatch;
|
[, cpuInfo.modelNum] = modelNumMatch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (text.includes('Intel(R) N')) {
|
if (text.includes('Intel(R) N')) {
|
||||||
const modelNumReg = /Intel\(R\) (N\d+)/;
|
const modelNumReg = /Intel\(R\)\s+(N\d+(?:\w+)?)/;
|
||||||
const modelNumMatch = text.match(modelNumReg);
|
const modelNumMatch = text.match(modelNumReg);
|
||||||
if (modelNumMatch) {
|
if (modelNumMatch) {
|
||||||
[, cpuInfo.modelNum] = modelNumMatch;
|
[, cpuInfo.modelNum] = modelNumMatch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 匹配Apple M系列芯片
|
||||||
|
if (text.includes('Apple') && text.match(/M\d/)) {
|
||||||
|
// 匹配各种Apple Silicon M系列芯片:
|
||||||
|
// - 基本型号: M1, M2, M3等
|
||||||
|
// - 变种型号: M1 Pro, M2 Max, M3 Ultra等
|
||||||
|
const appleChipReg = /Apple\s+(?:Silicon\s+)?M(\d+(?:\s+(?:Pro|Max|Ultra|Extreme))?)/i;
|
||||||
|
const appleChipMatch = text.match(appleChipReg);
|
||||||
|
if (appleChipMatch) {
|
||||||
|
[, cpuInfo.modelNum] = appleChipMatch;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (coresMatch) {
|
if (coresMatch) {
|
||||||
[cpuInfo.core, cpuInfo.cores] = coresMatch;
|
[cpuInfo.core, cpuInfo.cores] = coresMatch;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -78,8 +78,27 @@
|
|||||||
class="server-info-item"
|
class="server-info-item"
|
||||||
:class="`temperature--${ttItem.type}`"
|
:class="`temperature--${ttItem.type}`"
|
||||||
>
|
>
|
||||||
<span class="server-info-item-label">
|
<span class="server-info-item-icon">
|
||||||
{{ ttItem.label }}
|
<i
|
||||||
|
v-if="ttItem.type === 'cpu' || ttItem.label.toLowerCase().includes('cpu')"
|
||||||
|
class="ri-cpu-line"
|
||||||
|
/>
|
||||||
|
<i
|
||||||
|
v-else-if="ttItem.type === 'gpu' || ttItem.label.toLowerCase().includes('gpu')"
|
||||||
|
class="ri-gamepad-line"
|
||||||
|
/>
|
||||||
|
<i
|
||||||
|
v-else-if="ttItem.type === 'nvme' || ttItem.label.toLowerCase().includes('nvme')"
|
||||||
|
class="ri-hard-drive-3-line"
|
||||||
|
/>
|
||||||
|
<i
|
||||||
|
v-else-if="ttItem.type === 'motherboard'"
|
||||||
|
class="ri-instance-line"
|
||||||
|
/>
|
||||||
|
<i
|
||||||
|
v-else
|
||||||
|
class="ri-temp-hot-line"
|
||||||
|
/>
|
||||||
</span>
|
</span>
|
||||||
<span class="server-info-item-value">
|
<span class="server-info-item-value">
|
||||||
{{ ttItem.value }}
|
{{ ttItem.value }}
|
||||||
@ -331,96 +350,157 @@ const temperatureData = computed(() => {
|
|||||||
const acpitz = [];
|
const acpitz = [];
|
||||||
const coretemp_package_id = [];
|
const coretemp_package_id = [];
|
||||||
const coretemp_core = [];
|
const coretemp_core = [];
|
||||||
|
const nvme = [];
|
||||||
|
const k10temp = [];
|
||||||
|
const amdgpu = [];
|
||||||
const other = [];
|
const other = [];
|
||||||
|
|
||||||
|
// 温度数据分类处理
|
||||||
props.info.State.Temperatures.forEach((item) => {
|
props.info.State.Temperatures.forEach((item) => {
|
||||||
if (item.Name.indexOf('acpitz') === 0) {
|
const name = item.Name.toLowerCase();
|
||||||
acpitz.push(item.Temperature);
|
const temp = item.Temperature;
|
||||||
|
|
||||||
|
if (name.startsWith('acpitz')) {
|
||||||
|
acpitz.push(temp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (item.Name.indexOf('coretemp_package_id_') === 0) {
|
if (name.startsWith('coretemp_package_id_')) {
|
||||||
const coreIndex = parseInt(item.Name.replace('coretemp_package_id_', ''), 10);
|
const coreIndex = parseInt(name.replace('coretemp_package_id_', ''), 10);
|
||||||
coretemp_package_id.push({
|
coretemp_package_id.push({
|
||||||
index: coreIndex,
|
index: coreIndex,
|
||||||
value: `${item.Temperature}℃`,
|
value: temp,
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (item.Name.indexOf('coretemp_core_') === 0) {
|
if (name.startsWith('coretemp_core_')) {
|
||||||
const coreIndex = parseInt(item.Name.replace('coretemp_core_', ''), 10);
|
const coreIndex = parseInt(name.replace('coretemp_core_', ''), 10);
|
||||||
coretemp_core.push({
|
coretemp_core.push({
|
||||||
index: coreIndex,
|
index: coreIndex,
|
||||||
value: item.Temperature,
|
value: temp,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (name.includes('nvme')) {
|
||||||
|
nvme.push({
|
||||||
|
name: item.Name,
|
||||||
|
value: temp,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (name.includes('k10temp')) {
|
||||||
|
k10temp.push({
|
||||||
|
name: item.Name,
|
||||||
|
value: temp,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (name.includes('amdgpu')) {
|
||||||
|
amdgpu.push({
|
||||||
|
name: item.Name,
|
||||||
|
value: temp,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (name.includes('motherboard') || name.includes('mainboard') || name.includes('board')) {
|
||||||
|
other.push({
|
||||||
|
label: '主板',
|
||||||
|
value: temp,
|
||||||
|
type: 'motherboard',
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// console.log(item);
|
|
||||||
other.push({
|
other.push({
|
||||||
label: item.Name,
|
label: item.Name,
|
||||||
value: `${item.Temperature}℃`,
|
value: temp,
|
||||||
|
type: 'other',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 主板温度处理
|
||||||
if (acpitz.length) {
|
if (acpitz.length) {
|
||||||
|
const acpitzMean = (acpitz.reduce((a, b) => a + b, 0) / acpitz.length).toFixed(1);
|
||||||
data.push({
|
data.push({
|
||||||
label: i18n.t('acpitz'),
|
label: i18n.t('acpitz'),
|
||||||
value: `${acpitz[0]}℃`,
|
value: `${acpitzMean}℃`,
|
||||||
|
title: acpitz.map((i, index) => `传感器${index + 1}: ${parseFloat(i).toFixed(1)}℃`).join('\n'),
|
||||||
type: 'acpitz',
|
type: 'acpitz',
|
||||||
});
|
});
|
||||||
if (acpitz.length) {
|
}
|
||||||
const acpitzMean = (acpitz.reduce((a, b) => a + b, 0) / acpitz.length).toFixed(1) * 1;
|
|
||||||
|
// CPU温度处理
|
||||||
|
if (coretemp_package_id.length || coretemp_core.length) {
|
||||||
|
const temps = [];
|
||||||
|
const details = [];
|
||||||
|
|
||||||
|
// 处理 CPU 温度
|
||||||
|
if (coretemp_package_id.length) {
|
||||||
|
const cpuTemps = coretemp_package_id.map((i) => `${parseFloat(i.value).toFixed(1)}℃`);
|
||||||
|
temps.push(cpuTemps.join(', '));
|
||||||
|
details.push(...coretemp_package_id.map((i) => `CPU.${i.index + 1}: ${parseFloat(i.value).toFixed(1)}℃`));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理核心温度
|
||||||
|
if (coretemp_core.length) {
|
||||||
|
const coreMean = (coretemp_core.reduce((a, b) => a + b.value, 0) / coretemp_core.length).toFixed(1);
|
||||||
|
temps.push(`${parseFloat(coreMean).toFixed(1)}℃`);
|
||||||
|
details.push(...coretemp_core.map((i) => `核心${i.index + 1}: ${parseFloat(i.value).toFixed(1)}℃`));
|
||||||
|
}
|
||||||
|
|
||||||
|
data.push({
|
||||||
|
label: 'CPU',
|
||||||
|
value: temps.join(' / '),
|
||||||
|
title: details.join('\n'),
|
||||||
|
type: 'cpu',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// AMD CPU温度处理
|
||||||
|
if (k10temp.length) {
|
||||||
|
const tctl = k10temp.find((i) => i.name.includes('tctl'));
|
||||||
|
if (tctl) {
|
||||||
data.push({
|
data.push({
|
||||||
label: i18n.t('acpitzMean'),
|
label: 'AMD CPU',
|
||||||
value: `${acpitzMean}℃`,
|
value: `${parseFloat(tctl.value).toFixed(1)}℃`,
|
||||||
title: acpitz.map((i, index) => `传感器${index + 1}: ${i}℃`).join('\n'),
|
title: k10temp.map((i) => `${i.name}: ${parseFloat(i.value).toFixed(1)}℃`).join('\n'),
|
||||||
type: 'acpitz-mean',
|
type: 'cpu',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (coretemp_package_id.length) {
|
|
||||||
data.push({
|
// AMD GPU温度处理
|
||||||
label: i18n.t('coretempPackage'),
|
if (amdgpu.length) {
|
||||||
value: coretemp_package_id.map((i) => i.value).join(', '),
|
const edge = amdgpu.find((i) => i.name.includes('edge'));
|
||||||
title: coretemp_package_id.length > 1
|
if (edge) {
|
||||||
? 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: i18n.t('coretempCoreMean'),
|
|
||||||
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({
|
data.push({
|
||||||
label: `${i18n.t('coretempMaxCore')}.${maxCore + 1}`,
|
label: 'AMD GPU',
|
||||||
value: `${max}℃`,
|
value: `${parseFloat(edge.value).toFixed(1)}℃`,
|
||||||
type: 'coretemp-max-core',
|
title: amdgpu.map((i) => `${i.name}: ${parseFloat(i.value).toFixed(1)}℃`).join('\n'),
|
||||||
|
type: 'gpu',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (other.length) {
|
|
||||||
other.forEach((i) => {
|
// NVME温度处理
|
||||||
|
if (nvme.length) {
|
||||||
|
const composite = nvme.find((i) => i.name.includes('composite'));
|
||||||
|
if (composite) {
|
||||||
data.push({
|
data.push({
|
||||||
label: i.label,
|
label: 'NVME',
|
||||||
value: i.value,
|
value: `${parseFloat(composite.value).toFixed(1)}℃`,
|
||||||
type: 'other',
|
title: nvme.map((i) => `${i.name}: ${parseFloat(i.value).toFixed(1)}℃`).join('\n'),
|
||||||
|
type: 'nvme',
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 其他温度处理
|
||||||
|
other.forEach((i) => {
|
||||||
|
data.push({
|
||||||
|
label: i.label,
|
||||||
|
value: `${parseFloat(i.value).toFixed(1)}℃`,
|
||||||
|
type: i.type || 'other',
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
list: data,
|
list: data,
|
||||||
@ -571,6 +651,17 @@ const processCount = computed(() => props.info?.State?.ProcessCount);
|
|||||||
.server-info-item {
|
.server-info-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 0.2em;
|
gap: 0.2em;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.server-info-item-icon {
|
||||||
|
width: 24px;
|
||||||
|
height: 16px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #ccc;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.server-info-item-value {
|
.server-info-item-value {
|
||||||
|
|||||||
@ -82,6 +82,9 @@
|
|||||||
'--cate-color': cateItem.color,
|
'--cate-color': cateItem.color,
|
||||||
}"
|
}"
|
||||||
@click="toggleShowCate(cateItem.id)"
|
@click="toggleShowCate(cateItem.id)"
|
||||||
|
@touchstart="handleTouchStart(cateItem.id)"
|
||||||
|
@touchend="handleTouchEnd(cateItem.id)"
|
||||||
|
@touchmove="handleTouchMove(cateItem.id)"
|
||||||
>
|
>
|
||||||
<span class="cate-legend" />
|
<span class="cate-legend" />
|
||||||
<span
|
<span
|
||||||
@ -174,8 +177,8 @@ const minutes = [{
|
|||||||
const refreshData = ref(true);
|
const refreshData = ref(true);
|
||||||
const peakShaving = ref(false);
|
const peakShaving = ref(false);
|
||||||
const showCates = ref({});
|
const showCates = ref({});
|
||||||
|
|
||||||
const monitorData = ref([]);
|
const monitorData = ref([]);
|
||||||
|
const longPressTimer = ref(null);
|
||||||
|
|
||||||
const now = ref(Date.now());
|
const now = ref(Date.now());
|
||||||
const accpetShowTime = computed(() => now.value - (minute.value * 60 * 1000));
|
const accpetShowTime = computed(() => now.value - (minute.value * 60 * 1000));
|
||||||
@ -322,9 +325,32 @@ function toggleMinute(value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function toggleShowCate(id) {
|
function toggleShowCate(id) {
|
||||||
|
if (window.innerWidth < 768) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
showCates.value[id] = !showCates.value[id];
|
showCates.value[id] = !showCates.value[id];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleTouchStart(id) {
|
||||||
|
longPressTimer.value = setTimeout(() => {
|
||||||
|
showCates.value[id] = !showCates.value[id];
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleTouchEnd() {
|
||||||
|
if (longPressTimer.value) {
|
||||||
|
clearTimeout(longPressTimer.value);
|
||||||
|
longPressTimer.value = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleTouchMove() {
|
||||||
|
if (longPressTimer.value) {
|
||||||
|
clearTimeout(longPressTimer.value);
|
||||||
|
longPressTimer.value = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function loadMonitor() {
|
async function loadMonitor() {
|
||||||
await request({
|
await request({
|
||||||
url: (
|
url: (
|
||||||
@ -553,6 +579,10 @@ onUnmounted(() => {
|
|||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
|
@media screen and (max-width: 768px) {
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
.cate-legend {
|
.cate-legend {
|
||||||
width: 0.5em;
|
width: 0.5em;
|
||||||
height: 0.5em;
|
height: 0.5em;
|
||||||
|
|||||||
@ -211,10 +211,17 @@ const platformLogoIconClassName = computed(() => hostUtils.getPlatformLogoIconCl
|
|||||||
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
|
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
&--amd {
|
&--amd {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
|
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&--apple {
|
||||||
|
font-weight: 600;
|
||||||
|
font-family: PingFang SC, Arial, "Helvetica Neue", Helvetica, sans-serif;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.cpu-model {
|
.cpu-model {
|
||||||
|
|||||||
@ -112,7 +112,12 @@ const buyBtnText = computed(() => {
|
|||||||
}
|
}
|
||||||
return config.nazhua.buyBtnText || '购买';
|
return config.nazhua.buyBtnText || '购买';
|
||||||
});
|
});
|
||||||
const showBuyBtn = computed(() => !!props.info?.PublicNote?.customData?.orderLink);
|
const showBuyBtn = computed(() => {
|
||||||
|
if (config.nazhua.hideListItemLink === true) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return !!props.info?.PublicNote?.customData?.orderLink;
|
||||||
|
});
|
||||||
|
|
||||||
function toBuy() {
|
function toBuy() {
|
||||||
const decodeUrl = decodeURIComponent(props.info?.PublicNote?.customData?.orderLink);
|
const decodeUrl = decodeURIComponent(props.info?.PublicNote?.customData?.orderLink);
|
||||||
|
|||||||
@ -234,7 +234,7 @@ const filterServerList = computed(() => {
|
|||||||
if (validate.isSet(planDataMod?.bandwidth)) {
|
if (validate.isSet(planDataMod?.bandwidth)) {
|
||||||
fields.bandwidth = true;
|
fields.bandwidth = true;
|
||||||
}
|
}
|
||||||
if (validate.isSet(customData?.orderLink)) {
|
if (validate.isSet(customData?.orderLink) && config.nazhua.hideListItemLink !== true) {
|
||||||
fields.orderLink = true;
|
fields.orderLink = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user