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

UI: Masonry layout for widgets #2845

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@
"d3": "^7.9.0",
"date-fns": "^2.30.0",
"file-saver-es": "^2.0.5",
"masonry-layout": "^4.2.2",
"ng2-charts": "4.1.1",
"ngx-cookie-service": "18.0.0",
"ngx-device-detector": "^8.0.0",
"ngx-masonry": "^14.0.1",
"ngx-spinner": "^16.0.2",
"roboto-fontface": "^0.10.0",
"rxjs": "~6.6.7",
Expand Down
239 changes: 120 additions & 119 deletions ui/src/app/edge/live/live.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,140 +15,141 @@

<!-- Widgets -->
<ion-col size="12" size-md="8" size-lg="6" class="ion-no-padding">
<ion-grid class="ion-no-padding">
<ion-row>
<!-- Regular Widgets -->
<ng-container *ngFor="let clazz of widgets.classes" [ngSwitch]="clazz">
<ngx-masonry [options]="masonryOptions" [updateLayout]="updateMasonryLayout" class="masonry-grid">
<div class="ion-no-padding masonry-sizer"></div>

<ion-col *ngSwitchCase="'Common_Autarchy'" size="12" size-lg="6" class="ion-no-padding">
<Common_Autarchy></Common_Autarchy>
</ion-col>
<!-- Regular Widgets -->
<ng-container *ngFor="let clazz of widgets.classes" [ngSwitch]="clazz">

<ion-col *ngSwitchCase="'Common_Selfconsumption'" size="12" size-lg="6" class="ion-no-padding">
<Common_Selfconsumption></Common_Selfconsumption>
</ion-col>
<div *ngSwitchCase="'Common_Autarchy'" class="ion-no-padding masonry-item">
<Common_Autarchy></Common_Autarchy>
</div>

<ion-col *ngSwitchCase="'Storage'" size="12" size-lg="6" class="ion-no-padding">
<storage></storage>
</ion-col>
<div *ngSwitchCase="'Common_Selfconsumption'" class="ion-no-padding masonry-item">
<Common_Selfconsumption></Common_Selfconsumption>
</div>

<ion-col *ngSwitchCase="'Grid'" size="12" size-lg="6" class="ion-no-padding">
<grid></grid>
</ion-col>
<div *ngSwitchCase="'Storage'" class="ion-no-padding masonry-item">
<storage></storage>
</div>

<ion-col *ngSwitchCase="'Common_Production'" size="12" size-lg="6" class="ion-no-padding">
<Common_Production></Common_Production>
</ion-col>
<div *ngSwitchCase="'Grid'" class="ion-no-padding masonry-item">
<grid></grid>
</div>

<ion-col *ngSwitchCase="'Consumption'" size="12" size-lg="6" class="ion-no-padding">
<consumption></consumption>
</ion-col>
<div *ngSwitchCase="'Common_Production'" class="ion-no-padding masonry-item">
<Common_Production></Common_Production>
</div>

</ng-container>

<!-- Widgets depending on the configuration of the OpenEMS Edge -->
<ng-container *ngFor="let widget of widgets.list" [ngSwitch]="widget.name">

<!-- Widgets that are likely to be configured frequently -->

<ng-container *ngIf="config.components[widget.componentId].factoryId as factoryId">
<ng-container
*ngIf="factoryId !== 'Evcs.Cluster.PeakShaving' && factoryId !== 'Evcs.Cluster.SelfConsumption'">
<ion-col *ngSwitchCase="'io.openems.edge.evcs.api.Evcs'" size="12" size-lg="6" class="ion-no-padding">
<Controller_Evcs [componentId]="widget.componentId"></Controller_Evcs>
</ion-col>
</ng-container>
</ng-container>

<ion-col *ngSwitchCase="'Evcs.Cluster.SelfConsumption'" size="12" size-lg="6" class="ion-no-padding">
<Evcs_Api_Cluster [componentId]="widget.componentId"></Evcs_Api_Cluster>
</ion-col>
<div *ngSwitchCase="'Consumption'" class="ion-no-padding masonry-item">
<consumption></consumption>
</div>

<ion-col *ngSwitchCase="'Evcs.Cluster.PeakShaving'" size="12" size-lg="6" class="ion-no-padding">
<Evcs_Api_Cluster [componentId]="widget.componentId"></Evcs_Api_Cluster>
</ion-col>
</ng-container>

<ion-col *ngSwitchCase="'Controller.ChannelThreshold'" size="12" size-lg="6" class="ion-no-padding">
<Controller_Channelthreshold [componentId]="widget.componentId"></Controller_Channelthreshold>
</ion-col>
<!-- Widgets depending on the configuration of the OpenEMS Edge -->
<ng-container *ngFor="let widget of widgets.list" [ngSwitch]="widget.name">

