diff --git a/ui-ngx/src/app/shared/components/time/quick-time-interval.component.html b/ui-ngx/src/app/shared/components/time/quick-time-interval.component.html index 844d8fb825..52479173c1 100644 --- a/ui-ngx/src/app/shared/components/time/quick-time-interval.component.html +++ b/ui-ngx/src/app/shared/components/time/quick-time-interval.component.html @@ -16,7 +16,7 @@ -->
- + timewindow.interval diff --git a/ui-ngx/src/app/shared/components/time/quick-time-interval.component.ts b/ui-ngx/src/app/shared/components/time/quick-time-interval.component.ts index e86bf93db6..1edaad40e5 100644 --- a/ui-ngx/src/app/shared/components/time/quick-time-interval.component.ts +++ b/ui-ngx/src/app/shared/components/time/quick-time-interval.component.ts @@ -17,6 +17,7 @@ import { Component, forwardRef, Input, OnInit } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import { QuickTimeInterval, QuickTimeIntervalTranslationMap } from '@shared/models/time/time.models'; +import { MatFormFieldAppearance, SubscriptSizing } from '@angular/material/form-field'; @Component({ selector: 'tb-quick-time-interval', @@ -43,6 +44,12 @@ export class QuickTimeIntervalComponent implements OnInit, ControlValueAccessor @Input() onlyCurrentInterval = false; + @Input() + subscriptSizing: SubscriptSizing = 'fixed'; + + @Input() + appearance: MatFormFieldAppearance = 'fill'; + private propagateChange = (_: any) => {}; constructor() { diff --git a/ui-ngx/src/app/shared/components/time/timeinterval.component.html b/ui-ngx/src/app/shared/components/time/timeinterval.component.html index 04292b4d93..f72704bcea 100644 --- a/ui-ngx/src/app/shared/components/time/timeinterval.component.html +++ b/ui-ngx/src/app/shared/components/time/timeinterval.component.html @@ -22,26 +22,26 @@
- + timeinterval.days - + timeinterval.hours - + timeinterval.minutes - + timeinterval.seconds
- + {{ predefinedName }} diff --git a/ui-ngx/src/app/shared/components/time/timeinterval.component.ts b/ui-ngx/src/app/shared/components/time/timeinterval.component.ts index 8ed6fb2034..906d938d0b 100644 --- a/ui-ngx/src/app/shared/components/time/timeinterval.component.ts +++ b/ui-ngx/src/app/shared/components/time/timeinterval.component.ts @@ -18,7 +18,7 @@ import { Component, EventEmitter, forwardRef, Input, OnInit, Output } from '@ang import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import { TimeService } from '@core/services/time.service'; import { coerceNumberProperty } from '@angular/cdk/coercion'; -import { SubscriptSizing } from '@angular/material/form-field'; +import { MatFormFieldAppearance, SubscriptSizing } from '@angular/material/form-field'; import { coerceBoolean } from '@shared/decorators/coercion'; import { Interval, IntervalMath, TimeInterval } from '@shared/models/time/time.models'; import { isDefined } from '@core/utils'; @@ -85,6 +85,9 @@ export class TimeintervalComponent implements OnInit, ControlValueAccessor { @Input() subscriptSizing: SubscriptSizing = 'fixed'; + @Input() + appearance: MatFormFieldAppearance = 'fill'; + days = 0; hours = 0; mins = 1; diff --git a/ui-ngx/src/app/shared/components/time/timewindow-panel.component.html b/ui-ngx/src/app/shared/components/time/timewindow-panel.component.html index 1ad06bab3e..b5c279df4e 100644 --- a/ui-ngx/src/app/shared/components/time/timewindow-panel.component.html +++ b/ui-ngx/src/app/shared/components/time/timewindow-panel.component.html @@ -19,73 +19,54 @@ -
-
- - -
-
-
- - -
-
- - -
-
- timewindow.last - -
-
-
- -
-
- - -
-
- timewindow.interval - -
-
-
-
- - +
+
+
{{ 'timewindow.time-range' | translate }}
+
+ + + + + + +
-
-
- - + + + + + + + + + + + + +
+ + +
@@ -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 @@
- + - -
-
-
- - -
-
- - aggregation.function - - - {{ aggregationTypesTranslations.get(aggregationTypes[aggregation]) | translate }} - - - -
+ +
+
+
{{ 'aggregation.aggregation' | translate }}
+ + + + {{ aggregationTypesTranslations.get(aggregationTypes[aggregation]) | translate }} + + +
-
-
- - -
-
-
- -
- - - - - -
+ +
+
{{ 'aggregation.limit' | translate }}
+
+
+ + + + +
-
+
@@ -217,6 +192,8 @@ (hideFlagChange)="onHideAggIntervalChanged()" [min]="minHistoryAggInterval()" [max]="maxHistoryAggInterval()" useCalendarIntervals + subscriptSizing="dynamic" + appearance="outline" predefinedName="aggregation.group-interval">
@@ -226,10 +203,11 @@ - - + + + + +
diff --git a/ui-ngx/src/app/shared/components/time/timewindow-panel.component.scss b/ui-ngx/src/app/shared/components/time/timewindow-panel.component.scss index 25d11f510f..f3e57fb24d 100644 --- a/ui-ngx/src/app/shared/components/time/timewindow-panel.component.scss +++ b/ui-ngx/src/app/shared/components/time/timewindow-panel.component.scss @@ -22,6 +22,10 @@ max-width: 100%; background-color: #fff; + .tb-flex { + gap: 16px; + } + .mat-content { overflow: hidden; } @@ -35,7 +39,7 @@ margin-right: 5px; } - tb-timeinterval[ng-reflect-fx-show="true"] { + tb-timeinterval[ng-reflect-fxe-show="true"] { margin-bottom: -16px; } @@ -78,4 +82,8 @@ .mat-mdc-tab-group:not(.tb-headless) { height: 100%; } + + .mat-mdc-tab-body-content { + padding: 16px; + } } diff --git a/ui-ngx/src/app/shared/components/time/timewindow-panel.component.ts b/ui-ngx/src/app/shared/components/time/timewindow-panel.component.ts index 857d2c7cb7..3fe0a2a599 100644 --- a/ui-ngx/src/app/shared/components/time/timewindow-panel.component.ts +++ b/ui-ngx/src/app/shared/components/time/timewindow-panel.component.ts @@ -32,6 +32,9 @@ import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms import { TimeService } from '@core/services/time.service'; import { isDefined } from '@core/utils'; import { OverlayRef } from '@angular/cdk/overlay'; +import { WidgetConfigMode } from '@shared/models/widget.models'; +import { ToggleHeaderOption } from '@shared/components/toggle-header.component'; +import { TranslateService } from '@ngx-translate/core'; export interface TimewindowPanelData { historyOnly: boolean; @@ -82,11 +85,23 @@ export class TimewindowPanelComponent extends PageComponent implements OnInit { result: Timewindow; + realtimeTimewindowOptions: ToggleHeaderOption[] = [ + { + name: this.translate.instant('timewindow.last'), + value: this.realtimeTypes.LAST_INTERVAL + }, + { + name: this.translate.instant('timewindow.interval'), + value: this.realtimeTypes.INTERVAL + } + ]; + constructor(@Inject(TIMEWINDOW_PANEL_DATA) public data: TimewindowPanelData, public overlayRef: OverlayRef, protected store: Store, public fb: UntypedFormBuilder, private timeService: TimeService, + private translate: TranslateService, public viewContainerRef: ViewContainerRef) { super(store); this.historyOnly = data.historyOnly; @@ -380,4 +395,5 @@ export class TimewindowPanelComponent extends PageComponent implements OnInit { this.timewindowForm.markAsDirty(); } + protected readonly WidgetConfigMode = WidgetConfigMode; } diff --git a/ui-ngx/src/app/shared/components/time/timezone-select.component.html b/ui-ngx/src/app/shared/components/time/timezone-select.component.html index 1ed05d820d..280a58e4b8 100644 --- a/ui-ngx/src/app/shared/components/time/timezone-select.component.html +++ b/ui-ngx/src/app/shared/components/time/timezone-select.component.html @@ -15,7 +15,8 @@ limitations under the License. --> - + timezone.timezone