|
|
|
@ -15,14 +15,7 @@ |
|
|
|
///
|
|
|
|
|
|
|
|
import { GridsterComponent, GridsterConfig, GridsterItem, GridsterItemComponentInterface } from 'angular-gridster2'; |
|
|
|
import { |
|
|
|
datasourcesHasAggregation, |
|
|
|
datasourcesHasOnlyComparisonAggregation, |
|
|
|
FormattedData, |
|
|
|
Widget, |
|
|
|
WidgetPosition, |
|
|
|
widgetType |
|
|
|
} from '@app/shared/models/widget.models'; |
|
|
|
import { FormattedData, Widget, WidgetPosition, widgetType } from '@app/shared/models/widget.models'; |
|
|
|
import { WidgetLayout, WidgetLayouts } from '@app/shared/models/dashboard.models'; |
|
|
|
import { IDashboardWidget, WidgetAction, WidgetContext, WidgetHeaderAction } from './widget-component.models'; |
|
|
|
import { Timewindow } from '@shared/models/time/time.models'; |
|
|
|
@ -43,7 +36,11 @@ import { UtilsService } from '@core/services/utils.service'; |
|
|
|
import { TbPopoverComponent } from '@shared/components/popover.component'; |
|
|
|
import { ComponentStyle, iconStyle, textStyle } from '@shared/models/widget-settings.models'; |
|
|
|
import { TbContextMenuEvent } from '@shared/models/jquery-event.models'; |
|
|
|
import { widgetHasTimewindow } from '@shared/models/widget/widget-model.definition'; |
|
|
|
import { |
|
|
|
widgetDatasourcesHasAggregation, |
|
|
|
widgetDatasourcesHasOnlyComparisonAggregation, |
|
|
|
widgetHasTimewindow |
|
|
|
} from '@shared/models/widget/widget-model.definition'; |
|
|
|
|
|
|
|
export interface WidgetsData { |
|
|
|
widgets: Array<Widget>; |
|
|
|
@ -621,9 +618,9 @@ export class DashboardWidget implements GridsterItem, IDashboardWidget { |
|
|
|
let onlyQuickInterval = false; |
|
|
|
let onlyHistoryTimewindow = false; |
|
|
|
if (this.widget.type === widgetType.latest) { |
|
|
|
onlyQuickInterval = datasourcesHasAggregation(this.widget.config.datasources); |
|
|
|
onlyQuickInterval = widgetDatasourcesHasAggregation(this.widget); |
|
|
|
if (canHaveTimewindow) { |
|
|
|
onlyHistoryTimewindow = datasourcesHasOnlyComparisonAggregation(this.widget.config.datasources); |
|
|
|
onlyHistoryTimewindow = widgetDatasourcesHasOnlyComparisonAggregation(this.widget); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|