Timewindow: move allowed interval options to advanced params
This commit is contained in:
parent
90d7ef1e7d
commit
7e1456a96e
@ -62,7 +62,7 @@
|
|||||||
formControlName="timewindowMs"
|
formControlName="timewindowMs"
|
||||||
subscriptSizing="dynamic"
|
subscriptSizing="dynamic"
|
||||||
appearance="outline"
|
appearance="outline"
|
||||||
[allowedIntervals]="timewindowForm.get('realtime.allowedLastIntervals').value"
|
[allowedIntervals]="timewindowForm.get('realtime.advancedParams.allowedLastIntervals').value"
|
||||||
[disabledAdvanced]="timewindowForm.get('realtime.disableCustomInterval').value"
|
[disabledAdvanced]="timewindowForm.get('realtime.disableCustomInterval').value"
|
||||||
[required]="timewindowForm.get('selectedTab').value === timewindowTypes.REALTIME &&
|
[required]="timewindowForm.get('selectedTab').value === timewindowTypes.REALTIME &&
|
||||||
timewindowForm.get('realtime.realtimeType').value === realtimeTypes.LAST_INTERVAL">
|
timewindowForm.get('realtime.realtimeType').value === realtimeTypes.LAST_INTERVAL">
|
||||||
@ -90,7 +90,7 @@
|
|||||||
onlyCurrentInterval="true"
|
onlyCurrentInterval="true"
|
||||||
subscriptSizing="dynamic"
|
subscriptSizing="dynamic"
|
||||||
appearance="outline"
|
appearance="outline"
|
||||||
[allowedIntervals]="timewindowForm.get('realtime.allowedQuickIntervals').value"
|
[allowedIntervals]="timewindowForm.get('realtime.advancedParams.allowedQuickIntervals').value"
|
||||||
[required]="timewindowForm.get('selectedTab').value === timewindowTypes.REALTIME &&
|
[required]="timewindowForm.get('selectedTab').value === timewindowTypes.REALTIME &&
|
||||||
timewindowForm.get('realtime.realtimeType').value === realtimeTypes.INTERVAL">
|
timewindowForm.get('realtime.realtimeType').value === realtimeTypes.INTERVAL">
|
||||||
<button *ngIf="!(timewindowForm.get('realtime.hideQuickInterval').value ||
|
<button *ngIf="!(timewindowForm.get('realtime.hideQuickInterval').value ||
|
||||||
@ -131,7 +131,7 @@
|
|||||||
formControlName="timewindowMs"
|
formControlName="timewindowMs"
|
||||||
subscriptSizing="dynamic"
|
subscriptSizing="dynamic"
|
||||||
appearance="outline"
|
appearance="outline"
|
||||||
[allowedIntervals]="timewindowForm.get('history.allowedLastIntervals').value"
|
[allowedIntervals]="timewindowForm.get('history.advancedParams.allowedLastIntervals').value"
|
||||||
[disabledAdvanced]="timewindowForm.get('history.disableCustomInterval').value"
|
[disabledAdvanced]="timewindowForm.get('history.disableCustomInterval').value"
|
||||||
[required]="timewindowForm.get('selectedTab').value === timewindowTypes.HISTORY &&
|
[required]="timewindowForm.get('selectedTab').value === timewindowTypes.HISTORY &&
|
||||||
timewindowForm.get('history.historyType').value === historyTypes.LAST_INTERVAL">
|
timewindowForm.get('history.historyType').value === historyTypes.LAST_INTERVAL">
|
||||||
@ -172,7 +172,7 @@
|
|||||||
formControlName="quickInterval"
|
formControlName="quickInterval"
|
||||||
subscriptSizing="dynamic"
|
subscriptSizing="dynamic"
|
||||||
appearance="outline"
|
appearance="outline"
|
||||||
[allowedIntervals]="timewindowForm.get('history.allowedQuickIntervals').value"
|
[allowedIntervals]="timewindowForm.get('history.advancedParams.allowedQuickIntervals').value"
|
||||||
[required]="timewindowForm.get('selectedTab').value === timewindowTypes.HISTORY &&
|
[required]="timewindowForm.get('selectedTab').value === timewindowTypes.HISTORY &&
|
||||||
timewindowForm.get('history.historyType').value === historyTypes.INTERVAL">
|
timewindowForm.get('history.historyType').value === historyTypes.INTERVAL">
|
||||||
<button *ngIf="!(timewindowForm.get('history.hideQuickInterval').value ||
|
<button *ngIf="!(timewindowForm.get('history.hideQuickInterval').value ||
|
||||||
|
|||||||
@ -150,10 +150,6 @@ export class TimewindowConfigDialogComponent extends PageComponent implements On
|
|||||||
timewindowMs: [ isDefined(realtime?.timewindowMs) ? this.timewindow.realtime.timewindowMs : null ],
|
timewindowMs: [ isDefined(realtime?.timewindowMs) ? this.timewindow.realtime.timewindowMs : null ],
|
||||||
interval: [ isDefined(realtime?.interval) ? this.timewindow.realtime.interval : null ],
|
interval: [ isDefined(realtime?.interval) ? this.timewindow.realtime.interval : null ],
|
||||||
quickInterval: [ isDefined(realtime?.quickInterval) ? this.timewindow.realtime.quickInterval : null ],
|
quickInterval: [ isDefined(realtime?.quickInterval) ? this.timewindow.realtime.quickInterval : null ],
|
||||||
allowedLastIntervals: [ isDefinedAndNotNull(this.timewindow.realtime?.allowedLastIntervals)
|
|
||||||
? this.timewindow.realtime?.allowedLastIntervals : null ],
|
|
||||||
allowedQuickIntervals: [ isDefinedAndNotNull(this.timewindow.realtime?.allowedQuickIntervals)
|
|
||||||
? this.timewindow.realtime?.allowedQuickIntervals : null ],
|
|
||||||
disableCustomInterval: [ isDefinedAndNotNull(this.timewindow.realtime?.disableCustomInterval)
|
disableCustomInterval: [ isDefinedAndNotNull(this.timewindow.realtime?.disableCustomInterval)
|
||||||
? this.timewindow.realtime?.disableCustomInterval : false ],
|
? this.timewindow.realtime?.disableCustomInterval : false ],
|
||||||
disableCustomGroupInterval: [ isDefinedAndNotNull(this.timewindow.realtime?.disableCustomGroupInterval)
|
disableCustomGroupInterval: [ isDefinedAndNotNull(this.timewindow.realtime?.disableCustomGroupInterval)
|
||||||
@ -169,7 +165,13 @@ export class TimewindowConfigDialogComponent extends PageComponent implements On
|
|||||||
value: isDefinedAndNotNull(this.timewindow.realtime.hideQuickInterval)
|
value: isDefinedAndNotNull(this.timewindow.realtime.hideQuickInterval)
|
||||||
? this.timewindow.realtime.hideQuickInterval : false,
|
? this.timewindow.realtime.hideQuickInterval : false,
|
||||||
disabled: this.timewindow.realtime.hideInterval
|
disabled: this.timewindow.realtime.hideInterval
|
||||||
}]
|
}],
|
||||||
|
advancedParams: this.fb.group({
|
||||||
|
allowedLastIntervals: [ isDefinedAndNotNull(this.timewindow.realtime?.advancedParams?.allowedLastIntervals)
|
||||||
|
? this.timewindow.realtime.advancedParams.allowedLastIntervals : null ],
|
||||||
|
allowedQuickIntervals: [ isDefinedAndNotNull(this.timewindow.realtime?.advancedParams?.allowedQuickIntervals)
|
||||||
|
? this.timewindow.realtime.advancedParams.allowedQuickIntervals : null ]
|
||||||
|
})
|
||||||
}),
|
}),
|
||||||
history: this.fb.group({
|
history: this.fb.group({
|
||||||
historyType: [ isDefined(history?.historyType) ? this.timewindow.history.historyType : HistoryWindowType.LAST_INTERVAL ],
|
historyType: [ isDefined(history?.historyType) ? this.timewindow.history.historyType : HistoryWindowType.LAST_INTERVAL ],
|
||||||
@ -177,10 +179,6 @@ export class TimewindowConfigDialogComponent extends PageComponent implements On
|
|||||||
interval: [ isDefined(history?.interval) ? this.timewindow.history.interval : null ],
|
interval: [ isDefined(history?.interval) ? this.timewindow.history.interval : null ],
|
||||||
fixedTimewindow: [ isDefined(history?.fixedTimewindow) ? this.timewindow.history.fixedTimewindow : null ],
|
fixedTimewindow: [ isDefined(history?.fixedTimewindow) ? this.timewindow.history.fixedTimewindow : null ],
|
||||||
quickInterval: [ isDefined(history?.quickInterval) ? this.timewindow.history.quickInterval : null ],
|
quickInterval: [ isDefined(history?.quickInterval) ? this.timewindow.history.quickInterval : null ],
|
||||||
allowedLastIntervals: [ isDefinedAndNotNull(this.timewindow.history?.allowedLastIntervals)
|
|
||||||
? this.timewindow.history?.allowedLastIntervals : null ],
|
|
||||||
allowedQuickIntervals: [ isDefinedAndNotNull(this.timewindow.realtime?.allowedQuickIntervals)
|
|
||||||
? this.timewindow.realtime?.allowedQuickIntervals : null ],
|
|
||||||
disableCustomInterval: [ isDefinedAndNotNull(this.timewindow.history?.disableCustomInterval)
|
disableCustomInterval: [ isDefinedAndNotNull(this.timewindow.history?.disableCustomInterval)
|
||||||
? this.timewindow.history?.disableCustomInterval : false ],
|
? this.timewindow.history?.disableCustomInterval : false ],
|
||||||
disableCustomGroupInterval: [ isDefinedAndNotNull(this.timewindow.history?.disableCustomGroupInterval)
|
disableCustomGroupInterval: [ isDefinedAndNotNull(this.timewindow.history?.disableCustomGroupInterval)
|
||||||
@ -201,7 +199,13 @@ export class TimewindowConfigDialogComponent extends PageComponent implements On
|
|||||||
value: isDefinedAndNotNull(this.timewindow.history.hideFixedInterval)
|
value: isDefinedAndNotNull(this.timewindow.history.hideFixedInterval)
|
||||||
? this.timewindow.history.hideFixedInterval : false,
|
? this.timewindow.history.hideFixedInterval : false,
|
||||||
disabled: this.timewindow.history.hideInterval
|
disabled: this.timewindow.history.hideInterval
|
||||||
}]
|
}],
|
||||||
|
advancedParams: this.fb.group({
|
||||||
|
allowedLastIntervals: [ isDefinedAndNotNull(this.timewindow.history?.advancedParams?.allowedLastIntervals)
|
||||||
|
? this.timewindow.history.advancedParams.allowedLastIntervals : null ],
|
||||||
|
allowedQuickIntervals: [ isDefinedAndNotNull(this.timewindow.history?.advancedParams?.allowedQuickIntervals)
|
||||||
|
? this.timewindow.history.advancedParams.allowedQuickIntervals : null ]
|
||||||
|
})
|
||||||
}),
|
}),
|
||||||
aggregation: this.fb.group({
|
aggregation: this.fb.group({
|
||||||
type: [ isDefined(aggregation?.type) ? this.timewindow.aggregation.type : null ],
|
type: [ isDefined(aggregation?.type) ? this.timewindow.aggregation.type : null ],
|
||||||
@ -349,8 +353,8 @@ export class TimewindowConfigDialogComponent extends PageComponent implements On
|
|||||||
if (selectedTab === TimewindowType.REALTIME) {
|
if (selectedTab === TimewindowType.REALTIME) {
|
||||||
if (timewindowFormValue.history.historyType !== HistoryWindowType.FIXED
|
if (timewindowFormValue.history.historyType !== HistoryWindowType.FIXED
|
||||||
&& !(this.quickIntervalOnly && timewindowFormValue.history.historyType === HistoryWindowType.LAST_INTERVAL)) {
|
&& !(this.quickIntervalOnly && timewindowFormValue.history.historyType === HistoryWindowType.LAST_INTERVAL)) {
|
||||||
const allowedLastIntervals = timewindowFormValue.realtime.allowedLastIntervals;
|
const allowedLastIntervals = timewindowFormValue.realtime.advancedParams.allowedLastIntervals;
|
||||||
const allowedQuickIntervals = timewindowFormValue.realtime.allowedQuickIntervals;
|
const allowedQuickIntervals = timewindowFormValue.realtime.advancedParams.allowedQuickIntervals;
|
||||||
// this.timewindowForm.get('realtime').patchValue({
|
// this.timewindowForm.get('realtime').patchValue({
|
||||||
// realtimeType: Object.keys(RealtimeWindowType).includes(HistoryWindowType[timewindowFormValue.history.historyType]) ?
|
// realtimeType: Object.keys(RealtimeWindowType).includes(HistoryWindowType[timewindowFormValue.history.historyType]) ?
|
||||||
// RealtimeWindowType[HistoryWindowType[timewindowFormValue.history.historyType]] :
|
// RealtimeWindowType[HistoryWindowType[timewindowFormValue.history.historyType]] :
|
||||||
@ -372,8 +376,8 @@ export class TimewindowConfigDialogComponent extends PageComponent implements On
|
|||||||
setTimeout(() => this.timewindowForm.get('realtime.interval').patchValue(timewindowFormValue.history.interval));
|
setTimeout(() => this.timewindowForm.get('realtime.interval').patchValue(timewindowFormValue.history.interval));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const allowedLastIntervals = timewindowFormValue.history.allowedLastIntervals;
|
const allowedLastIntervals = timewindowFormValue.history.advancedParams.allowedLastIntervals;
|
||||||
const allowedQuickIntervals = timewindowFormValue.history.allowedQuickIntervals;
|
const allowedQuickIntervals = timewindowFormValue.history.advancedParams.allowedQuickIntervals;
|
||||||
// this.timewindowForm.get('history').patchValue({
|
// this.timewindowForm.get('history').patchValue({
|
||||||
// historyType: HistoryWindowType[RealtimeWindowType[timewindowFormValue.realtime.realtimeType]],
|
// historyType: HistoryWindowType[RealtimeWindowType[timewindowFormValue.realtime.realtimeType]],
|
||||||
// timewindowMs: timewindowFormValue.realtime.timewindowMs,
|
// timewindowMs: timewindowFormValue.realtime.timewindowMs,
|
||||||
@ -489,33 +493,33 @@ export class TimewindowConfigDialogComponent extends PageComponent implements On
|
|||||||
|
|
||||||
configureRealtimeLastIntervalOptions($event: Event) {
|
configureRealtimeLastIntervalOptions($event: Event) {
|
||||||
const resFn = (res) => {
|
const resFn = (res) => {
|
||||||
this.timewindowForm.get('realtime.allowedLastIntervals').patchValue(res);
|
this.timewindowForm.get('realtime.advancedParams.allowedLastIntervals').patchValue(res);
|
||||||
};
|
};
|
||||||
this.openIntervalOptionsConfig($event, this.timewindowForm.get('realtime.allowedLastIntervals').value,
|
this.openIntervalOptionsConfig($event, this.timewindowForm.get('realtime.advancedParams.allowedLastIntervals').value,
|
||||||
resFn, RealtimeWindowType.LAST_INTERVAL);
|
resFn, RealtimeWindowType.LAST_INTERVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
configureRealtimeQuickIntervalOptions($event: Event) {
|
configureRealtimeQuickIntervalOptions($event: Event) {
|
||||||
const resFn = (res) => {
|
const resFn = (res) => {
|
||||||
this.timewindowForm.get('realtime.allowedQuickIntervals').patchValue(res);
|
this.timewindowForm.get('realtime.advancedParams.allowedQuickIntervals').patchValue(res);
|
||||||
};
|
};
|
||||||
this.openIntervalOptionsConfig($event, this.timewindowForm.get('realtime.allowedQuickIntervals').value,
|
this.openIntervalOptionsConfig($event, this.timewindowForm.get('realtime.advancedParams.allowedQuickIntervals').value,
|
||||||
resFn, RealtimeWindowType.INTERVAL, TimewindowType.REALTIME);
|
resFn, RealtimeWindowType.INTERVAL, TimewindowType.REALTIME);
|
||||||
}
|
}
|
||||||
|
|
||||||
configureHistoryLastIntervalOptions($event: Event) {
|
configureHistoryLastIntervalOptions($event: Event) {
|
||||||
const resFn = (res) => {
|
const resFn = (res) => {
|
||||||
this.timewindowForm.get('history.allowedLastIntervals').patchValue(res);
|
this.timewindowForm.get('history.advancedParams.allowedLastIntervals').patchValue(res);
|
||||||
};
|
};
|
||||||
this.openIntervalOptionsConfig($event, this.timewindowForm.get('history.allowedLastIntervals').value,
|
this.openIntervalOptionsConfig($event, this.timewindowForm.get('history.advancedParams.allowedLastIntervals').value,
|
||||||
resFn, HistoryWindowType.LAST_INTERVAL);
|
resFn, HistoryWindowType.LAST_INTERVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
configureHistoryQuickIntervalOptions($event: Event) {
|
configureHistoryQuickIntervalOptions($event: Event) {
|
||||||
const resFn = (res) => {
|
const resFn = (res) => {
|
||||||
this.timewindowForm.get('history.allowedQuickIntervals').patchValue(res);
|
this.timewindowForm.get('history.advancedParams.allowedQuickIntervals').patchValue(res);
|
||||||
};
|
};
|
||||||
this.openIntervalOptionsConfig($event, this.timewindowForm.get('history.allowedQuickIntervals').value,
|
this.openIntervalOptionsConfig($event, this.timewindowForm.get('history.advancedParams.allowedQuickIntervals').value,
|
||||||
resFn, HistoryWindowType.INTERVAL, TimewindowType.HISTORY);
|
resFn, HistoryWindowType.INTERVAL, TimewindowType.HISTORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -521,5 +521,4 @@ export class TimewindowPanelComponent extends PageComponent implements OnInit, O
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected readonly AggregationType = AggregationType;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -84,18 +84,22 @@ export class IntervalMath {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface TimewindowAdvancedParams {
|
||||||
|
allowedLastIntervals? : Array<Interval>;
|
||||||
|
allowedQuickIntervals? : Array<QuickTimeInterval>;
|
||||||
|
}
|
||||||
|
|
||||||
export interface IntervalWindow {
|
export interface IntervalWindow {
|
||||||
interval?: Interval;
|
interval?: Interval;
|
||||||
timewindowMs?: number;
|
timewindowMs?: number;
|
||||||
quickInterval?: QuickTimeInterval;
|
quickInterval?: QuickTimeInterval;
|
||||||
allowedLastIntervals? : Array<Interval>;
|
|
||||||
allowedQuickIntervals? : Array<QuickTimeInterval>;
|
|
||||||
disableCustomInterval?: boolean;
|
disableCustomInterval?: boolean;
|
||||||
disableCustomGroupInterval?: boolean;
|
disableCustomGroupInterval?: boolean;
|
||||||
hideInterval?: boolean;
|
hideInterval?: boolean;
|
||||||
hideLastInterval?: boolean;
|
hideLastInterval?: boolean;
|
||||||
hideQuickInterval?: boolean;
|
hideQuickInterval?: boolean;
|
||||||
hideFixedInterval?: boolean;
|
hideFixedInterval?: boolean;
|
||||||
|
advancedParams?: TimewindowAdvancedParams
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RealtimeWindow extends IntervalWindow{
|
export interface RealtimeWindow extends IntervalWindow{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user