Compare commits

...

6 Commits

Author SHA1 Message Date
hi2hi
ffd8a87854 🚀 0.4.8 - Publish
🐛 修复禁用刷新的设置未能生效问题
2024-12-09 03:23:42 +00:00
hi2hi
1800486d24 fix: 更新发布工作流以包含最近提交的详细变更内容 2024-12-09 02:58:35 +00:00
hi2hi
a1676c9b3e 🚀 0.4.7 - Publish
🐛 修复服务器网络监控的时间乱序问题;
 添加服务器网络监控的时间轴拖动;
 添加服务器网络监控的刷新时间间隔设置;
🪄 调整地图的城市点融合的偏差值;
2024-12-09 02:48:10 +00:00
hi2hi
0875e12d21 🛠️ 修改发布工作流以获取最近提交的标题作为变更内容 2024-12-09 02:47:23 +00:00
hi2hi
4126958d54 fix: 修复时间乱序问题,优化图表数据处理逻辑,添加监控刷新时间设置 2024-12-09 02:46:15 +00:00
hi2hi
4e60a52749 fix: 修正世界地图计算逻辑中的常量值 2024-12-09 02:36:28 +00:00
6 changed files with 50 additions and 31 deletions

View File

@ -132,7 +132,7 @@ jobs:
- name: Add release notes - name: Add release notes
run: | run: |
# 获取最近一次提交的变更内容 # 获取最近一次提交的变更内容
git diff HEAD^ HEAD --name-only > changes.txt git log -1 --pretty=format:"%s%n%b" > changes.txt
# 获取现有的发布说明 # 获取现有的发布说明
gh release view v${{ steps.determine_version.outputs.version }} --json body -q .body > body.txt gh release view v${{ steps.determine_version.outputs.version }} --json body -q .body > body.txt

View File

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

View File

