Compare commits

..

No commits in common. "8e6489ba5c49a27a9b08439f7b4e9d83071e08f9" and "ffd8a878548b0a755e77551b4e9d90ba5fd7758b" have entirely different histories.

7 changed files with 38 additions and 129 deletions

View File

@ -142,9 +142,9 @@ jobs:
cat changes.txt >> body.txt
# 添加其他发布说明
echo -e "\n哪吒V1请下载dist.zip\n哪吒V0请下载v0-${{ steps.determine_version.outputs.version }}-all.zip\n至于all是全量cdn-jsdelivr是jsdelivr引用版cdn-loli是cdnjs引用版\nv0版本构建物通过修改./config.js指定nezhaVersion版本可以正常在v1中使用" >> body.txt
echo -e "\n哪吒V1请下载dist.zip\n哪吒V0请下载v0-${{ steps.determine_version.outputs.version }}-all.zip\n至于all是全量cdn-jsdelivr是jsdelivr引用版cdn-loli是cdnjs引用版\nv0版本构建物通过修改./config.js指定nezhaVersion版本可以正常在v1中使用" >> body.txt
# 更新发布说明
gh release edit v${{ steps.determine_version.outputs.version }} --notes-file body.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,6 +1,6 @@
{
"name": "nazhua",
"version": "0.4.9",
"version": "0.4.8",
"type": "module",
"scripts": {
"dev": "vite",

View File

@ -1,7 +1,7 @@
window.$$nazhuaConfig = {
// title: '哪吒监控', // 网站标题
// freeAmount: '白嫖', // 免费服务的费用名称
// infinityCycle: '长期有效', // 无限周期名称
// infinityCycle: '无限', // 无限周期名称
// buyBtnText: '购买', // 购买按钮文案
// listServerStatusType: 'progress', // 服务器状态类型--列表
// detailServerStatusType: 'progress', // 服务器状态类型--详情页
@ -18,8 +18,6 @@ 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}',

View File

@ -45,27 +45,11 @@ 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-\w+)/;
const modelNumReg = /(E\d-\S+)/;
const modelNumMatch = text.match(modelNumReg);
if (modelNumMatch) {
[, cpuInfo.modelNum] = modelNumMatch;
@ -80,29 +64,17 @@ export function getCPUInfo(text = '') {
}
}
}
if (text.includes('Core(TM)')) {
const modelNumReg = /Core\(TM\) (\w+-\w+)/;
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('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+)/;
if (text.includes('EPYC')) {
// 7B13 7B13 9654...
const modelNumReg = /EPYC (\w{4})/;
const modelNumMatch = text.match(modelNumReg);
if (modelNumMatch) {
[, cpuInfo.modelNum] = modelNumMatch;

View File

@ -5,58 +5,28 @@
CPU
</div>
<div class="server-info-content">
<template v-if="info?.Host?.CPU?.length === 1">
<span
class="cpu-info"
:title="info.Host.CPU[0]"
>
<span>{{ info.Host.CPU[0] }}</span>
</span>
</template>
<div
v-else
class="server-info-item-group"
<span
class="cpu-info"
:title="info?.Host?.CPU?.[0]"
>
<span
v-for="(cpuItem, cpuIndex) in info.Host.CPU"
:key="`${info.ID}_cpu_${cpuIndex}`"
class="server-info-item"
>
<span class="server-info-item-label">CPU.{{ cpuIndex + 1 }}</span>
<span class="server-info-item-value">{{ cpuItem }}</span>
</span>
</div>
<span>{{ info?.Host?.CPU?.[0] }}</span>
</span>
</div>
</div>
<div
v-if="gpuList.length"
v-if="info?.Host?.GPU?.[0]"
class="server-info-group server-info--gpu"
>
<div class="server-info-label">
GPU
</div>
<div class="server-info-content">
<template v-if="gpuList.length === 1">
<span
class="gpu-info"
:title="gpuList[0]"
>
<span>{{ gpuList[0] }}</span>
</span>
</template>
<div
v-else
class="server-info-item-group"
<span
class="cpu-info"
:title="info?.Host?.GPU?.[0]"
>
<span
v-for="(gpuItem, gpuIndex) in gpuList"
:key="`${info.ID}_gpu_${gpuIndex}`"
class="server-info-item"
>
<span class="server-info-item-label">GPU.{{ gpuIndex + 1 }}</span>
<span class="server-info-item-value">{{ gpuItem }}</span>
</span>
</div>
<span>{{ info?.Host?.GPU?.[0] }}</span>
</span>
</div>
</div>
<div class="server-info-group server-info--system-os">
@ -80,7 +50,7 @@
占用
</div>
<div class="server-info-content">
<div class="server-info-item-group">
<span class="server-info-item-group">
<span class="server-info-item process-count">
<span class="server-info-item-label">进程数</span>
<span class="server-info-item-value">{{ processCount }}</span>
@ -88,10 +58,10 @@
<span class="server-info-item load">
<span class="server-info-item-label">负载</span>
<span class="server-info-item-value">
{{ sysLoadInfo }}
{{ info?.State?.Load1 }},{{ info?.State?.Load5 }},{{ info?.State?.Load15 }}
</span>
</span>
</div>
</span>
</div>
</div>
<div class="server-info-group server-info--transfer">
@ -99,7 +69,7 @@
流量
</div>
<div class="server-info-content">
<div class="server-info-item-group">
<span class="server-info-item-group">
<span class="server-info-item transfer--in">
<span class="server-info-item-label">入网</span>
<span class="server-info-item-value">
@ -114,7 +84,7 @@
<span class="text-unit">{{ transfer?.out?.unit }}</span>
</span>
</span>
</div>
</span>
</div>
</div>
<div class="server-info-group server-info--conn">
@ -122,7 +92,7 @@
连接
</div>
<div class="server-info-content">
<div class="server-info-item-group">
<span class="server-info-item-group">
<span class="server-info-item conn--tcp">
<span class="server-info-item-label">TCP</span>
<span class="server-info-item-value">{{ tcpConnCount }}</span>
@ -131,7 +101,7 @@
<span class="server-info-item-label">UDP</span>
<span class="server-info-item-value">{{ udpConnCount }}</span>
</span>
</div>
</span>
</div>
</div>
<div class="server-info-group server-info--boottime">
@ -162,7 +132,7 @@
套餐
</div>
<div class="server-info-content">
<div class="server-info-item-group">
<span class="server-info-item-group">
<span
v-for="item in billPlanData"
:key="item.label"
@ -174,7 +144,7 @@
>{{ item.label }}</span>
<span class="server-info-item-value">{{ item.value }}</span>
</span>
</div>
</span>
</div>
</div>
<div
@ -243,37 +213,6 @@ function toBuy() {
window.open(decodeUrl, '_blank');
}
/**
* GPU列表
*/
const gpuList = computed(() => {
const gpus = props.info?.Host?.GPU || [];
if (config.nazhua?.filterGPUKeywords?.length) {
// GPU Virtual Display
const keywors = Array.isArray(config.nazhua.filterGPUKeywords)
? config.nazhua.filterGPUKeywords
: [config.nazhua.filterGPUKeywords];
return gpus.filter((i) => {
if (keywors.length) {
return !keywors.some((k) => i.toLowerCase().includes(k.toLowerCase()));
}
return true;
});
}
return gpus;
});
const sysLoadInfo = computed(() => {
if (props.info?.State?.Load1) {
return [
props.info.State?.Load1,
props.info.State?.Load5,
props.info.State?.Load15,
].filter((i) => i !== undefined).map((i) => (i).toFixed(2) * 1).join(',');
}
return '-';
});
const {
billAndPlan,
} = handleServerBillAndPlan({

View File

@ -94,8 +94,8 @@ export default (params) => {
const endTime = dayjs(endDate).valueOf();
if (endDate.indexOf('0000-00-00') === 0) {
obj.remainingTime = {
label: '剩余',
value: config.nazhua.infinityCycle || '长期有效',
label: '有效期',
value: config.nazhua.infinityCycle || '无限',
type: 'infinity',
};
} else if (autoRenewal === '1') {

View File

@ -12,19 +12,19 @@
:locations="locations"
/>
<server-name
:key="`${info.ID}_name`"
:key="info.ID"
:info="info"
/>
<server-status-box
:key="`${info.ID}_status`"
:key="info.ID"
:info="info"
/>
<server-info-box
:key="`${info.ID}_info`"
:key="info.ID"
:info="info"
/>
<server-monitor
:key="`${info.ID}_monitor`"
:key="info.ID"
:info="info"
/>
</div>