Skip to content

Commit

Permalink
updated dashboard; upgraded to latest plotly.js 1.49.4
Browse files Browse the repository at this point in the history
  • Loading branch information
geneacs committed Aug 28, 2019
1 parent 6233b66 commit 96d1dad
Show file tree
Hide file tree
Showing 33 changed files with 1,356 additions and 884 deletions.
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,18 @@
"@angular/router": "~8.1.0",
"@hyperiot/components": "0.0.3",
"@hyperiot/core": "^0.2.0",
"@hyperiot/widgets": "0.0.8",
"@hyperiot/widgets": "0.0.9",
"@ngx-translate/i18n-polyfill": "^1.0.0",
"angular-gridster2": "^8.0.0",
"angular-plotly.js": "^1.3.2",
"bootstrap": "^4.3.1",
"crypto-js": "^3.1.9-1",
"gulp": "^4.0.2",
"gulp-json-editor": "^2.5.2",
"hammerjs": "^2.0.8",
"map-stream": "0.0.7",
"moment": "^2.24.0",
"ngx-cookie-service": "^2.2.0",
"patch-package": "^6.1.2",
"plotly.js": "1.48.3",
"ngx-moment": "^3.4.0",
"plotly.js": "1.49.4",
"rxjs": "~6.4.0",
"tslib": "^1.9.0",
"zone.js": "~0.9.1"
Expand All @@ -56,13 +55,16 @@
"@types/jasminewd2": "~2.0.3",
"@types/node": "^8.9.5",
"codelyzer": "^5.0.0",
"gulp": "^4.0.2",
"gulp-json-editor": "^2.5.2",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"patch-package": "^6.1.2",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.15.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
diff --git a/node_modules/plotly.js/dist/plotly.js b/node_modules/plotly.js/dist/plotly.js
index 6557dcc..e5cbe64 100644
index 441db1e..e4f4976 100644
--- a/node_modules/plotly.js/dist/plotly.js
+++ b/node_modules/plotly.js/dist/plotly.js
@@ -32478,7 +32478,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
@@ -34417,7 +34417,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
return request.responseXML;
});
if (typeof define === "function" && define.amd) this.d3 = d3, define(d3); else if (typeof module === "object" && module.exports) module.exports = d3; else this.d3 = d3;
-}();
+}.apply(self);
},{}],158:[function(_dereq_,module,exports){
},{}],164:[function(_dereq_,module,exports){
module.exports = function () {
for (var i = 0; i < arguments.length; i++) {
68 changes: 68 additions & 0 deletions proxy-local.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"/hyperiot/authentication/*": {
"target": "http://localhost:8181",
"secure": false,
"logLevel": "debug",
"changeOrigin": true
},
"/hyperiot/husers/*": {
"target": "http://localhost:8181",
"secure": false,
"logLevel": "debug",
"changeOrigin": true
},
"/hyperiot/roles/*": {
"target": "http://localhost:8181",
"secure": false,
"logLevel": "debug",
"changeOrigin": true
},
"/hyperiot/permissions/*": {
"target": "http://localhost:8181",
"secure": false,
"logLevel": "debug",
"changeOrigin": true
},
"/hyperiot/hprojects/*": {
"target": "http://localhost:8181",
"secure": false,
"logLevel": "debug",
"changeOrigin": true
},
"/hyperiot/hdevices/*": {
"target": "http://localhost:8181",
"secure": false,
"logLevel": "debug",
"changeOrigin": true
},
"/hyperiot/hpackets/*": {
"target": "http://localhost:8181",
"secure": false,
"logLevel": "debug",
"changeOrigin": true
},
"/hyperiot/rules/*": {
"target": "http://localhost:8181",
"secure": false,
"logLevel": "debug",
"changeOrigin": true
},
"/hyperiot/dashboards/*": {
"target": "http://localhost:8181",
"secure": false,
"logLevel": "debug",
"changeOrigin": true
},
"/hyperiot/dashboardwidgets/*": {
"target": "http://localhost:8181",
"secure": false,
"logLevel": "debug",
"changeOrigin": true
},
"/hyperiot/ws/*": {
"target": "http://localhost:8181",
"secure": false,
"logLevel": "debug",
"ws": true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
top: 0; left: 0; bottom: 0; right: 0;
background-color: rgba(0,0,0,0.5);
z-index: 100;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
/* variables */
--header-height: 32px;
--footer-height: 32px;
Expand All @@ -11,10 +15,10 @@
}

.dialog {
position: absolute;
position: relative;
width: 100%; height: 600px;
max-width: 800px;
overflow: hidden;
top: 48px; bottom: 48px;
left: 48px; right: 48px;
background: white;
border: solid 1px rgba(0, 0, 0, 0.1);
padding-top: var(--header-height);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
Component,
OnInit,
ElementRef,
OnDestroy,
Output,
EventEmitter,
HostListener
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/dashboard/dashboard-config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';

import { map } from 'rxjs/operators';
import { Subject } from 'rxjs';

import {
DashboardwidgetsService,
DashboardsService,
DashboardWidget
} from '@hyperiot/core';
import { Subject } from 'rxjs';

@Injectable()
export class DashboardConfigService {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div>
<button (click)="saveDashboard()" [disabled]="dashboardLayout.isDirty()" i18n="@@dashboardButtonSave">Save</button>
<button [routerLink]="[{outlets: { modal: [ 'widgets' ] }}]">Add widget</button>
<button (click)="saveDashboard()" [disabled]="dashboardLayout.isDirty()" i18n="@@dashboardButtonSave">Save</button>
<button [routerLink]="[{outlets: { modal: [ 'widgets' ] }}]">Add widget</button>
</div>

<hyt-widgets-layout [dashboardId]="dashboardId"></hyt-widgets-layout>
Expand Down
5 changes: 3 additions & 2 deletions src/app/pages/dashboard/dashboard.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NgModule } from '@angular/core';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { CommonModule } from '@angular/common';
import { WidgetsLayoutComponent } from './widgets-layout/widgets-layout.component';
import { DynamicWidgetComponent } from './dynamic-widget/dynamic-widget.component';
Expand Down Expand Up @@ -44,6 +44,7 @@ import { RouterModule } from '@angular/router';
providers: [
DashboardConfigService
],
exports: []
exports: [],
schemas: [ CUSTOM_ELEMENTS_SCHEMA ]
})
export class DashboardModule { }
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
<!-- List of widget that can be dynamically loaded -->

<hyperiot-time-chart *ngIf="widget.type === 'time-chart'" [widget]="widget" (widgetAction)="onWidgetAction($event)">
</hyperiot-time-chart>
<hyperiot-time-chart
*ngIf="widget.type === 'time-chart'"
[widget]="widget"
(widgetAction)="onWidgetAction($event)"></hyperiot-time-chart>

<hyperiot-stats-chart
*ngIf="widget.type === 'stats-chart'"
[widget]="widget"
(widgetAction)="onWidgetAction($event)"></hyperiot-stats-chart>

<hyperiot-stats-chart *ngIf="widget.type === 'stats-chart'" [widget]="widget" (widgetAction)="onWidgetAction($event)">
</hyperiot-stats-chart>
<hyperiot-sensor-value
*ngIf="widget.type === 'sensor-value'"
[widget]="widget"
(widgetAction)="onWidgetAction($event)"></hyperiot-sensor-value>

<hyperiot-sensor-value *ngIf="widget.type === 'sensor-value'" [widget]="widget" (widgetAction)="onWidgetAction($event)">
</hyperiot-sensor-value>
<!--
<hyperiot-gauge-value
*ngIf="widget.type === 'gauge-value'"
[widget]="widget"
(widgetAction)="onWidgetAction($event)"></hyperiot-gauge-value> -->
(widgetAction)="onWidgetAction($event)"></hyperiot-gauge-value>

<hyperiot-events-log *ngIf="widget.type === 'events-log'" [widget]="widget" (widgetAction)="onWidgetAction($event)">
</hyperiot-events-log>
<hyperiot-events-log
*ngIf="widget.type === 'events-log'"
[widget]="widget"
(widgetAction)="onWidgetAction($event)"></hyperiot-events-log>

<hyperiot-text-label *ngIf="widget.type === 'text-label'" [widget]="widget" (widgetAction)="onWidgetAction($event)">
</hyperiot-text-label>
<hyperiot-text-label
*ngIf="widget.type === 'text-label'"
[widget]="widget"
(widgetAction)="onWidgetAction($event)"></hyperiot-text-label>
Original file line number Diff line number Diff line change
@@ -1,36 +1,39 @@
<div class="padding-6 d-flex flex-column justify-content-stretch">

<ng-container *ngIf="widget.config">
<ng-container *ngIf="widget.config">

<div class="d-flex flex-column">
<label for="packet-select" [ngClass]="{'error-color': selectedPacket == null}"
i18n="@@widgetSettingsDialog/packet-lbl-type">Select packet</label>
<select size="5" [(ngModel)]="selectedPacket" [compareWith]="packetCompare" (ngModelChange)="onPacketChange()"
name="packet-select" id="packet-select" required>
<option *ngFor="let packet of projectPackets" [ngValue]="packet" selected>
{{packet.name}}
({{packet.id}})
</option>
</select>
</div>
<div class="d-flex flex-column">
<label for="packet-select" [ngClass]="{'error-color': selectedPacket == null}"
i18n="@@widgetSettingsDialog/packet-lbl-type">Select packet</label>
<select size="5"
[(ngModel)]="selectedPacket" [compareWith]="packetCompare"
(ngModelChange)="onPacketChange()"
name="packet-select" id="packet-select" required>
<option *ngFor="let packet of projectPackets" [ngValue]="packet" selected>
{{packet.name}}
({{packet.id}})
</option>
</select>
</div>

</ng-container>
</ng-container>

<ng-container *ngIf="selectedPacket != null">
<ng-container *ngIf="selectedPacket != null">

<div class="d-flex flex-column">
<label for="field-select"
[ngClass]="{'error-color': selectedFields == null || selectedFields.length === 0 || selectedFields[0] === null}"
i18n="@@widgetSettingsDialog/packet-lbl-fields">
Select {multiPacketSelect?1:0, plural, =0 {field} other {fields}}
</label>
<select [size]="multiPacketSelect ? 5 : null" [(ngModel)]="selectedFields" [multiple]="multiPacketSelect"
(ngModelChange)="onPacketFieldChange($event)" name="field-select" id="field-select" required minlength="1">
<option *ngIf="!multiPacketSelect" [ngValue]="null"></option>
<option *ngFor="let field of selectedPacket.fields" [ngValue]="field">{{field.name}}</option>
</select>
</div>
<div class="d-flex flex-column">
<label for="field-select" [ngClass]="{'error-color': selectedFields == null || selectedFields.length === 0}"
i18n="@@widgetSettingsDialog/packet-lbl-fields">
Select {multiPacketSelect?1:0, plural, =0 {field} other {fields}}
</label>
<select [size]="multiPacketSelect ? 5 : null"
[(ngModel)]="selectedFields" [multiple]="multiPacketSelect"
(ngModelChange)="onPacketFieldChange($event)"
name="field-select" id="field-select" required minlength="1">
<option *ngIf="!multiPacketSelect" [ngValue]="null"></option>
<option *ngFor="let field of selectedPacket.fields" [ngValue]="field">{{field.name}}</option>
</select>
</div>

</ng-container>
</ng-container>

</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core';
import { ControlContainer, NgForm } from '@angular/forms';

import { HPacket, HPacketField, HpacketsService } from '@hyperiot/core';
import { NgForm, ControlContainer } from '@angular/forms';

@Component({
selector: 'hyt-packet-select',
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<hyt-packet-select [widget]="widget"></hyt-packet-select>
<hyt-packet-select [widget]="widget"></hyt-packet-select>
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
import { Component, OnInit, Input, OnDestroy, ViewChild } from '@angular/core';
import { NgForm } from '@angular/forms';

import { Subject } from 'rxjs';

import { PacketSelectComponent } from '../packet-select/packet-select.component';
import { NgForm, ControlContainer } from '@angular/forms';

@Component({
selector: 'hyt-sensor-value-settings',
templateUrl: './sensor-value-settings.component.html',
styleUrls: ['./sensor-value-settings.component.css'],
viewProviders: [{ provide: ControlContainer, useExisting: NgForm }]
styleUrls: ['./sensor-value-settings.component.css']
})
export class SensorValueSettingsComponent implements OnInit, OnDestroy {
@ViewChild(PacketSelectComponent, { static: true }) packetSelect: PacketSelectComponent;
@ViewChild(PacketSelectComponent, {static: true}) packetSelect: PacketSelectComponent;
@Input() modalApply: Subject<any>;
@Input() widget;

constructor(public settingsForm: NgForm) { }

ngOnInit() {
this.modalApply.subscribe((event) => {
if (event === 'apply') {
this.apply();
}
if (event === 'apply') {
this.apply();
}
});
}
ngOnDestroy() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Component, OnInit, Input, OnDestroy } from '@angular/core';
import { ControlContainer, NgForm } from '@angular/forms';

import { Subject } from 'rxjs';
import { NgForm, ControlContainer } from '@angular/forms';

@Component({
selector: 'hyt-stats-chart-settings',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<hyt-packet-select [widget]="widget" [multiPacketSelect]="true" [selectedFields]="selectedFields"
(selectedFieldsChange)="onSelectedFieldsChange($event)"></hyt-packet-select>
<hyt-packet-select [widget]="widget" [multiPacketSelect]="true" [selectedFields]="selectedFields" (selectedFieldsChange)="onSelectedFieldsChange($event)"></hyt-packet-select>
<!--
<div *ngFor="let field of selectedFields">{{field.name}}</div>
-->
<!-- Plotly chart specific options -->

<div class="padding-6 d-flex flex-column justify-content-stretch">
<!-- not yet implemented -->
<!-- not yet implemented -->
</div>
Loading

0 comments on commit 96d1dad

Please sign in to comment.