@ -17,6 +17,7 @@ window.$$nazhuaConfig = {
// hideFilter: false, // 隐藏筛选 // hideFilter: false, // 隐藏筛选
// hideTag: false, // 隐藏标签 // hideTag: false, // 隐藏标签
// hideDotBG: true, // 隐藏框框里面的点点背景 // hideDotBG: true, // 隐藏框框里面的点点背景
// monitorRefreshTime: 10, // 监控刷新时间间隔单位s, 0为不刷新为保证不频繁请求源站最低生效值为10s
// customCodeMap: {}, // 自定义的地图点信息 // customCodeMap: {}, // 自定义的地图点信息
// nezhaVersion: 'v1', // 哪吒版本 // nezhaVersion: 'v1', // 哪吒版本
// apiMonitorPath: '/api/v1/monitor/{id}', // apiMonitorPath: '/api/v1/monitor/{id}',

View File

@ -5,15 +5,19 @@ import {
TooltipComponent, TooltipComponent,
LegendComponent, LegendComponent,
GridComponent, GridComponent,
DataZoomComponent,
} from 'echarts/components'; } from 'echarts/components';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import config from '@/config';
use([ use([
CanvasRenderer, CanvasRenderer,
LineChart, LineChart,
TooltipComponent, TooltipComponent,
LegendComponent, LegendComponent,
GridComponent, GridComponent,
DataZoomComponent,
]); ]);
export default ( export default (
@ -22,6 +26,7 @@ export default (
valueList, valueList,
mode = 'dark', mode = 'dark',
) => { ) => {
const fontFamily = config.nazhua.disableSarasaTermSC === true ? undefined : 'Sarasa Term SC';
const option = { const option = {
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
@ -32,7 +37,7 @@ export default (
const time = dayjs(parseInt(params[0].axisValue, 10)).format('YYYY.MM.DD HH:mm'); const time = dayjs(parseInt(params[0].axisValue, 10)).format('YYYY.MM.DD HH:mm');
let res = `${time}<br>`; let res = `${time}<br>`;
params.forEach((i) => { params.forEach((i) => {
res += `${i.marker} ${i.seriesName}: ${i.value}ms<br>`; res += `${i.marker} ${i.seriesName}: ${i.value[1]}ms<br>`;
}); });
return res; return res;
}, },
@ -49,27 +54,22 @@ export default (
data: cateList, data: cateList,
textStyle: { textStyle: {
color: mode === 'dark' ? '#ddd' : '#222', color: mode === 'dark' ? '#ddd' : '#222',
fontFamily: 'Sarasa Term SC', fontFamily,
fontSize: 14, fontSize: 14,
}, },
}, },
xAxis: { grid: {
type: 'category', left: 0,
data: dateList, right: 5,
axisLabel: { bottom: 0,
hideOverlap: true, containLabel: true,
interval: Math.max(
Math.ceil(dateList.length / 12),
1,
),
nameTextStyle: {
fontSize: 12,
},
formatter: (val) => dayjs(parseInt(val, 10)).format('HH:mm'),
fontFamily: 'Sarasa Term SC',
color: mode === 'dark' ? '#eee' : '#222',
},
}, },
dataZoom: [{
id: 'dataZoomX',
type: 'slider',
xAxisIndex: [0],
filterMode: 'filter',
}],
yAxis: { yAxis: {
type: 'value', type: 'value',
splitLine: { splitLine: {
@ -78,16 +78,22 @@ export default (
}, },
}, },
axisLabel: { axisLabel: {
fontFamily: 'Sarasa Term SC', fontFamily,
color: mode === 'dark' ? '#ddd' : '#222', color: mode === 'dark' ? '#ddd' : '#222',
fontSize: 12, fontSize: 12,
}, },
}, },
grid: { xAxis: {
left: 0, type: 'time',
right: 0, data: dateList,
bottom: 0, axisLabel: {
containLabel: true, hideOverlap: true,
nameTextStyle: {
fontSize: 12,
},
fontFamily,
color: mode === 'dark' ? '#eee' : '#222',
},
}, },
series: valueList.map((i) => ({ series: valueList.map((i) => ({
type: 'line', type: 'line',

View File

@ -39,7 +39,7 @@ export function findIntersectingGroups(coordinates) {
coordinates.forEach((coordinate, index) => { coordinates.forEach((coordinate, index) => {
const intersects = []; const intersects = [];
const n = 2; const n = -2;
coordinates.forEach((otherCoordinate, otherIndex) => { coordinates.forEach((otherCoordinate, otherIndex) => {
if (index !== otherIndex) { if (index !== otherIndex) {
if ( if (

View File

@ -101,9 +101,10 @@ const monitorChartData = computed(() => {
const dateList = []; const dateList = [];
Object.keys(dateMap).forEach((i) => { Object.keys(dateMap).forEach((i) => {
if (dateMap[i]?.length) { if (dateMap[i]?.length) {
dateList.push(parseInt(i, 10)); const time = parseInt(i, 10);
dateList.push(time);
dateMap[i].forEach((o) => { dateMap[i].forEach((o) => {
cateMap[o.name].push(o.value); cateMap[o.name].push([time, o.value]);
}); });
} }
}); });
@ -151,9 +152,20 @@ async function setTimeLoadMonitor() {
clearTimeout(loadMonitorTimer); clearTimeout(loadMonitorTimer);
} }
await loadMonitor(); await loadMonitor();
let monitorRefreshTime = parseInt(config.nazhua.monitorRefreshTime, 10);
// 0
if (monitorRefreshTime === 0) {
return;
}
// 10
if (Number.isNaN(monitorRefreshTime)) {
monitorRefreshTime = 10;
}
// 10
const sTime = Math.min(monitorRefreshTime, 10);
loadMonitorTimer = setTimeout(() => { loadMonitorTimer = setTimeout(() => {
setTimeLoadMonitor(); setTimeLoadMonitor();
}, 10000); }, sTime * 1000);
} }
onMounted(() => { onMounted(() => {
@ -169,7 +181,7 @@ onUnmounted(() => {
<style lang="scss" scoped> <style lang="scss" scoped>
.server-monitor-group { .server-monitor-group {
--line-chart-size: 270px; --line-chart-size: 280px;
} }
.module-head-group { .module-head-group {