Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TimeWindow] - For Realtime query results there is no difference between "Current day" and "Last day" #10748

Merged
merged 2 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,13 @@ public PageData<AlarmData> findAlarmDataByQueryForEntities(TenantId tenantId, Al
long startTs;
long endTs;
if (pageLink.getTimeWindow() > 0) {
endTs = System.currentTimeMillis();
startTs = endTs - pageLink.getTimeWindow();
if (pageLink.getStartTs() > 0) {
startTs = pageLink.getStartTs();
endTs = startTs + pageLink.getTimeWindow();
} else {
endTs = System.currentTimeMillis();
startTs = endTs - pageLink.getTimeWindow();
}
} else {
startTs = pageLink.getStartTs();
endTs = pageLink.getEndTs();
Expand Down
3 changes: 3 additions & 0 deletions ui-ngx/src/app/core/api/alarm-data-subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ export class AlarmDataSubscription {
this.alarmDataCommand.query.pageLink.startTs = this.subsTw.fixedWindow.startTimeMs;
this.alarmDataCommand.query.pageLink.endTs = this.subsTw.fixedWindow.endTimeMs;
} else {
if (this.subsTw.startTs) {
this.alarmDataCommand.query.pageLink.startTs = this.subsTw.startTs;
}
this.alarmDataCommand.query.pageLink.timeWindow = this.subsTw.realtimeWindowMs;
}

Expand Down