Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
7001e21e
Unverified
Commit
7001e21e
authored
Mar 11, 2024
by
Eric Wang
Committed by
GitHub
Mar 11, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
overview: fix filter today calc start & end (#2777)
parent
82d0732c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
chartView.tsx
...out)/app/(appDetailLayout)/[appId]/overview/chartView.tsx
+11
-1
No files found.
web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/chartView.tsx
View file @
7001e21e
...
...
@@ -29,7 +29,17 @@ export default function ChartView({ appId }: IChartViewProps) {
const
[
period
,
setPeriod
]
=
useState
<
PeriodParams
>
({
name
:
t
(
'appLog.filter.period.last7days'
),
query
:
{
start
:
today
.
subtract
(
7
,
'day'
).
format
(
queryDateFormat
),
end
:
today
.
format
(
queryDateFormat
)
}
})
const
onSelect
=
(
item
:
Item
)
=>
{
setPeriod
({
name
:
item
.
name
,
query
:
item
.
value
===
'all'
?
undefined
:
{
start
:
today
.
subtract
(
item
.
value
as
number
,
'day'
).
format
(
queryDateFormat
),
end
:
today
.
format
(
queryDateFormat
)
}
})
if
(
item
.
value
===
'all'
)
{
setPeriod
({
name
:
item
.
name
,
query
:
undefined
})
}
else
if
(
item
.
value
===
0
)
{
const
startOfToday
=
today
.
startOf
(
'day'
).
format
(
queryDateFormat
)
const
endOfToday
=
today
.
endOf
(
'day'
).
format
(
queryDateFormat
)
setPeriod
({
name
:
item
.
name
,
query
:
{
start
:
startOfToday
,
end
:
endOfToday
}
})
}
else
{
setPeriod
({
name
:
item
.
name
,
query
:
{
start
:
today
.
subtract
(
item
.
value
as
number
,
'day'
).
format
(
queryDateFormat
),
end
:
today
.
format
(
queryDateFormat
)
}
})
}
}
if
(
!
response
)
...
...
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