Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
liming6
dcu-process-montor
Commits
592e7231
"googlemock/git@developer.sourcefind.cn:yangql/googletest.git" did not exist on "d81b6a0c4cecbe087fae28bd6a3a40d1f5f45df4"
Commit
592e7231
authored
Feb 28, 2026
by
liming6
Browse files
fix 修复timechart的bug
parent
0b52579d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
cmd/hytop/tui/timechart.go
cmd/hytop/tui/timechart.go
+4
-4
No files found.
cmd/hytop/tui/timechart.go
View file @
592e7231
...
@@ -193,7 +193,7 @@ func (m *MyTimeChart) PutPoint(points []tchart.TimePoint) {
...
@@ -193,7 +193,7 @@ func (m *MyTimeChart) PutPoint(points []tchart.TimePoint) {
m
.
points
.
Add
(
points
...
)
m
.
points
.
Add
(
points
...
)
}
}
m
.
RemoveUselessPoint
()
m
.
RemoveUselessPoint
()
threshold
:=
time
.
Now
()
.
Add
(
time
.
Second
*
time
.
Duration
(
-
2
*
m
.
width
-
1
))
threshold
:=
time
.
Now
()
.
Add
(
time
.
Second
*
time
.
Duration
(
-
2
*
m
.
width
))
points
=
m
.
points
.
Values
()
points
=
m
.
points
.
Values
()
tmpPoint
:=
make
([]
tchart
.
TimePoint
,
0
,
m
.
width
*
2
)
tmpPoint
:=
make
([]
tchart
.
TimePoint
,
0
,
m
.
width
*
2
)
// 判断是否需要补充空点
// 判断是否需要补充空点
...
@@ -237,7 +237,7 @@ func (m *MyTimeChart) ResetPutPoint(points []tchart.TimePoint) {
...
@@ -237,7 +237,7 @@ func (m *MyTimeChart) ResetPutPoint(points []tchart.TimePoint) {
m
.
points
.
Add
(
points
...
)
m
.
points
.
Add
(
points
...
)
}
}
m
.
RemoveUselessPoint
()
m
.
RemoveUselessPoint
()
threshold
:=
time
.
Now
()
.
Add
(
time
.
Second
*
time
.
Duration
(
-
2
*
m
.
width
-
1
))
threshold
:=
time
.
Now
()
.
Add
(
time
.
Second
*
time
.
Duration
(
-
2
*
m
.
width
))
points
=
m
.
points
.
Values
()
points
=
m
.
points
.
Values
()
tmpPoint
:=
make
([]
tchart
.
TimePoint
,
0
,
m
.
width
*
2
)
tmpPoint
:=
make
([]
tchart
.
TimePoint
,
0
,
m
.
width
*
2
)
...
@@ -443,10 +443,10 @@ func (m *MyTimeChart) ViewWithMiddleLine() string {
...
@@ -443,10 +443,10 @@ func (m *MyTimeChart) ViewWithMiddleLine() string {
for
k
,
v
:=
range
resultLines
{
for
k
,
v
:=
range
resultLines
{
if
k
==
targetLine
{
if
k
==
targetLine
{
if
isMiddle
{
if
isMiddle
{
resultLines
[
k
]
=
style
.
Foreground
(
m
.
color
[
k
])
.
Strikethrough
(
true
)
.
Render
(
v
)
resultLines
[
k
]
=
style
.
Strikethrough
(
true
)
.
Foreground
(
m
.
color
[
k
])
.
Render
(
v
)
style
.
Strikethrough
(
false
)
style
.
Strikethrough
(
false
)
}
else
{
}
else
{
resultLines
[
k
]
=
style
.
Foreground
(
m
.
color
[
k
])
.
Underline
(
true
)
.
Render
(
v
)
resultLines
[
k
]
=
style
.
Underline
(
true
)
.
Foreground
(
m
.
color
[
k
])
.
Render
(
v
)
style
.
Underline
(
false
)
style
.
Underline
(
false
)
}
}
}
else
{
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment