diff --git a/public/config.js b/public/config.js index 3357aa4..0d3dbc1 100644 --- a/public/config.js +++ b/public/config.js @@ -1,7 +1,7 @@ window.$$nazhuaConfig = { // title: '哪吒监控', // 网站标题 // freeAmount: '白嫖', // 免费服务的费用名称 - // infinityCycle: '无限', // 无限周期名称 + // infinityCycle: '长期有效', // 无限周期名称 // buyBtnText: '购买', // 购买按钮文案 // listServerStatusType: 'progress', // 服务器状态类型--列表 // detailServerStatusType: 'progress', // 服务器状态类型--详情页 @@ -18,6 +18,8 @@ window.$$nazhuaConfig = { // hideTag: false, // 隐藏标签 // hideDotBG: true, // 隐藏框框里面的点点背景 // monitorRefreshTime: 10, // 监控刷新时间间隔,单位s(秒), 0为不刷新,为保证不频繁请求源站,最低生效值为10s + // filterWeirdGPU: true, // 过滤奇怪的GPU + // filterGPUKeywords: ['Virtual Display'], // 如果GPU名称中包含这些关键字,则过滤掉 // customCodeMap: {}, // 自定义的地图点信息 // nezhaVersion: 'v1', // 哪吒版本 // apiMonitorPath: '/api/v1/monitor/{id}', diff --git a/src/utils/host.js b/src/utils/host.js index f8e880a..08eac38 100644 --- a/src/utils/host.js +++ b/src/utils/host.js @@ -45,11 +45,27 @@ export function getCPUInfo(text = '') { if (modelMatch) { [cpuInfo.model] = modelMatch; } + if (text.includes('Ryzen')) { + // 5900X 5950X 7900X 7950X 9900X 9950X + const modelNumReg = /Ryzen.*(\d{4}X)/; + const modelNumMatch = text.match(modelNumReg); + if (modelNumMatch) { + [, cpuInfo.modelNum] = modelNumMatch; + } + } + if (text.includes('EPYC')) { + // 7B13 7B13 9654... + const modelNumReg = /EPYC (\w{4})/; + const modelNumMatch = text.match(modelNumReg); + if (modelNumMatch) { + [, cpuInfo.modelNum] = modelNumMatch; + } + } // 匹配特定的CPU型号编号 if (text.includes('Xeon')) { - if (text.includes('E-')) { + if (text.includes(' E')) { // Xeon型号 - const modelNumReg = /(E\d-\S+)/; + const modelNumReg = /(E\d-\w+)/; const modelNumMatch = text.match(modelNumReg); if (modelNumMatch) { [, cpuInfo.modelNum] = modelNumMatch; @@ -64,17 +80,29 @@ export function getCPUInfo(text = '') { } } } - if (text.includes('Ryzen')) { - // 5900X 5950X 7900X 7950X 9900X 9950X - const modelNumReg = /Ryzen.*(\d{4}X)/; + if (text.includes('Core(TM)')) { + const modelNumReg = /Core\(TM\) (\w+-\w+)/; const modelNumMatch = text.match(modelNumReg); if (modelNumMatch) { [, cpuInfo.modelNum] = modelNumMatch; } } - if (text.includes('EPYC')) { - // 7B13 7B13 9654... - const modelNumReg = /EPYC (\w{4})/; + if (text.includes('Celeron(R)')) { + const modelNumReg = /Celeron\(R\) (\w+)/; + const modelNumMatch = text.match(modelNumReg); + if (modelNumMatch) { + [, cpuInfo.modelNum] = modelNumMatch; + } + } + if (text.includes('Pentium(R)')) { + const modelNumReg = /Pentium\(R\) (\w+)/; + const modelNumMatch = text.match(modelNumReg); + if (modelNumMatch) { + [, cpuInfo.modelNum] = modelNumMatch; + } + } + if (text.includes('Intel(R) N')) { + const modelNumReg = /Intel\(R\) (N\d+)/; const modelNumMatch = text.match(modelNumReg); if (modelNumMatch) { [, cpuInfo.modelNum] = modelNumMatch; diff --git a/src/views/components/server-detail/server-info-box.vue b/src/views/components/server-detail/server-info-box.vue index 7813b8b..fb9e5bd 100644 --- a/src/views/components/server-detail/server-info-box.vue +++ b/src/views/components/server-detail/server-info-box.vue @@ -5,28 +5,58 @@ CPU