|
|
|
@ -19,73 +19,54 @@ |
|
|
|
<mat-tab-group [ngClass]="{'tb-headless': historyOnly}" |
|
|
|
(selectedTabChange)="onTimewindowTypeChange()" [(selectedIndex)]="timewindow.selectedTab"> |
|
|
|
<mat-tab label="{{ 'timewindow.realtime' | translate }}"> |
|
|
|
<section fxLayout="row"> |
|
|
|
<section *ngIf="isEdit" fxLayout="column" fxLayoutAlign="start center" |
|
|
|
style="padding-top: 8px; padding-left: 16px;"> |
|
|
|
<label class="tb-small hide-label" translate>timewindow.hide</label> |
|
|
|
<mat-checkbox [ngModelOptions]="{standalone: true}" [(ngModel)]="timewindow.hideInterval" |
|
|
|
(ngModelChange)="onHideIntervalChanged()"></mat-checkbox> |
|
|
|
</section> |
|
|
|
<section fxLayout="column" fxFlex [fxShow]="isEdit || !timewindow.hideInterval"> |
|
|
|
<div formGroupName="realtime" class="mat-content mat-padding" style="padding-top: 8px;"> |
|
|
|
<mat-radio-group *ngIf="!quickIntervalOnly" |
|
|
|
[fxShow]="isEdit || (!timewindow.hideLastInterval && !timewindow.hideQuickInterval)" |
|
|
|
formControlName="realtimeType"> |
|
|
|
<mat-radio-button [value]="realtimeTypes.LAST_INTERVAL" color="primary"> |
|
|
|
<section fxLayout="row"> |
|
|
|
<section *ngIf="isEdit" fxLayout="column" fxLayoutAlign="start center" style="padding-right: 8px;"> |
|
|
|
<label class="tb-small hide-label" translate>timewindow.hide</label> |
|
|
|
<mat-checkbox [ngModelOptions]="{standalone: true}" [(ngModel)]="timewindow.hideLastInterval" |
|
|
|
(ngModelChange)="onHideLastIntervalChanged()"></mat-checkbox> |
|
|
|
</section> |
|
|
|
<section fxLayout="column"> |
|
|
|
<span translate>timewindow.last</span> |
|
|
|
<tb-timeinterval |
|
|
|
formControlName="timewindowMs" |
|
|
|
predefinedName="timewindow.last" |
|
|
|
[fxShow]="timewindowForm.get('realtime.realtimeType').value === realtimeTypes.LAST_INTERVAL" |
|
|
|
[required]="timewindow.selectedTab === timewindowTypes.REALTIME && |
|
|
|
timewindowForm.get('realtime.realtimeType').value === realtimeTypes.LAST_INTERVAL" |
|
|
|
style="padding-top: 8px;"></tb-timeinterval> |
|
|
|
</section> |
|
|
|
</section> |
|
|
|
</mat-radio-button> |
|
|
|
<mat-radio-button [value]="realtimeTypes.INTERVAL" color="primary"> |
|
|
|
<section fxLayout="row"> |
|
|
|
<section *ngIf="isEdit" fxLayout="column" fxLayoutAlign="start center" style="padding-right: 8px;"> |
|
|
|
<label class="tb-small hide-label" translate>timewindow.hide</label> |
|
|
|
<mat-checkbox [ngModelOptions]="{standalone: true}" [(ngModel)]="timewindow.hideQuickInterval" |
|
|
|
(ngModelChange)="onHideQuickIntervalChanged()"></mat-checkbox> |
|
|
|
</section> |
|
|
|
<section fxLayout="column"> |
|
|
|
<span translate>timewindow.interval</span> |
|
|
|
<tb-quick-time-interval |
|
|
|
formControlName="quickInterval" |
|
|
|
onlyCurrentInterval="true" |
|
|
|
[fxShow]="timewindowForm.get('realtime.realtimeType').value === realtimeTypes.INTERVAL" |
|
|
|
[required]="timewindow.selectedTab === timewindowTypes.REALTIME && |
|
|
|
timewindowForm.get('realtime.realtimeType').value === realtimeTypes.INTERVAL" |
|
|
|
style="padding-top: 8px"></tb-quick-time-interval> |
|
|
|
</section> |
|
|
|
</section> |
|
|
|
</mat-radio-button> |
|
|
|
</mat-radio-group> |
|
|
|
<tb-timeinterval *ngIf="!isEdit && !timewindow.hideLastInterval && timewindow.hideQuickInterval" |
|
|
|
formControlName="timewindowMs" |
|
|
|
predefinedName="timewindow.last" |
|
|
|
required |
|
|
|
style="padding-top: 8px;"></tb-timeinterval> |
|
|
|
<tb-quick-time-interval |
|
|
|
*ngIf="quickIntervalOnly || !isEdit && timewindow.hideLastInterval && !timewindow.hideQuickInterval" |
|
|
|
formControlName="quickInterval" |
|
|
|
onlyCurrentInterval="true" |
|
|
|
required |
|
|
|
style="padding-top: 8px"></tb-quick-time-interval> |
|
|
|
<div class="tb-flex column"> |
|
|
|
<section class="tb-form-panel stroked" [fxShow]="isEdit || !timewindow.hideInterval"> |
|
|
|
<div class="tb-form-panel-title">{{ 'timewindow.time-range' | translate }}</div> |
|
|
|
<div class="tb-flex align-center space-between"> |
|
|
|
<ng-container formGroupName="realtime"> |
|
|
|
<tb-toggle-select *ngIf="!quickIntervalOnly" |
|
|
|
[fxShow]="isEdit || (!timewindow.hideLastInterval && !timewindow.hideQuickInterval)" |
|
|
|
appearance="fill" [options]="realtimeTimewindowOptions" formControlName="realtimeType" |
|
|
|
style="max-width: 100%"> |
|
|
|
</tb-toggle-select> |
|
|
|
</ng-container> |
|
|
|
|
|
|
|
<tb-timezone-select fxFlex [fxShow]="!timewindow.hideTimezone" |
|
|
|
localBrowserTimezonePlaceholderOnEmpty="true" |
|
|
|
formControlName="timezone" |
|
|
|
subscriptSizing="dynamic" |
|
|
|
appearance="outline"> |
|
|
|
</tb-timezone-select> |
|
|
|
</div> |
|
|
|
</section> |
|
|
|
</section> |
|
|
|
<ng-container *ngTemplateOutlet="additionalData"> |
|
|
|
</ng-container> |
|
|
|
|
|
|
|
<ng-container formGroupName="realtime"> |
|
|
|
<ng-container *ngIf="isEdit || !timewindow.hideLastInterval && |
|
|
|
timewindowForm.get('realtime.realtimeType').value === realtimeTypes.LAST_INTERVAL"> |
|
|
|
<tb-timeinterval |
|
|
|
formControlName="timewindowMs" |
|
|
|
subscriptSizing="dynamic" |
|
|
|
appearance="outline" |
|
|
|
[required]="timewindow.selectedTab === timewindowTypes.REALTIME && |
|
|
|
timewindowForm.get('realtime.realtimeType').value === realtimeTypes.LAST_INTERVAL"> |
|
|
|
</tb-timeinterval> |
|
|
|
</ng-container> |
|
|
|
|
|
|
|
<ng-container *ngIf="!timewindow.hideQuickInterval && |
|
|
|
timewindowForm.get('realtime.realtimeType').value === realtimeTypes.INTERVAL"> |
|
|
|
<tb-quick-time-interval |
|
|
|
formControlName="quickInterval" |
|
|
|
onlyCurrentInterval="true" |
|
|
|
subscriptSizing="dynamic" |
|
|
|
appearance="outline" |
|
|
|
[required]="timewindow.selectedTab === timewindowTypes.REALTIME && |
|
|
|
timewindowForm.get('realtime.realtimeType').value === realtimeTypes.INTERVAL"> |
|
|
|
</tb-quick-time-interval> |
|
|
|
</ng-container> |
|
|
|
</ng-container> |
|
|
|
</section> |
|
|
|
<ng-container *ngTemplateOutlet="aggregationConfig"> |
|
|
|
</ng-container> |
|
|
|
</div> |
|
|
|
</mat-tab> |
|
|
|
<mat-tab label="{{ 'timewindow.history' | translate }}"> |
|
|
|
<section fxLayout="row"> |
|
|
|
@ -110,6 +91,8 @@ |
|
|
|
formControlName="timewindowMs" |
|
|
|
predefinedName="timewindow.last" |
|
|
|
class="history-time-input" |
|
|
|
subscriptSizing="dynamic" |
|
|
|
appearance="outline" |
|
|
|
[fxShow]="timewindowForm.get('history.historyType').value === historyTypes.LAST_INTERVAL" |
|
|
|
[required]="timewindow.selectedTab === timewindowTypes.HISTORY && |
|
|
|
timewindowForm.get('history.historyType').value === historyTypes.LAST_INTERVAL" |
|
|
|
@ -134,6 +117,8 @@ |
|
|
|
<tb-quick-time-interval |
|
|
|
formControlName="quickInterval" |
|
|
|
class="history-time-input" |
|
|
|
subscriptSizing="dynamic" |
|
|
|
appearance="outline" |
|
|
|
[fxShow]="timewindowForm.get('history.historyType').value === historyTypes.INTERVAL" |
|
|
|
[required]="timewindow.selectedTab === timewindowTypes.HISTORY && |
|
|
|
timewindowForm.get('history.historyType').value === historyTypes.INTERVAL" |
|
|
|
@ -144,54 +129,42 @@ |
|
|
|
</div> |
|
|
|
</section> |
|
|
|
</section> |
|
|
|
<ng-container *ngTemplateOutlet="additionalData"> |
|
|
|
<ng-container *ngTemplateOutlet="aggregationConfig"> |
|
|
|
</ng-container> |
|
|
|
</mat-tab> |
|
|
|
</mat-tab-group> |
|
|
|
<ng-template #additionalData> |
|
|
|
<div *ngIf="aggregation" formGroupName="aggregation" class="mat-content mat-padding" fxLayout="column"> |
|
|
|
<section fxLayout="row"> |
|
|
|
<section fxLayout="column" fxLayoutAlign="start center" [fxShow]="isEdit"> |
|
|
|
<label class="tb-small hide-label" translate>timewindow.hide</label> |
|
|
|
<mat-checkbox [ngModelOptions]="{standalone: true}" [(ngModel)]="timewindow.hideAggregation" |
|
|
|
(ngModelChange)="onHideAggregationChanged()"></mat-checkbox> |
|
|
|
</section> |
|
|
|
<section fxFlex fxLayout="column" [fxShow]="isEdit || !timewindow.hideAggregation"> |
|
|
|
<mat-form-field> |
|
|
|
<mat-label translate>aggregation.function</mat-label> |
|
|
|
<mat-select formControlName="type" style="min-width: 150px;"> |
|
|
|
<mat-option *ngFor="let aggregation of aggregations" [value]="aggregation"> |
|
|
|
{{ aggregationTypesTranslations.get(aggregationTypes[aggregation]) | translate }} |
|
|
|
</mat-option> |
|
|
|
</mat-select> |
|
|
|
</mat-form-field> |
|
|
|
</section> |
|
|
|
<ng-template #aggregationConfig> |
|
|
|
<div *ngIf="aggregation" formGroupName="aggregation" class="tb-flex column"> |
|
|
|
<section class="tb-form-panel stroked" [fxShow]="isEdit || !timewindow.hideAggregation"> |
|
|
|
<div class="tb-form-panel-title">{{ 'aggregation.aggregation' | translate }}</div> |
|
|
|
<mat-form-field subscriptSizing="dynamic" appearance="outline"> |
|
|
|
<mat-select formControlName="type" style="min-width: 150px;"> |
|
|
|
<mat-option *ngFor="let aggregation of aggregations" [value]="aggregation"> |
|
|
|
{{ aggregationTypesTranslations.get(aggregationTypes[aggregation]) | translate }} |
|
|
|
</mat-option> |
|
|
|
</mat-select> |
|
|
|
</mat-form-field> |
|
|
|
</section> |
|
|
|
<section fxLayout="row" *ngIf="timewindowForm.get('aggregation.type').value === aggregationTypes.NONE"> |
|
|
|
<section fxLayout="column" fxLayoutAlign="start center" [fxShow]="isEdit"> |
|
|
|
<label class="tb-small hide-label" translate>timewindow.hide</label> |
|
|
|
<mat-checkbox [ngModelOptions]="{standalone: true}" [(ngModel)]="timewindow.hideAggInterval" |
|
|
|
(ngModelChange)="onHideAggIntervalChanged()"></mat-checkbox> |
|
|
|
</section> |
|
|
|
<section fxLayout="column" fxFlex [fxShow]="isEdit || !timewindow.hideAggInterval"> |
|
|
|
<div class="limit-slider-container" fxLayout="row" fxLayoutAlign="start center" |
|
|
|
fxLayout.xs="column" fxLayoutAlign.xs="stretch"> |
|
|
|
<label translate>aggregation.limit</label> |
|
|
|
<div fxLayout="row" fxLayoutAlign="start center" fxFlex> |
|
|
|
<mat-slider fxFlex |
|
|
|
discrete |
|
|
|
min="{{minDatapointsLimit()}}" |
|
|
|
max="{{maxDatapointsLimit()}}"><input matSliderThumb formControlName="limit"/> |
|
|
|
</mat-slider> |
|
|
|
<mat-form-field class="limit-slider-value"> |
|
|
|
<input matInput formControlName="limit" type="number" step="1" |
|
|
|
[value]="timewindowForm.get('aggregation.limit').value" |
|
|
|
min="{{minDatapointsLimit()}}" |
|
|
|
max="{{maxDatapointsLimit()}}"/> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
|
|
|
|
<section class="tb-form-panel stroked" |
|
|
|
*ngIf="timewindowForm.get('aggregation.type').value === aggregationTypes.NONE && (isEdit || !timewindow.hideAggInterval)"> |
|
|
|
<div class="tb-form-panel-title">{{ 'aggregation.limit' | translate }}</div> |
|
|
|
<div class="limit-slider-container" fxLayout="row" fxLayoutAlign="start center" |
|
|
|
fxLayout.xs="column" fxLayoutAlign.xs="stretch"> |
|
|
|
<div fxLayout="row" fxLayoutAlign="start center" fxFlex> |
|
|
|
<mat-slider fxFlex |
|
|
|
discrete |
|
|
|
min="{{minDatapointsLimit()}}" |
|
|
|
max="{{maxDatapointsLimit()}}"><input matSliderThumb formControlName="limit"/> |
|
|
|
</mat-slider> |
|
|
|
<mat-form-field class="limit-slider-value" subscriptSizing="dynamic" appearance="outline"> |
|
|
|
<input matInput formControlName="limit" type="number" step="1" |
|
|
|
[value]="timewindowForm.get('aggregation.limit').value" |
|
|
|
min="{{minDatapointsLimit()}}" |
|
|
|
max="{{maxDatapointsLimit()}}"/> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
</section> |
|
|
|
</div> |
|
|
|
</section> |
|
|
|
</div> |
|
|
|
<div formGroupName="realtime" |
|
|
|
@ -204,6 +177,8 @@ |
|
|
|
(hideFlagChange)="onHideAggIntervalChanged()" |
|
|
|
[min]="minRealtimeAggInterval()" [max]="maxRealtimeAggInterval()" |
|
|
|
useCalendarIntervals |
|
|
|
subscriptSizing="dynamic" |
|
|
|
appearance="outline" |
|
|
|
predefinedName="aggregation.group-interval"> |
|
|
|
</tb-timeinterval> |
|
|
|
</div> |
|
|
|
@ -217,6 +192,8 @@ |
|
|
|
(hideFlagChange)="onHideAggIntervalChanged()" |
|
|
|
[min]="minHistoryAggInterval()" [max]="maxHistoryAggInterval()" |
|
|
|
useCalendarIntervals |
|
|
|
subscriptSizing="dynamic" |
|
|
|
appearance="outline" |
|
|
|
predefinedName="aggregation.group-interval"> |
|
|
|
</tb-timeinterval> |
|
|
|
</div> |
|
|
|
@ -226,10 +203,11 @@ |
|
|
|
<mat-checkbox [ngModelOptions]="{standalone: true}" [(ngModel)]="timewindow.hideTimezone" |
|
|
|
(ngModelChange)="onHideTimezoneChanged()"></mat-checkbox> |
|
|
|
</section> |
|
|
|
<tb-timezone-select fxFlex [fxShow]="isEdit || !timewindow.hideTimezone" |
|
|
|
localBrowserTimezonePlaceholderOnEmpty="true" |
|
|
|
formControlName="timezone"> |
|
|
|
</tb-timezone-select> |
|
|
|
<!-- <tb-timezone-select fxFlex [fxShow]="isEdit || !timewindow.hideTimezone"--> |
|
|
|
<!-- localBrowserTimezonePlaceholderOnEmpty="true"--> |
|
|
|
<!-- formControlName="timezone"--> |
|
|
|
<!-- appearance="outline">--> |
|
|
|
<!-- </tb-timezone-select>--> |
|
|
|
</div> |
|
|
|
</ng-template> |
|
|
|
</form> |
|
|
|
|