mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-13 20:35:55 +08:00
fix:end of day (#7426)
This commit is contained in:
parent
afd23f7ad8
commit
218380ba43
@ -25,7 +25,7 @@ export default function ChartView({ appId }: IChartViewProps) {
|
|||||||
const appDetail = useAppStore(state => state.appDetail)
|
const appDetail = useAppStore(state => state.appDetail)
|
||||||
const isChatApp = appDetail?.mode !== 'completion' && appDetail?.mode !== 'workflow'
|
const isChatApp = appDetail?.mode !== 'completion' && appDetail?.mode !== 'workflow'
|
||||||
const isWorkflow = appDetail?.mode === 'workflow'
|
const isWorkflow = appDetail?.mode === 'workflow'
|
||||||
const [period, setPeriod] = useState<PeriodParams>({ name: t('appLog.filter.period.last7days'), query: { start: today.subtract(7, 'day').startOf('day').format(queryDateFormat), end: today.format(queryDateFormat) } })
|
const [period, setPeriod] = useState<PeriodParams>({ name: t('appLog.filter.period.last7days'), query: { start: today.subtract(7, 'day').startOf('day').format(queryDateFormat), end: today.endOf('day').format(queryDateFormat) } })
|
||||||
|
|
||||||
const onSelect = (item: Item) => {
|
const onSelect = (item: Item) => {
|
||||||
if (item.value === 'all') {
|
if (item.value === 'all') {
|
||||||
@ -37,7 +37,7 @@ export default function ChartView({ appId }: IChartViewProps) {
|
|||||||
setPeriod({ name: item.name, query: { start: startOfToday, end: endOfToday } })
|
setPeriod({ name: item.name, query: { start: startOfToday, end: endOfToday } })
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
setPeriod({ name: item.name, query: { start: today.subtract(item.value as number, 'day').startOf('day').format(queryDateFormat), end: today.format(queryDateFormat) } })
|
setPeriod({ name: item.name, query: { start: today.subtract(item.value as number, 'day').startOf('day').format(queryDateFormat), end: today.endOf('day').format(queryDateFormat) } })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ const Logs: FC<ILogsProps> = ({ appDetail }) => {
|
|||||||
...(queryParams.period !== 'all'
|
...(queryParams.period !== 'all'
|
||||||
? {
|
? {
|
||||||
start: dayjs().subtract(queryParams.period as number, 'day').startOf('day').format('YYYY-MM-DD HH:mm'),
|
start: dayjs().subtract(queryParams.period as number, 'day').startOf('day').format('YYYY-MM-DD HH:mm'),
|
||||||
end: dayjs().format('YYYY-MM-DD HH:mm'),
|
end: dayjs().endOf('day').format('YYYY-MM-DD HH:mm'),
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
...omit(queryParams, ['period']),
|
...omit(queryParams, ['period']),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user