<ion-col *ngSwitchCase="'io.openems.impl.controller.channelthreshold.ChannelThresholdController'"
size="12" size-lg="6" class="ion-no-padding">
<Controller_Channelthreshold [componentId]="widget.componentId"></Controller_Channelthreshold>
</ion-col>
<!-- Widgets that are likely to be configured frequently -->

<ion-col *ngSwitchCase="'Controller.Io.FixDigitalOutput'" size="12" size-lg="6" class="ion-no-padding">
<Controller_Io_FixDigitalOutput [componentId]="widget.componentId"></Controller_Io_FixDigitalOutput>
</ion-col>

<ng-container *ngIf="isModbusTcpWidgetAllowed">
<ion-col *ngSwitchCase="'Controller.Api.ModbusTcp.ReadWrite'" size="12" size-lg="6"
class="ion-no-padding">
<Controller_Api_ModbusTcp [componentId]="widget.componentId"></Controller_Api_ModbusTcp>
</ion-col>
<ng-container *ngIf="config.components[widget.componentId].factoryId as factoryId">
<ng-container
*ngIf="factoryId !== 'Evcs.Cluster.PeakShaving' && factoryId !== 'Evcs.Cluster.SelfConsumption'">
<div *ngSwitchCase="'io.openems.edge.evcs.api.Evcs'" class="ion-no-padding masonry-item">
<Controller_Evcs [componentId]="widget.componentId"></Controller_Evcs>
</div>
</ng-container>
</ng-container>

<!-- Widgets that are likely to be configured seldomly -->

<ion-col *ngSwitchCase="'Controller.CHP.SoC'" size="12" size-lg="6" class="ion-no-padding">
<Controller_ChpSocComponent [componentId]="widget.componentId"></Controller_ChpSocComponent>
</ion-col>

<ion-col *ngSwitchCase="'Controller.IO.HeatingElement'" size="12" size-lg="6" class="ion-no-padding">
<Controller_Io_HeatingElement [componentId]="widget.componentId"></Controller_Io_HeatingElement>
</ion-col>

<ion-col *ngSwitchCase="'Controller.Io.HeatPump.SgReady'" size="12" size-lg="6" class="ion-no-padding">
<Controller_Io_Heatpump [componentId]="widget.componentId"></Controller_Io_Heatpump>
</ion-col>

<ion-col *ngSwitchCase="'Controller.Symmetric.PeakShaving'" size="12" size-lg="6" class="ion-no-padding">
<Controller_Symmetric_PeakShaving [componentId]="widget.componentId"></Controller_Symmetric_PeakShaving>
</ion-col>

<ion-col *ngSwitchCase="'Controller.Asymmetric.PeakShaving'" size="12" size-lg="6" class="ion-no-padding">
<Controller_Asymmetric_PeakShaving [componentId]="widget.componentId">
</Controller_Asymmetric_PeakShaving>
</ion-col>

<ion-col *ngSwitchCase="'Controller.TimeslotPeakshaving'" size="12" size-lg="6" class="ion-no-padding">
<Controller_Symmetric_TimeSlot_PeakShaving [componentId]="widget.componentId">
</Controller_Symmetric_TimeSlot_PeakShaving>
</ion-col>

<ion-col *ngSwitchCase="'Controller.Ess.DelayedSellToGrid'" size="12" size-lg="6" class="ion-no-padding">
<delayedselltogrid [componentId]="widget.componentId"></delayedselltogrid>
</ion-col>

<ion-col *ngSwitchCase="'Controller.IO.ChannelSingleThreshold'" size="12" size-lg="6"
class="ion-no-padding">
<Controller_Io_ChannelSingleThresholdComponent [componentId]="widget.componentId">
</Controller_Io_ChannelSingleThresholdComponent>
</ion-col>

<ion-col *ngSwitchCase="'Controller.Ess.Time-Of-Use-Tariff'" size="12" size-lg="6" class="ion-no-padding">
<Controller_Ess_TimeOfUseTariff [componentId]="widget.componentId">
</Controller_Ess_TimeOfUseTariff>
</ion-col>

<ion-col *ngSwitchCase="'io.openems.edge.io.api.DigitalInput'" size="12" size-lg="6"
class="ion-no-padding">
<Io_Api_DigitalInput></Io_Api_DigitalInput>
</ion-col>

<ion-col size="12" *ngSwitchCase="'Controller.Ess.FixActivePower'" size-lg="6" class="ion-no-padding">
<Controller_Ess_FixActivePower [componentId]="widget.componentId"></Controller_Ess_FixActivePower>
</ion-col>

