File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -94,8 +94,10 @@ export const NetworkChartClient = React.memo(function NetworkChart({
9494
9595 const customBackgroundImage = ( window . CustomBackgroundImage as string ) !== "" ? window . CustomBackgroundImage : undefined
9696
97+ const forcePeakCutEnabled = ( window . ForcePeakCutEnabled as boolean ) ?? false
98+
9799 const [ activeChart , setActiveChart ] = React . useState ( defaultChart )
98- const [ isPeakEnabled , setIsPeakEnabled ] = React . useState ( false )
100+ const [ isPeakEnabled , setIsPeakEnabled ] = React . useState ( forcePeakCutEnabled )
99101
100102 const handleButtonClick = useCallback (
101103 ( chart : string ) => {
@@ -281,11 +283,7 @@ export const NetworkChartClient = React.memo(function NetworkChart({
281283 // 根据时间跨度调整显示间隔
282284 if ( hours <= 12 ) {
283285 // 12小时内,每60分钟显示一个刻度
284- return (
285- index === 0 ||
286- index === array . length - 1 ||
287- new Date ( item . created_at ) . getMinutes ( ) % 60 === 0
288- )
286+ return index === 0 || index === array . length - 1 || new Date ( item . created_at ) . getMinutes ( ) % 60 === 0
289287 }
290288 // 超过12小时,每2小时显示一个刻度
291289 const date = new Date ( item . created_at )
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ declare global {
77 ForceShowServices : boolean
88 ForceCardInline : boolean
99 ForceShowMap : boolean
10+ ForcePeakCutEnabled : boolean
1011 }
1112}
1213
You can’t perform that action at this time.
0 commit comments