fix: channel affinity (#2799)
* fix: channel affinity log styles * fix: Issue with incorrect data storage when switching key sources * feat: support not retrying after a single rule configuration fails * fix: render channel affinity tooltip as multiline content * feat: channel affinity cache hit * fix: prevent ChannelAffinityUsageCacheModal infinite loading and hide data before fetch * chore: format backend with gofmt and frontend with prettier/eslint autofix
This commit is contained in:
@@ -217,7 +217,11 @@ export function timestamp2string(timestamp) {
|
||||
);
|
||||
}
|
||||
|
||||
export function timestamp2string1(timestamp, dataExportDefaultTime = 'hour', showYear = false) {
|
||||
export function timestamp2string1(
|
||||
timestamp,
|
||||
dataExportDefaultTime = 'hour',
|
||||
showYear = false,
|
||||
) {
|
||||
let date = new Date(timestamp * 1000);
|
||||
let year = date.getFullYear();
|
||||
let month = (date.getMonth() + 1).toString();
|
||||
@@ -248,7 +252,9 @@ export function timestamp2string1(timestamp, dataExportDefaultTime = 'hour', sho
|
||||
nextDay = '0' + nextDay;
|
||||
}
|
||||
// 周视图结束日期也仅在跨年时显示年份
|
||||
let nextStr = showYear ? nextWeekYear + '-' + nextMonth + '-' + nextDay : nextMonth + '-' + nextDay;
|
||||
let nextStr = showYear
|
||||
? nextWeekYear + '-' + nextMonth + '-' + nextDay
|
||||
: nextMonth + '-' + nextDay;
|
||||
str += ' - ' + nextStr;
|
||||
}
|
||||
return str;
|
||||
@@ -257,7 +263,9 @@ export function timestamp2string1(timestamp, dataExportDefaultTime = 'hour', sho
|
||||
// 检查时间戳数组是否跨年
|
||||
export function isDataCrossYear(timestamps) {
|
||||
if (!timestamps || timestamps.length === 0) return false;
|
||||
const years = new Set(timestamps.map(ts => new Date(ts * 1000).getFullYear()));
|
||||
const years = new Set(
|
||||
timestamps.map((ts) => new Date(ts * 1000).getFullYear()),
|
||||
);
|
||||
return years.size > 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user