<ion-col size="12" *ngSwitchCase="'Controller.Ess.GridOptimizedCharge'" size-lg="6"
class="ion-no-padding">
<Controller_Ess_GridOptimizedCharge [componentId]="widget.componentId">
</Controller_Ess_GridOptimizedCharge>
</ion-col>
<div *ngSwitchCase="'Evcs.Cluster.SelfConsumption'" class="ion-no-padding masonry-item">
<Evcs_Api_Cluster [componentId]="widget.componentId"></Evcs_Api_Cluster>
</div>

<div *ngSwitchCase="'Evcs.Cluster.PeakShaving'" class="ion-no-padding masonry-item">
<Evcs_Api_Cluster [componentId]="widget.componentId"></Evcs_Api_Cluster>
</div>

<div *ngSwitchCase="'Controller.ChannelThreshold'" class="ion-no-padding masonry-item">
<Controller_Channelthreshold [componentId]="widget.componentId">
</Controller_Channelthreshold>
</div>

<div *ngSwitchCase="'io.openems.impl.controller.channelthreshold.ChannelThresholdController'"
class="ion-no-padding masonry-item">
<Controller_Channelthreshold [componentId]="widget.componentId">
</Controller_Channelthreshold>
</div>

<div *ngSwitchCase="'Controller.Io.FixDigitalOutput'" class="ion-no-padding masonry-item">
<Controller_Io_FixDigitalOutput [componentId]="widget.componentId">
</Controller_Io_FixDigitalOutput>
</div>

<ng-container *ngIf="isModbusTcpWidgetAllowed">
<div *ngSwitchCase="'Controller.Api.ModbusTcp.ReadWrite'" class="ion-no-padding masonry-item">
<Controller_Api_ModbusTcp [componentId]="widget.componentId"></Controller_Api_ModbusTcp>
</div>
</ng-container>

</ion-row>
</ion-grid>
<!-- Widgets that are likely to be configured seldomly -->

<div *ngSwitchCase="'Controller.CHP.SoC'" class="ion-no-padding masonry-item">
<Controller_ChpSocComponent [componentId]="widget.componentId"></Controller_ChpSocComponent>
</div>

<div *ngSwitchCase="'Controller.IO.HeatingElement'" class="ion-no-padding masonry-item">
<Controller_Io_HeatingElement [componentId]="widget.componentId">
</Controller_Io_HeatingElement>
</div>

<div *ngSwitchCase="'Controller.Io.HeatPump.SgReady'" class="ion-no-padding masonry-item">
<Controller_Io_Heatpump [componentId]="widget.componentId"></Controller_Io_Heatpump>
</div>

<div *ngSwitchCase="'Controller.Symmetric.PeakShaving'" class="ion-no-padding masonry-item">
<Controller_Symmetric_PeakShaving [componentId]="widget.componentId">
</Controller_Symmetric_PeakShaving>
</div>

<div *ngSwitchCase="'Controller.Asymmetric.PeakShaving'" class="ion-no-padding masonry-item">
<Controller_Asymmetric_PeakShaving [componentId]="widget.componentId">
</Controller_Asymmetric_PeakShaving>
</div>

<div *ngSwitchCase="'Controller.TimeslotPeakshaving'" class="ion-no-padding masonry-item">
<Controller_Symmetric_TimeSlot_PeakShaving [componentId]="widget.componentId">
</Controller_Symmetric_TimeSlot_PeakShaving>
</div>

<div *ngSwitchCase="'Controller.Ess.DelayedSellToGrid'" class="ion-no-padding masonry-item">
<delayedselltogrid [componentId]="widget.componentId"></delayedselltogrid>
</div>

<div *ngSwitchCase="'Controller.IO.ChannelSingleThreshold'" class="ion-no-padding masonry-item">
<Controller_Io_ChannelSingleThresholdComponent [componentId]="widget.componentId">
</Controller_Io_ChannelSingleThresholdComponent>
</div>

<div *ngSwitchCase="'Controller.Ess.Time-Of-Use-Tariff'" class="ion-no-padding masonry-item">
<Controller_Ess_TimeOfUseTariff [componentId]="widget.componentId">
</Controller_Ess_TimeOfUseTariff>
</div>

<div *ngSwitchCase="'io.openems.edge.io.api.DigitalInput'" class="ion-no-padding masonry-item">
<Io_Api_DigitalInput></Io_Api_DigitalInput>
</div>

<div *ngSwitchCase="'Controller.Ess.FixActivePower'" class="ion-no-padding masonry-item">
<Controller_Ess_FixActivePower [componentId]="widget.componentId">
</Controller_Ess_FixActivePower>
</div>

<div *ngSwitchCase="'Controller.Ess.GridOptimizedCharge'" class="ion-no-padding masonry-item">
<Controller_Ess_GridOptimizedCharge [componentId]="widget.componentId">
</Controller_Ess_GridOptimizedCharge>
</div>
</ng-container>
</ngx-masonry>
</ion-col>
</ion-row>
</ion-grid>
Expand Down
Loading