You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ri...@apache.org on 2020/03/07 21:34:04 UTC
[incubator-streampipes] 02/04: Remove old Angular1 dashboard
This is an automated email from the ASF dual-hosted git repository.
riemer pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git
commit 2291fb6c881317d5e83e787cb2f03f82cfe54c8e
Author: Dominik Riemer <ri...@fzi.de>
AuthorDate: Sat Mar 7 20:34:27 2020 +0100
Remove old Angular1 dashboard
---
.github/workflows/build.yml | 2 +-
ui/src/app/dashboard/add-widget-template.html | 129 ---------------
ui/src/app/dashboard/add-widget.controller.ts | 180 --------------------
.../dashboard/components/config-item.component.ts | 31 ----
.../dashboard/components/config-item.controller.ts | 21 ---
.../app/dashboard/components/config-item.tmpl.html | 29 ----
ui/src/app/dashboard/dashboard-frame.html | 71 --------
ui/src/app/dashboard/dashboard-layout-frame.html | 54 ------
ui/src/app/dashboard/dashboard.controller.ts | 181 ---------------------
ui/src/app/dashboard/dashboard.html | 22 ---
ui/src/app/dashboard/dashboard.module.ts | 148 -----------------
.../no-pipeline-present-dialog.controller.ts | 36 ----
.../dialog/no-pipeline-present-dialog.tmpl.html | 43 -----
.../socket-connection-data-model.service.ts | 102 ------------
.../templates/gauge/gauge-config.component.ts | 30 ----
.../templates/gauge/gauge-data-model.service.ts | 33 ----
.../dashboard/templates/gauge/gauge.directive.ts | 67 --------
ui/src/app/dashboard/templates/gauge/gauge.html | 19 ---
.../app/dashboard/templates/gauge/gaugeConfig.html | 52 ------
.../templates/heatmap/heatmap-config.component.ts | 30 ----
.../heatmap/heatmap-data-model.service.ts | 34 ----
.../templates/heatmap/heatmap.directive.ts | 74 ---------
.../app/dashboard/templates/heatmap/heatmap.html | 25 ---
.../dashboard/templates/heatmap/heatmapConfig.html | 38 -----
.../templates/html/html-config.component.ts | 30 ----
.../templates/html/html-data-model.service.ts | 33 ----
.../app/dashboard/templates/html/html.directive.ts | 51 ------
.../app/dashboard/templates/html/htmlConfig.html | 30 ----
.../app/dashboard/templates/html/htmltemplate.html | 20 ---
.../templates/image/image-config.component.ts | 30 ----
.../templates/image/image-data-model.service.ts | 33 ----
.../dashboard/templates/image/image.directive.ts | 51 ------
ui/src/app/dashboard/templates/image/image.html | 19 ---
.../app/dashboard/templates/image/imageConfig.html | 30 ----
.../templates/line/line-config.component.ts | 31 ----
.../templates/line/line-data-model.service.ts | 33 ----
.../app/dashboard/templates/line/line.directive.ts | 63 -------
ui/src/app/dashboard/templates/line/line.html | 19 ---
.../app/dashboard/templates/line/lineConfig.html | 60 -------
.../map.deprecated/map-config.component.ts | 30 ----
.../map.deprecated/map-data-model.service.ts | 34 ----
.../templates/map.deprecated/map.directive.ts | 48 ------
.../dashboard/templates/map.deprecated/map.html | 25 ---
.../templates/map.deprecated/mapConfig.html | 49 ------
.../templates/map/map-config.component.ts | 36 ----
.../templates/map/map-data-model.service.ts | 34 ----
.../app/dashboard/templates/map/map.directive.ts | 129 ---------------
ui/src/app/dashboard/templates/map/map.html | 37 -----
ui/src/app/dashboard/templates/map/mapConfig.html | 61 -------
.../templates/number/number-config.component.ts | 30 ----
.../templates/number/number-data-model.service.ts | 33 ----
.../dashboard/templates/number/number.directive.ts | 71 --------
ui/src/app/dashboard/templates/number/number.html | 25 ---
.../dashboard/templates/number/numberConfig.html | 27 ---
.../templates/raw/raw-config.component.ts | 30 ----
.../templates/raw/raw-data-model.service.ts | 47 ------
.../app/dashboard/templates/raw/raw.directive.ts | 46 ------
ui/src/app/dashboard/templates/raw/raw.html | 24 ---
ui/src/app/dashboard/templates/raw/rawConfig.html | 19 ---
ui/src/app/dashboard/templates/so.filter.ts | 93 -----------
.../templates/table/table-config.component.ts | 50 ------
.../templates/table/table-data-model.service.ts | 43 -----
.../dashboard/templates/table/table.directive.ts | 84 ----------
ui/src/app/dashboard/templates/table/table.html | 26 ---
.../app/dashboard/templates/table/tableConfig.html | 31 ----
.../trafficlight/trafficlight-config.component.ts | 30 ----
.../trafficlight-data-model.service.ts | 33 ----
.../trafficlight/trafficlight.directive.ts | 80 ---------
.../templates/trafficlight/trafficlight.html | 23 ---
.../templates/trafficlight/trafficlightConfig.html | 62 -------
.../verticalbar/verticalbar-config.component.ts | 31 ----
.../verticalbar/verticalbar-data-model.service.ts | 33 ----
.../templates/verticalbar/verticalbar.directive.ts | 60 -------
.../templates/verticalbar/verticalbar.html | 36 ----
.../templates/verticalbar/verticalbarConfig.html | 49 ------
.../templates/widget-templates.service.ts | 157 ------------------
ui/src/app/dashboard/widget-data-model.service.ts | 46 ------
ui/src/app/dashboard/widget-instances.service.ts | 108 ------------
78 files changed, 1 insertion(+), 3893 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 441dc36..f76b44b 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -97,8 +97,8 @@ jobs:
- name: Build UI
working-directory: ./ui
run: |
+ NODE_PATH=/cache/node_modules
NODE_OPTIONS=--max_old_space_size=6096
- npm cache clean --force
npm install --unsafe-perm
npm run build
- name: Build and Push Docker UI Image
diff --git a/ui/src/app/dashboard/add-widget-template.html b/ui/src/app/dashboard/add-widget-template.html
deleted file mode 100644
index 8b70789..0000000
--- a/ui/src/app/dashboard/add-widget-template.html
+++ /dev/null
@@ -1,129 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<md-dialog aria-label="Add Widget" flex="80" style="max-height:80%;" class="colored-frame">
- <md-toolbar>
- <div class="md-toolbar-tools">
- <h2>Add a new Widget</h2>
- <span flex></span>
- <md-button class="md-icon-button" ng-click="ctrl.cancel()">
- <md-icon md-svg-icon="navigation:ic_close_24px" aria-label="Close dialog"></md-icon>
- </md-button>
- </div>
- </md-toolbar>
- <div layout="row" flex="100" layout-align="center center" class="wizard-row" style="margin-top:3%;margin-bottom:3%;">
- <div layout="column" flex="33" layout-align="center center"
- ng-repeat="(index, p) in ctrl.pages track by $index">
- <md-button ng-class="ctrl.getTabCss(p.type)" aria-label="p.title">{{index+1}}
- </md-button>
- {{p.title}}
- </div>
- </div>
- <md-divider/>
- <md-dialog-content class="md-dialog-content">
- <div flex="100">
- <!-- Select element to visualize -->
- <div flex="100" style="margin:5px;width:100%">
- <div ng-if="ctrl.page == 'select-viz'">
- <h4>{{ctrl.pages[0].description}}</h4>
- <md-grid-list
- md-cols="5" md-row-height="2:2"
- md-gutter="10px">
-
- <md-grid-tile class="gray" ng-repeat="opt in ctrl.visualizablePipelines">
- <div ng-class="ctrl.getSelectedPipelineCss(opt.doc)"
- ng-click="ctrl.selectPipeline(opt.doc)">
- {{ctrl.iconText(opt.doc.name)}}
- <h5>{{opt.doc.name}}</h5>
- <h5>{{opt.doc.visualizationName}}</h5>
- </div>
- </md-grid-tile>
- </md-grid-list>
- </div>
-
- <!-- Select Type -->
- <div ng-if="ctrl.page == 'select-type'">
- <h4>{{ctrl.pages[1].description}}</h4>
- <md-grid-list
- md-cols="5" md-row-height="2:2"
- md-gutter="10px">
-
- <md-grid-tile class="gray" ng-repeat="opt in ctrl.possibleVisualisationTypes">
- <div ng-class="ctrl.getSelectedVisTypeCss(opt.name)"
- ng-click="ctrl.selectVisType(opt.name)">
- <div ng-if="opt.icon == ''" style="color:#39b54a;">{{ctrl.iconText(opt.label)}}
- </div>
- <div ng-if="opt.icon != ''"><i class="material-icons"
- style="font-size:48px;color:#39b54a;">{{opt.icon}}</i>
- </div>
- <h5>{{opt.label}}</h5>
- </div>
- </md-grid-tile>
- </md-grid-list>
- </div>
-
- <!-- Select Scheme -->
- <div ng-if="ctrl.page == 'select-scheme'">
- <b><h4>{{ctrl.pages[2].description}}</h4></b>
- <form name="ctrl.configForm">
- <md-input-container id="scheme-selection" layout="row" flex="100">
- <sp-gauge-widget-config layout="row" flex="100" ng-if="ctrl.selectedType == 'gauge'"
- wid=ctrl.selectedVisualisation></sp-gauge-widget-config>
- <sp-heatmap-widget-config layout="row" flex="100" ng-if="ctrl.selectedType == 'heatmap'"
- wid=ctrl.selectedVisualisation></sp-heatmap-widget-config>
- <sp-line-widget-config layout="row" flex="100" ng-if="ctrl.selectedType == 'line'"
- wid="ctrl.selectedVisualisation" config-form="ctrl.configForm"></sp-line-widget-config>
- <sp-map-widget-config layout="row" flex="100" ng-if="ctrl.selectedType == 'map'"
- wid=ctrl.selectedVisualisation></sp-map-widget-config>
- <sp-number-widget-config layout="row" flex="100" ng-if="ctrl.selectedType == 'number'"
- wid=ctrl.selectedVisualisation></sp-number-widget-config>
- <sp-raw-widget-config layout="row" flex="100" ng-if="ctrl.selectedType == 'raw'"
- wid=ctrl.selectedVisualisation></sp-raw-widget-config>
- <sp-table-widget-config layout="row" flex="100" ng-if="ctrl.selectedType == 'table'"
- wid=ctrl.selectedVisualisation></sp-table-widget-config>
- <sp-trafficlight-widget-config layout="row" flex="100"
- ng-if="ctrl.selectedType == 'trafficlight'"
- wid=ctrl.selectedVisualisation></sp-trafficlight-widget-config>
- <sp-verticalbar-widget-config layout="row" flex="100"
- ng-if="ctrl.selectedType == 'verticalbar'"
- wid=ctrl.selectedVisualisation></sp-verticalbar-widget-config>
- <sp-image-widget-config layout="row" flex="100" ng-if="ctrl.selectedType == 'image'"
- wid=ctrl.selectedVisualisation></sp-image-widget-config>
- <sp-html-widget-config layout="row" flex="100" ng-if="ctrl.selectedType == 'html'"
- wid=ctrl.selectedVisualisation></sp-html-widget-config>
- </md-input-container>
- </form>
- </div>
-
- </div>
- </div>
- </md-dialog-content>
- <md-divider/>
- <md-dialog-actions layout="row">
- <sp-button sp-button-gray ng-click="ctrl.cancel()">
- Cancel
- </sp-button>
- <sp-button sp-button-gray ng-click="ctrl.back()"
- ng-if="!('select-viz'===ctrl.page)">
- Back
- </sp-button>
- <sp-button id="save-viz-button" ng-click="ctrl.next()" ng-disabled="ctrl.configForm.$invalid" sp-button-blue ng-if="ctrl.page === 'select-scheme'">
- Create
- </sp-button>
- </md-dialog-actions>
-</md-dialog>
diff --git a/ui/src/app/dashboard/add-widget.controller.ts b/ui/src/app/dashboard/add-widget.controller.ts
deleted file mode 100644
index e965f93..0000000
--- a/ui/src/app/dashboard/add-widget.controller.ts
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import * as angular from 'angular';
-
-export class AddWidgetCtrl {
-
- page: any;
- $mdDialog: any;
- ElementIconText: any;
- $http: any;
- rerenderDashboard: any;
- dashboard: any;
- layoutId: any;
- WidgetInstaces: any;
- pages: any;
- selectedVisualisation: any;
- possibleVisualisationTypes: any;
- selectedVisualisationType: any;
- visualizablePipelines: any;
- selectedType: any;
- ShepherdService: any;
- configForm: any;
-
- constructor($mdDialog, WidgetTemplates, WidgetInstances, ElementIconText, $http, rerenderDashboard, dashboard, layoutId, ShepherdService) {
- this.page = 'select-viz';
- this.$mdDialog = $mdDialog;
- this.ElementIconText = ElementIconText;
- this.$http = $http;
- this.rerenderDashboard = rerenderDashboard;
- this.dashboard = dashboard;
- this.layoutId = layoutId;
- this.ShepherdService = ShepherdService;
-
- this.WidgetInstaces = WidgetInstances;
-
- this.pages = [{
- type: "select-viz",
- title: "Data Stream",
- description: "Select a data stream you'd like to visualize"
- }, {
- type: "select-type",
- title: "Visualization Type",
- description: "Select a visualization type"
- }, {
- type: "select-scheme",
- title: "Visualization Settings",
- description: "Customize your visualization"
- }];
-
- // this.visualizablePipelines = angular.copy(visualizablePipelines);
-
- // This is the object that the user manipulates
- this.selectedVisualisation = {};
-
- this.possibleVisualisationTypes = WidgetTemplates.getAllNames();
- this.selectedVisualisationType = '';
-
- this.visualizablePipelines = [];
-
- this.$http.get('/visualizablepipeline/_all_docs?include_docs=true')
- .then(msg => {
- let data = msg.data;
- var tempVisPipelines = data.rows;
-
- // get the names for each pipeline
- angular.forEach(tempVisPipelines, vis => {
- this.$http.get('/pipeline/' + vis.doc.pipelineId)
- .then(msg => {
- let pipeline = msg.data;
- vis.doc.name = pipeline.name;
- this.visualizablePipelines.push(vis);
- });
- });
- this.ShepherdService.trigger("add-viz");
- });
-
-
- }
-
-
- iconText(elementName) {
- return this.ElementIconText.getElementIconText(elementName);
- }
-
- selectPipeline(vis) {
- this.selectedVisualisation = vis;
- this.next();
- this.ShepherdService.trigger("select-pipeline");
-
- }
-
- selectVisType(type) {
- this.selectedType = type;
- this.next();
- this.ShepherdService.trigger("select-viz");
-
- }
-
- getSelectedPipelineCss(vis) {
- return this.getSelectedCss(this.selectedVisualisation, vis);
- }
-
- getSelectedVisTypeCss(type) {
- return this.getSelectedCss(this.selectedType, type);
- }
-
- getSelectedCss(selected, current) {
- if (selected == current) {
- return "wizard-preview wizard-preview-selected";
- } else {
- return "wizard-preview";
- }
- }
-
- getTabCss(page) {
- if (page == this.page) return "md-fab md-accent";
- else return "md-fab md-accent wizard-inactive";
- }
-
- back() {
- if (this.page == 'select-type') {
- this.page = 'select-viz';
- } else if (this.page == 'select-scheme') {
- this.page = 'select-type';
- }
- }
-
- next() {
- if (this.page == 'select-viz') {
- this.page = 'select-type';
- } else if (this.page == 'select-type') {
- this.page = 'select-scheme';
-
- // var directiveName = 'sp-' + this.selectedType + '-widget-config'
- // var widgetConfig = this.$compile( '<'+ directiveName + ' wid=selectedVisualisation></' + directiveName + '>')( this );
- //
- // var schemaSelection = angular.element( document.querySelector( '#scheme-selection' ) );
- // schemaSelection.append( widgetConfig );
-
-
- } else {
-
- var widget = {};
- widget['visualisationType'] = this.selectedType;
- widget['visualisation'] = this.selectedVisualisation;
- widget['layoutId'] = this.layoutId;
-
-
- widget['visualisationId'] = this.selectedVisualisation._id;
- this.WidgetInstaces.add(widget);
- //this.rerenderDashboard(this.dashboard);
- this.dashboard.addWidget(widget);
- this.$mdDialog.cancel();
- this.ShepherdService.trigger("save-viz");
-
- }
- }
-
- cancel() {
- this.$mdDialog.cancel();
- };
-}
-
-AddWidgetCtrl.$inject = ['$mdDialog', 'WidgetTemplates', 'WidgetInstances', 'ElementIconText', '$http', 'rerenderDashboard', 'dashboard', 'layoutId', 'ShepherdService'];
diff --git a/ui/src/app/dashboard/components/config-item.component.ts b/ui/src/app/dashboard/components/config-item.component.ts
deleted file mode 100644
index 43847f9..0000000
--- a/ui/src/app/dashboard/components/config-item.component.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import {ConfigItemController} from "./config-item.controller";
-
-declare const require: any;
-
-export let ConfigItemComponent = {
- template: require('./config-item.tmpl.html'),
- bindings: {
- elementTitle: "@",
- },
- controller: ConfigItemController,
- controllerAs: 'ctrl',
- transclude: true
-};
diff --git a/ui/src/app/dashboard/components/config-item.controller.ts b/ui/src/app/dashboard/components/config-item.controller.ts
deleted file mode 100644
index c10b2bd..0000000
--- a/ui/src/app/dashboard/components/config-item.controller.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-export class ConfigItemController {
-
-}
\ No newline at end of file
diff --git a/ui/src/app/dashboard/components/config-item.tmpl.html b/ui/src/app/dashboard/components/config-item.tmpl.html
deleted file mode 100644
index 61f7d23..0000000
--- a/ui/src/app/dashboard/components/config-item.tmpl.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<div flex="100" layout="column" class="customize-item-main sp-blue-border-nopadding">
- <div class="customize-item-title sp-blue-bg" layout="row" flex="100"
- layout-align="space-between center">
- <div>
- {{ctrl.elementTitle}}
- </div>
- </div>
- <div class="customize-item-content">
- <ng-transclude></ng-transclude>
- </div>
-</div>
\ No newline at end of file
diff --git a/ui/src/app/dashboard/dashboard-frame.html b/ui/src/app/dashboard/dashboard-frame.html
deleted file mode 100644
index d6ad5a2..0000000
--- a/ui/src/app/dashboard/dashboard-frame.html
+++ /dev/null
@@ -1,71 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<div>
- <div class="btn-toolbar" ng-if="!options.hideToolbar">
- <div class="btn-group" ng-if="!options.widgetButtons">
- <span class="dropdown" on-toggle="toggled(open)">
- <!--<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">-->
- <!--Button dropdown <span class="caret"></span>-->
- <!--</button>-->
- <ul class="dropdown-menu" role="menu">
- <li ng-repeat="widget in widgetDefs">
- <a href="#" ng-click="addWidgetInternal($event, widget);" class="dropdown-toggle"><span class="label label-primary">{{widget.name}}</span></a>
- </li>
- </ul>
- </span>
- </div>
- <div class="btn-group" ng-if="options.widgetButtons">
- <md-button ng-repeat="widget in widgetDefs"
- ng-click="addWidgetInternal($event, widget);" type="button" class="md-accent">
- {{widget.name}}
- </md-button>
- </div>
-
- <sp-button id="add-viz-button" sp-button-blue ng-click="ctrl.addSpWidget(layout);" type="button">Add visualization</sp-button>
- </div>
-
- <div ui-sortable="sortableOptions" ng-model="widgets" class="dashboard-widget-area">
- <div ng-repeat="widget in widgets" ng-style="widget.containerStyle" class="widget-container" widget>
- <div class="widget">
- <div class="widget-header sp-blue-bg">
- <div layout="row" layout-align="start center">
-
- <span class="widget-title" ng-dblclick="editTitle(widget)" ng-hide="widget.editingTitle">{{widget.name}} </span>
- <form action="" class="widget-title" ng-show="widget.editingTitle" ng-submit="saveTitleEdit(widget)">
- <input type="text" ng-model="widget.title" class="form-control">
- </form>
- <!-- <span class="widget-label widget-label-accent" ng-if="!options.hideWidgetName">{{widget.name}}</span> -->
- <span flex></span>
- <md-button class="md-icon-button" ng-click="widget.contentStyle.display = widget.contentStyle.display === 'none' ? 'block' : 'none'">
- <i ng-if="widget.contentStyle.display === 'none'" class="material-icons">visibility</i>
- <i ng-if="widget.contentStyle.display !== 'none'" class="material-icons">visibility_off</i>
- </md-button>
- <!-- <md-button class="md-icon-button" ng-click="openWidgetSettings(widget);" ng-if="!options.hideWidgetSettings"><i class="material-icons">settings</i></md-button> -->
- <md-button class="md-icon-button" ng-click="ctrl.maximizeSpWidget(widget);" ng-if="!widget.maximized"><i class="material-icons">fullscreen</i></md-button>
- <md-button class="md-icon-button" ng-click="ctrl.minimizeSpWidget(widget);" ng-if="widget.maximized"><i class="material-icons">fullscreen_exit</i></md-button>
- <md-button class="md-icon-button" ng-click="ctrl.removeSpWidget(widget);" ng-if="!options.hideWidgetClose"><i class="material-icons">clear</i></md-button>
- </div>
- </div>
- <div layout="row" layout-align="center center"><div class="panel-body widget-content" layout="row" layout-align="center center" ng-style="widget.contentStyle"></div></div>
- <div class="widget-ew-resizer" ng-mousedown="grabResizer($event)"></div>
- <div ng-if="widget.enableVerticalResize" class="widget-s-resizer" ng-mousedown="grabSouthResizer($event)"></div>
- </div>
- </div>
- </div>
-</div>
diff --git a/ui/src/app/dashboard/dashboard-layout-frame.html b/ui/src/app/dashboard/dashboard-layout-frame.html
deleted file mode 100644
index a415d3d..0000000
--- a/ui/src/app/dashboard/dashboard-layout-frame.html
+++ /dev/null
@@ -1,54 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<div flex class="page-container page-container-padding">
- <div flex="100" layout="row" style="padding:0px;background-color:#f6f6f6;">
- <div flex="none" layout-wrap layout="row" layout-align="start center"
- style="padding-left:10px;font-size:14px;line-height:24px;border-bottom:1px solid #ccc">
- <sp-button sp-button-flat>Manage Layouts</sp-button>
- </div>
- <div layout-fill style="line-height:24px;border-bottom:1px solid #ccc">
- <md-tabs md-dynamic-height md-border-bottom>
- <md-tab label="{{layout.title}}" md-on-select="makeLayoutActive(layout)"
- ng-repeat="layout in layouts"></md-tab>
- </md-tabs>
- </div>
- <div flex="30" layout="row" layout-align="end center"
- style="padding-left:10px;font-size:14px;line-height:24px;border-bottom:1px solid #ccc">
- <sp-button sp-button-flat class="md-icon-button" ng-click="ctrl.startDashboardTour()">
- <i class="material-icons">
- school
- </i>
- <md-tooltip md-direction="top">
- Tutorial
- </md-tooltip>
- </sp-button>
- </div>
-
- </div>
-
- <div class="container-fluid">
- <div>
- <md-content layout-padding>
- <div ng-repeat="layout in layouts | filter:isActive" dashboard="layout.dashboard"
- template-url="dashboard-frame.html"></div>
- </md-content>
- </div>
- </div>
-</div>
-
diff --git a/ui/src/app/dashboard/dashboard.controller.ts b/ui/src/app/dashboard/dashboard.controller.ts
deleted file mode 100644
index 3f4c182..0000000
--- a/ui/src/app/dashboard/dashboard.controller.ts
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import {AddWidgetCtrl} from './add-widget.controller';
-import * as angular from 'angular';
-import * as _ from 'lodash';
-import {NoPipelinePresentDialogController} from "./dialog/no-pipeline-present-dialog.controller";
-
-declare const require: any;
-
-export class DashboardCtrl {
-
- $http: any;
- $mdDialog: any;
- WidgetInstances: any;
- $scope: any;
- layoutOptions: any;
- rerender: any;
- ShepherdService: any;
- maximized: any = false;
- pipelinePresent: any = false;
- $templateCache: any;
-
- constructor($http, $mdDialog, WidgetInstances, $scope, $templateCache, ShepherdService) {
- this.$http = $http;
- this.$mdDialog = $mdDialog;
- this.WidgetInstances = WidgetInstances;
- this.$scope = $scope;
- this.ShepherdService = ShepherdService;
- this.$templateCache = $templateCache;
- }
-
- $onInit() {
- this.$templateCache.put('dashboard-frame.html', require('./dashboard-frame.html'));
- this.$templateCache.put('dashboard-layout-frame.html', require('./dashboard-layout-frame.html'));
-
- // this.visualizablePipelines = [];
- this.layoutOptions = {
- widgetDefinitions: [],
- widgetButtons: false,
- };
-
- this.rerender = true;
- this.isPipelinePresent();
- this.rerenderDashboard(this);
- }
-
- addSpWidget(layout) {
- this.$mdDialog.show({
- controller: AddWidgetCtrl,
- controllerAs: 'ctrl',
- template: require('./add-widget-template.html'),
- parent: angular.element(document.body),
- clickOutsideToClose: false,
- bindToController: true,
- locals: {
- // visualizablePipelines: this.visualizablePipelines,
- rerenderDashboard: this.rerenderDashboard,
- dashboard: this,
- layoutId: layout.id
- }
- });
- };
-
- removeSpWidget(widget) {
- var self = this;
- this.WidgetInstances.get(widget.attrs['widget-id']).then(w => {
- this.WidgetInstances.remove(w).then(res => {
- this.layoutOptions.removeWidget(widget);
- });
- });
- };
-
- maximizeSpWidget(widget) {
- var widthUnits = widget.widthUnits;
- widget.maximized = true;
- widget.setWidth("100", widthUnits);
- }
-
- minimizeSpWidget(widget) {
- var widthUnits = widget.widthUnits;
- widget.maximized = false;
- widget.setWidth("30", widthUnits);
- }
-
-
- // TODO Helper to add new Widgets to the dashboard
- // Find a better solution
- rerenderDashboard(dashboard) {
- dashboard.rerender = false;
- setTimeout(() => {
- dashboard.$scope.$apply(() => {
- dashboard.getOptions().then(options => {
- dashboard.layoutOptions = options;
- dashboard.rerender = true;
- });
- });
- }, 100);
- }
-
- getLayoutWidgets(layoutId, widgets) {
- return _.filter(widgets, w => {
- return w.layoutId == layoutId;
- });
- }
-
- //TODO Add support here to add more Layouts
- getLayouts(widgets) {
- var result = [
- {
- title: 'Layout 1',
- id: 'Layout 1',
- active: true,
- defaultWidgets: this.getLayoutWidgets('Layout 1', widgets)
- },
- // { title: 'Layout 2', id: 'Layout 2', active: false, defaultWidgets: this.getLayoutWidgets('Layout 2', widgets)},
- ];
-
- return result;
-
- }
-
- getOptions() {
- return this.WidgetInstances.getAllWidgetDefinitions().then(widgets => {
-
- this.getLayouts(widgets);
- return {
- widgetDefinitions: widgets,
- widgetButtons: false,
- defaultLayouts: this.getLayouts(widgets)
- }
- });
- }
-
- startDashboardTour() {
- if (this.pipelinePresent) {
- this.ShepherdService.startDashboardTour();
- } else {
- this.$mdDialog.show({
- controller: NoPipelinePresentDialogController,
- controllerAs: 'ctrl',
- template: require('./dialog/no-pipeline-present-dialog.tmpl.html'),
- parent: angular.element(document.body),
- clickOutsideToClose: false,
- bindToController: true
- })
- }
- }
-
- isPipelinePresent() {
- this.$http.get('/visualizablepipeline/_all_docs?include_docs=true')
- .then(msg => {
- var data = msg.data;
- this.pipelinePresent = (data.rows.length > 0);
- });
- }
-
- addWidget(widget) {
- setTimeout(() => {
- this.layoutOptions.widgetDefinitions.push(this.WidgetInstances.getWidgetDashboardDefinition(widget));
- this.layoutOptions.addWidget(this.WidgetInstances.getWidgetDashboardDefinition(widget));
- }, 100);
- }
-}
-
-DashboardCtrl.$inject = ['$http', '$mdDialog', 'WidgetInstances', '$scope', '$templateCache', 'ShepherdService'];
diff --git a/ui/src/app/dashboard/dashboard.html b/ui/src/app/dashboard/dashboard.html
deleted file mode 100644
index bfa49bc..0000000
--- a/ui/src/app/dashboard/dashboard.html
+++ /dev/null
@@ -1,22 +0,0 @@
-
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<div ng-controller="DashboardCtrl as ctrl">
- <div ng-if="ctrl.rerender" dashboard-layouts="ctrl.layoutOptions" template-url="dashboard-layout-frame.html"></div>
-</div>
diff --git a/ui/src/app/dashboard/dashboard.module.ts b/ui/src/app/dashboard/dashboard.module.ts
deleted file mode 100644
index d91f651..0000000
--- a/ui/src/app/dashboard/dashboard.module.ts
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import * as angular from 'angular';
-
-import 'angular-ui-sortable';
-import 'angular-ui-bootstrap';
-
-import 'npm/lodash';
-import 'legacy/stomp';
-import 'npm/angular-sanitize';
-import 'legacy/mlhr-table';
-import 'legacy/malhar-angular-dashboard';
-//import 'npm/epoch-charting';
-import 'npm/ngmap'
-
-import {ConfigItemComponent} from "./components/config-item.component";
-import {DashboardCtrl} from './dashboard.controller';
-import {AddWidgetCtrl} from './add-widget.controller';
-import {WidgetInstances} from './widget-instances.service';
-import {WidgetTemplates} from './templates/widget-templates.service';
-
-import {WidgetDataModel} from "./widget-data-model.service";
-
-import {SocketConnectionDataModel} from './socket-connection-data-model.service';
-
-import soFilter from './templates/so.filter';
-
-import spNumberWidget from './templates/number/number.directive';
-import {spNumberWidgetConfig} from './templates/number/number-config.component';
-import {NumberDataModel} from './templates/number/number-data-model.service';
-
-import spVerticalbarWidget from './templates/verticalbar/verticalbar.directive';
-import {spVerticalbarWidgetConfig} from './templates/verticalbar/verticalbar-config.component';
-import {VerticalbarDataModel} from './templates/verticalbar/verticalbar-data-model.service';
-
-import spTableWidget from './templates/table/table.directive';
-import {spTableWidgetConfig} from './templates/table/table-config.component';
-import {TableDataModel} from './templates/table/table-data-model.service';
-
-import spLineWidget from './templates/line/line.directive';
-import {spLineWidgetConfig} from './templates/line/line-config.component';
-import {LineDataModel} from './templates/line/line-data-model.service';
-
-import spGaugeWidget from './templates/gauge/gauge.directive';
-import {spGaugeWidgetConfig} from './templates/gauge/gauge-config.component';
-import {GaugeDataModel} from './templates/gauge/gauge-data-model.service';
-
-import spTrafficlightWidget from './templates/trafficlight/trafficlight.directive';
-import {spTrafficlightWidgetConfig} from './templates/trafficlight/trafficlight-config.component';
-import {TrafficLightDataModel} from './templates/trafficlight/trafficlight-data-model.service';
-
-import spRawWidget from './templates/raw/raw.directive';
-import {spRawWidgetConfig} from './templates/raw/raw-config.component';
-import {RawDataModel} from './templates/raw/raw-data-model.service';
-//
-import spMapWidget from './templates/map/map.directive';
-import {spMapWidgetConfig} from './templates/map/map-config.component';
-import {MapDataModel} from './templates/map/map-data-model.service';
-
-import spHeatmapWidget from './templates/heatmap/heatmap.directive';
-import {spHeatmapWidgetConfig} from './templates/heatmap/heatmap-config.component';
-import {HeatmapDataModel} from './templates/heatmap/heatmap-data-model.service';
-
-import spImageWidget from './templates/image/image.directive';
-import {spImageWidgetConfig} from './templates/image/image-config.component';
-import {ImageDataModel} from './templates/image/image-data-model.service';
-
-import spHtmlWidget from './templates/html/html.directive';
-import {HtmlDataModel} from './templates/html/html-data-model.service';
-import {spHtmlWidgetConfig} from './templates/html/html-config.component';
-
-export default angular.module('sp.dashboard', ['ui.dashboard', 'datatorrent.mlhrTable', 'ngMap'])
-
- .component('configItem', ConfigItemComponent)
- .controller('DashboardCtrl', DashboardCtrl)
- .controller('AddWidgetCtrl', AddWidgetCtrl)
- .service('WidgetTemplates', WidgetTemplates)
- .service('WidgetDataModel', WidgetDataModel)
- .service('SocketConnectionDataModel', SocketConnectionDataModel)
- .service('WidgetInstances', WidgetInstances)
-
- .filter('soNumber', soFilter.soNumber)
- .filter('soDateTime', soFilter.soDateTime)
- .filter('numberFilter', soFilter.nu)
- .filter('geoLat', soFilter.geoLat)
- .filter('geoLng', soFilter.geoLng)
-
- .directive('spNumberWidget', spNumberWidget)
- .component('spNumberWidgetConfig', spNumberWidgetConfig)
- .service('NumberDataModel', NumberDataModel)
-
- .directive('spVerticalbarWidget', spVerticalbarWidget)
- .component('spVerticalbarWidgetConfig', spVerticalbarWidgetConfig)
- .service('VerticalbarDataModel', VerticalbarDataModel)
-
- .directive('spTableWidget', spTableWidget)
- .component('spTableWidgetConfig', spTableWidgetConfig)
- .service('TableDataModel', TableDataModel)
-
- .directive('spLineWidget', spLineWidget)
- .component('spLineWidgetConfig', spLineWidgetConfig)
- .service('LineDataModel', LineDataModel)
-
- .directive('spGaugeWidget', spGaugeWidget)
- .component('spGaugeWidgetConfig', spGaugeWidgetConfig)
- .service('GaugeDataModel', GaugeDataModel)
-
- .directive('spTrafficlightWidget', spTrafficlightWidget)
- .component('spTrafficlightWidgetConfig', spTrafficlightWidgetConfig)
- .service('TrafficLightDataModel', TrafficLightDataModel)
-
- .directive('spRawWidget', spRawWidget)
- .component('spRawWidgetConfig', spRawWidgetConfig)
- .service('RawDataModel', RawDataModel)
-
- .directive('spMapWidget', spMapWidget)
- .component('spMapWidgetConfig', spMapWidgetConfig)
- .service('MapDataModel', MapDataModel)
-
- .directive('spHeatmapWidget', spHeatmapWidget)
- .component('spHeatmapWidgetConfig', spHeatmapWidgetConfig)
- .service('HeatmapDataModel', HeatmapDataModel)
-
- .directive('spImageWidget', spImageWidget)
- .component('spImageWidgetConfig', spImageWidgetConfig)
- .service('ImageDataModel', ImageDataModel)
-
- .directive('spHtmlWidget', spHtmlWidget)
- .component('spHtmlWidgetConfig', spHtmlWidgetConfig)
- .service('HtmlDataModel', HtmlDataModel)
-
- .name;
diff --git a/ui/src/app/dashboard/dialog/no-pipeline-present-dialog.controller.ts b/ui/src/app/dashboard/dialog/no-pipeline-present-dialog.controller.ts
deleted file mode 100644
index 32b5762..0000000
--- a/ui/src/app/dashboard/dialog/no-pipeline-present-dialog.controller.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-export class NoPipelinePresentDialogController {
-
- $mdDialog: any;
-
- constructor($mdDialog) {
- this.$mdDialog = $mdDialog;
- }
-
- hide() {
- this.$mdDialog.hide();
- };
-
- cancel() {
- this.$mdDialog.cancel();
- };
-}
-
-NoPipelinePresentDialogController.$inject = ['$mdDialog'];
\ No newline at end of file
diff --git a/ui/src/app/dashboard/dialog/no-pipeline-present-dialog.tmpl.html b/ui/src/app/dashboard/dialog/no-pipeline-present-dialog.tmpl.html
deleted file mode 100644
index fe0af6e..0000000
--- a/ui/src/app/dashboard/dialog/no-pipeline-present-dialog.tmpl.html
+++ /dev/null
@@ -1,43 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<md-dialog aria-label="Missing Elements" flex="70" style="height:50%;" class="colored-frame">
- <md-toolbar>
- <div class="md-toolbar-tools">
- <h2>Tutorial requires pipeline elements</h2>
- <span flex></span>
- <md-button class="md-icon-button" ng-click="ctrl.cancel()">
- <md-icon md-svg-icon="navigation:ic_close_24px" aria-label="Close dialog"></md-icon>
- </md-button>
- </div>
- </md-toolbar>
-
- <md-dialog-content flex="100" class="md-dialog-content">
- <div flex="100" layout="column">
- <div flex="100" layout="column">
- <h4>The tutorial requires a running pipeline.</h4>
- <h5>Create a pipeline using the pipeline editor and start the tutorial again.</h5>
- </div>
- </div>
- </md-dialog-content>
- <md-dialog-actions layout="row">
- <sp-button sp-button-gray ng-click="ctrl.hide()">
- Close
- </sp-button>
- </md-dialog-actions>
-</md-dialog>
\ No newline at end of file
diff --git a/ui/src/app/dashboard/socket-connection-data-model.service.ts b/ui/src/app/dashboard/socket-connection-data-model.service.ts
deleted file mode 100644
index 6ebf2e3..0000000
--- a/ui/src/app/dashboard/socket-connection-data-model.service.ts
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import {WidgetDataModel} from "./widget-data-model.service";
-import * as _ from 'lodash';
-
-declare const Stomp: any;
-
-export class SocketConnectionDataModel extends WidgetDataModel {
-
- $http: any;
- visualisationId: any;
- client: any;
- WidgetDataModel: any;
-
- constructor($http, visualisationId) {
- super();
- this.$http = $http;
- this.visualisationId = visualisationId;
- this.client = {};
- }
-
- init() {
-
- //TODO find better solution
- var login = 'admin';
- var passcode = 'admin';
- var self = this;
-
- this.$http.get('/dashboard/_all_docs?include_docs=true')
- .then(msg => {
- let data = msg.data;
- var element = _.find(data.rows, elem => {
- return elem.doc.visualisation._id == self.visualisationId;
- });
-
- var websocketScheme;
- if(location.protocol === 'https:') {
- websocketScheme = "wss:";
- } else {
- websocketScheme = "ws:";
- }
- var inputTopic = '/topic/' + element.doc.visualisation['topic'];
- var brokerUrl = websocketScheme + "//" + location.host + "/streampipes/ws";
-
- self.client = Stomp.client(brokerUrl + inputTopic);
-
- // Uncomment these lines to get all the wesocket messages to the console
- // client.debug = function (str) {
- // console.log(str);
- // };
-
- // the client is notified when it is connected to the server.
- var onConnect = function (frame) {
-
- self.client.subscribe(inputTopic, function (message) {
- self.newData(JSON.parse(message.body));
- }, {'Sec-WebSocket-Protocol': 'v10.stomp, v11.stomp'});
- };
-
- self.client.connect(login, passcode, onConnect);
- });
- };
-
- destroy() {
- if (this.WidgetDataModel) {
- this.WidgetDataModel.prototype.destroy.call(this);
- }
-
- this.client.disconnect(() => {
- console.log("Disconnected websocket connection");
- });
- };
-
-
- updateScope(data) {
- this.widgetScope.widgetData = data;
- this.widgetScope.$apply(() => {
- });
- }
-
- newData(message) {
- // to be overridden by subclasses
- }
-};
-
-SocketConnectionDataModel.$inject = ['$http'];
diff --git a/ui/src/app/dashboard/templates/gauge/gauge-config.component.ts b/ui/src/app/dashboard/templates/gauge/gauge-config.component.ts
deleted file mode 100644
index b94fd27..0000000
--- a/ui/src/app/dashboard/templates/gauge/gauge-config.component.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-declare const require: any;
-
-export let spGaugeWidgetConfig = {
- template: require('./gaugeConfig.html'),
- bindings: {
- wid: '='
- },
- controller: class GaugeConfigCtrl {
- constructor() {}
- },
- controllerAs: 'ctrl'
-};
diff --git a/ui/src/app/dashboard/templates/gauge/gauge-data-model.service.ts b/ui/src/app/dashboard/templates/gauge/gauge-data-model.service.ts
deleted file mode 100644
index dee5b91..0000000
--- a/ui/src/app/dashboard/templates/gauge/gauge-data-model.service.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import {SocketConnectionDataModel} from '../../socket-connection-data-model.service.js'
-
-export class GaugeDataModel extends SocketConnectionDataModel {
-
- constructor($http, id) {
- super($http, id);
- }
-
- newData(message) {
- this.updateScope(message);
- }
-
-};
-
-GaugeDataModel.$inject = ['$http'];
diff --git a/ui/src/app/dashboard/templates/gauge/gauge.directive.ts b/ui/src/app/dashboard/templates/gauge/gauge.directive.ts
deleted file mode 100644
index 2c3a494..0000000
--- a/ui/src/app/dashboard/templates/gauge/gauge.directive.ts
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import {WidgetInstances} from '../../widget-instances.service'
-
-'use strict';
-
-declare const require: any;
-
-gaugeWidget.$inject = ['WidgetInstances'];
-
-export default function gaugeWidget(WidgetInstances) {
- return {
- restrict: 'A',
- replace: true,
- template: require('./gauge.html'),
- scope: {
- data: '=',
- widgetId: '@'
- },
- controller: function ($scope) {
- WidgetInstances.get($scope.widgetId).then(function(data) {
- $scope.widgetConfig = data.visualisation.schema.config;
- $scope.min = data.visualisation.config.min;
- $scope.max = data.visualisation.config.max;
- })
- $scope.lineData = [];
- $scope.myChart = null;
-
- },
- link: function postLink(scope, element) {
-
- scope.$watch('data', function (data) {
- if (data) {
- if (scope.myChart == null) {
- scope.myChart = element.epoch({
- type: 'time.gauge',
- value: 0.0,
- fps: 10,
- format: function (v) {
- return v.toFixed(2);
- },
- domain: [scope.min, scope.max]
- });
- } else {
- scope.myChart.update(data[scope.widgetConfig.selectedNumberMapping.properties.runtimeName]);
- }
- }
- });
- }
- };
-};
diff --git a/ui/src/app/dashboard/templates/gauge/gauge.html b/ui/src/app/dashboard/templates/gauge/gauge.html
deleted file mode 100644
index 9e87358..0000000
--- a/ui/src/app/dashboard/templates/gauge/gauge.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<div id="gaugeChart"class="epoch gauge-medium" style="width: 400px; height: 250px"></div>
diff --git a/ui/src/app/dashboard/templates/gauge/gaugeConfig.html b/ui/src/app/dashboard/templates/gauge/gaugeConfig.html
deleted file mode 100644
index 0b107f0..0000000
--- a/ui/src/app/dashboard/templates/gauge/gaugeConfig.html
+++ /dev/null
@@ -1,52 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<div flex="100">
- <config-item flex="100" layout="row" element-title="Select number field">
- <div flex="100" layout="column">
- <md-input-container class="md-block" flex-gt-sm>
- <md-select ng-model="ctrl.wid.schema.config.selectedNumberMapping">
- <md-option ng-value="lineValue" ng-selected="index == 1"
- ng-repeat="(index, lineValue) in ctrl.wid.schema.eventProperties | numberFilter">{{
- lineValue.properties.runtimeName }}
- </md-option>
- </md-select>
- </md-input-container>
- </div>
- </config-item>
- <config-item flex="100" layout="row" element-title="Gauge Settings">
- <div flex="100" layout="column">
- <div layout="row" flex="100" layout-align="center center">
- <div flex="100">
- <md-input-container>
- <label>Minimum</label>
- <input required ng-model="ctrl.wid.config.min" style="color:black;">
- </md-input-container>
- </div>
- </div>
- <div layout="row" flex="100" layout-align="center center">
- <div flex="100">
- <md-input-container>
- <label>Maximum</label>
- <input required ng-model="ctrl.wid.config.max" style="color:black;">
- </md-input-container>
- </div>
- </div>
- </div>
- </config-item>
-</div>
\ No newline at end of file
diff --git a/ui/src/app/dashboard/templates/heatmap/heatmap-config.component.ts b/ui/src/app/dashboard/templates/heatmap/heatmap-config.component.ts
deleted file mode 100644
index d5d2dec..0000000
--- a/ui/src/app/dashboard/templates/heatmap/heatmap-config.component.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-declare const require: any;
-
-export let spHeatmapWidgetConfig = {
- template: require('./heatmapConfig.html'),
- bindings: {
- wid: '='
- },
- controller: class HeatmapConfigCtrl {
- constructor() {}
- },
- controllerAs: 'ctrl'
-};
\ No newline at end of file
diff --git a/ui/src/app/dashboard/templates/heatmap/heatmap-data-model.service.ts b/ui/src/app/dashboard/templates/heatmap/heatmap-data-model.service.ts
deleted file mode 100644
index b0c8271..0000000
--- a/ui/src/app/dashboard/templates/heatmap/heatmap-data-model.service.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import {SocketConnectionDataModel} from '../../socket-connection-data-model.service'
-
-
-export class HeatmapDataModel extends SocketConnectionDataModel {
-
- constructor($http, id) {
- super($http, id);
- }
-
- newData(message) {
- this.updateScope(message);
- }
-
-};
-
-HeatmapDataModel.$inject = ['$http'];
diff --git a/ui/src/app/dashboard/templates/heatmap/heatmap.directive.ts b/ui/src/app/dashboard/templates/heatmap/heatmap.directive.ts
deleted file mode 100644
index 87077ac..0000000
--- a/ui/src/app/dashboard/templates/heatmap/heatmap.directive.ts
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-declare const google: any;
-
-import {WidgetInstances} from '../../widget-instances.service'
-
-'use strict';
-
-declare const require: any;
-heatmapWidget.$inject = ['WidgetInstances', '$http', 'NgMap'];
-
-export default function heatmapWidget(WidgetInstances) {
- return {
- restrict: 'A',
- replace: true,
- template: require('./heatmap.html'),
- scope: {
- data: '=',
- widgetId: '@'
- },
- controller: function ($scope, NgMap) {
- WidgetInstances.get($scope.widgetId).then(function (data) {
- $scope.widgetConfig = data.visualisation.schema.config;
-
- $scope.pointArray = new google.maps.MVCArray();
-
- NgMap.getMap().then(function (map) {
- $scope.map = map;
-
- $scope.heatmap = new google.maps.visualization.HeatmapLayer({
- data: $scope.pointArray,
- map: map,
- radius: 20,
- maxIntensity : 20
-
- });
- });
- });
- },
- link: function postLink(scope) {
- scope.$watch('data', function (data) {
- if (data) {
-
- if (scope.pointArray.getLength() % 1000 == 0) {
- if (scope.pointArray.getLength() > 0) scope.pointArray.removeAt(0);
- else {
- scope.currentLocation = [data[scope.widgetConfig.selectedLongitudeMapping.properties.runtimeName],
- data[scope.widgetConfig.selectedLatitudeMapping.properties.runtimeName]];
- }
- }
-
- scope.pointArray.push(new google.maps.LatLng(data[scope.widgetConfig.selectedLatitudeMapping.properties.runtimeName],
- data[scope.widgetConfig.selectedLongitudeMapping.properties.runtimeName]));
- }
- });
- }
- };
-};
\ No newline at end of file
diff --git a/ui/src/app/dashboard/templates/heatmap/heatmap.html b/ui/src/app/dashboard/templates/heatmap/heatmap.html
deleted file mode 100644
index bf962f0..0000000
--- a/ui/src/app/dashboard/templates/heatmap/heatmap.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<div style="width:400px;height:600px;">
- <div>
- <ng-map center="[{{currentLocation[1]}},{{currentLocation[0]}}]" zoom="14" map-type-id="SATELLITE" style="width:400px;height:600px;">
-
- </ng-map>
- </div>
-</div>
\ No newline at end of file
diff --git a/ui/src/app/dashboard/templates/heatmap/heatmapConfig.html b/ui/src/app/dashboard/templates/heatmap/heatmapConfig.html
deleted file mode 100644
index a112860..0000000
--- a/ui/src/app/dashboard/templates/heatmap/heatmapConfig.html
+++ /dev/null
@@ -1,38 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<div layout="column" flex="100">
- <h4>Select Latitude</h4>
- <md-input-container class="md-block" flex-gt-sm>
- <md-select ng-model="ctrl.wid.schema.config.selectedLatitudeMapping">
- <md-option ng-value="lat" ng-selected="index == 1"
- ng-repeat="(index, lat) in ctrl.wid.schema.eventProperties | geoLat">{{
- lat.properties.runtimeName }}
- </md-option>
- </md-select>
- </md-input-container>
-
- <h4>Select Longitude</h4>
- <md-input-container class="md-block" flex-gt-sm>
- <md-select ng-model="ctrl.wid.schema.config.selectedLongitudeMapping">
- <md-option ng-value="lng" ng-repeat="lng in ctrl.wid.schema.eventProperties | geoLng">{{
- lng.properties.runtimeName }}
- </md-option>
- </md-select>
- </md-input-container>
-</div>
\ No newline at end of file
diff --git a/ui/src/app/dashboard/templates/html/html-config.component.ts b/ui/src/app/dashboard/templates/html/html-config.component.ts
deleted file mode 100644
index 0d91214..0000000
--- a/ui/src/app/dashboard/templates/html/html-config.component.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-declare const require: any;
-
-export let spHtmlWidgetConfig = {
- template: require('./htmlConfig.html'),
- bindings: {
- wid: '='
- },
- controller: class HtmlConfigCtrl {
- constructor() {}
- },
- controllerAs: 'ctrl'
-};
diff --git a/ui/src/app/dashboard/templates/html/html-data-model.service.ts b/ui/src/app/dashboard/templates/html/html-data-model.service.ts
deleted file mode 100644
index c118aaf..0000000
--- a/ui/src/app/dashboard/templates/html/html-data-model.service.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import {SocketConnectionDataModel} from '../../socket-connection-data-model.service.js'
-
-export class HtmlDataModel extends SocketConnectionDataModel {
-
- constructor($http, id) {
- super($http, id);
- }
-
- newData(message) {
- this.updateScope(message);
- }
-
-};
-
-HtmlDataModel.$inject = ['$http'];
diff --git a/ui/src/app/dashboard/templates/html/html.directive.ts b/ui/src/app/dashboard/templates/html/html.directive.ts
deleted file mode 100644
index 5764529..0000000
--- a/ui/src/app/dashboard/templates/html/html.directive.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import {WidgetInstances} from '../../widget-instances.service'
-
-'use strict';
-htmlWidget.$inject = ['WidgetInstances'];
-declare const require: any;
-
-export default function htmlWidget(WidgetInstances) {
- return {
- restrict: 'A',
- replace: true,
- template: require('./htmltemplate.html'),
- scope: {
- data: '=',
- widgetId: '@'
- },
- controller: function ($scope) {
- WidgetInstances.get($scope.widgetId).then(function(data) {
- $scope.widgetConfig = data.visualisation.schema.config;
- $scope.selectedUrlMapping = data.visualisation.schema.selectedNumberProperty.properties.runtimeName;
-
- })
-
- },
- link: function postLink(scope, element) {
-
- scope.$watch('data', function (data) {
- if (data) {
- scope.item = data[scope.selectedUrlMapping];
- }
- });
- }
- };
-};
diff --git a/ui/src/app/dashboard/templates/html/htmlConfig.html b/ui/src/app/dashboard/templates/html/htmlConfig.html
deleted file mode 100644
index f394398..0000000
--- a/ui/src/app/dashboard/templates/html/htmlConfig.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<config-item flex="100" layout="row" element-title="Select html field">
- <div flex="100" layout="column">
- <md-input-container class="md-block" flex-gt-sm>
- <md-select ng-model="ctrl.wid.schema.selectedNumberProperty">
- <md-option ng-value="lineValue" ng-selected="index == 1"
- ng-repeat="(index, lineValue) in ctrl.wid.schema.eventProperties">{{
- lineValue.properties.runtimeName }}
- </md-option>
- </md-select>
- </md-input-container>
- </div>
-</config-item>
diff --git a/ui/src/app/dashboard/templates/html/htmltemplate.html b/ui/src/app/dashboard/templates/html/htmltemplate.html
deleted file mode 100644
index 96daa48..0000000
--- a/ui/src/app/dashboard/templates/html/htmltemplate.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<div style="width:100%" ng-bind-html="item">
-</div>
\ No newline at end of file
diff --git a/ui/src/app/dashboard/templates/image/image-config.component.ts b/ui/src/app/dashboard/templates/image/image-config.component.ts
deleted file mode 100644
index a3646a4..0000000
--- a/ui/src/app/dashboard/templates/image/image-config.component.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-declare const require: any;
-
-export let spImageWidgetConfig = {
- template: require('./imageConfig.html'),
- bindings: {
- wid: '='
- },
- controller: class ImageConfigCtrl {
- constructor() {}
- },
- controllerAs: 'ctrl'
-};
diff --git a/ui/src/app/dashboard/templates/image/image-data-model.service.ts b/ui/src/app/dashboard/templates/image/image-data-model.service.ts
deleted file mode 100644
index a0cd955..0000000
--- a/ui/src/app/dashboard/templates/image/image-data-model.service.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import {SocketConnectionDataModel} from '../../socket-connection-data-model.service.js'
-
-export class ImageDataModel extends SocketConnectionDataModel {
-
- constructor($http, id) {
- super($http, id);
- }
-
- newData(message) {
- this.updateScope(message);
- }
-
-};
-
-ImageDataModel.$inject = ['$http'];
diff --git a/ui/src/app/dashboard/templates/image/image.directive.ts b/ui/src/app/dashboard/templates/image/image.directive.ts
deleted file mode 100644
index 6561a85..0000000
--- a/ui/src/app/dashboard/templates/image/image.directive.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import {WidgetInstances} from '../../widget-instances.service'
-
-'use strict';
-imageWidget.$inject = ['WidgetInstances'];
-declare const require: any;
-
-export default function imageWidget(WidgetInstances) {
- return {
- restrict: 'A',
- replace: true,
- template: require('./image.html'),
- scope: {
- data: '=',
- widgetId: '@'
- },
- controller: function ($scope) {
- WidgetInstances.get($scope.widgetId).then(function(data) {
- $scope.widgetConfig = data.visualisation.schema.config;
- $scope.selectedImageMapping = data.visualisation.schema.selectedNumberProperty.properties.runtimeName;
-
- })
-
- },
- link: function postLink(scope, element) {
-
- scope.$watch('data', function (data) {
- if (data) {
- scope.item = data[scope.selectedImageMapping];
- }
- });
- }
- };
-};
diff --git a/ui/src/app/dashboard/templates/image/image.html b/ui/src/app/dashboard/templates/image/image.html
deleted file mode 100644
index a953815..0000000
--- a/ui/src/app/dashboard/templates/image/image.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<img style="width: 50%;" data-ng-src="data:image/jpg;base64,{{item}}" />
\ No newline at end of file
diff --git a/ui/src/app/dashboard/templates/image/imageConfig.html b/ui/src/app/dashboard/templates/image/imageConfig.html
deleted file mode 100644
index 3573c3a..0000000
--- a/ui/src/app/dashboard/templates/image/imageConfig.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<config-item flex="100" layout="row" element-title="Select image field">
- <div flex="100" layout="column">
- <md-input-container class="md-block" flex-gt-sm>
- <md-select ng-model="ctrl.wid.schema.selectedNumberProperty">
- <md-option ng-value="lineValue" ng-selected="index == 1"
- ng-repeat="(index, lineValue) in ctrl.wid.schema.eventProperties">{{
- lineValue.properties.runtimeName }}
- </md-option>
- </md-select>
- </md-input-container>
- </div>
-</config-item>
diff --git a/ui/src/app/dashboard/templates/line/line-config.component.ts b/ui/src/app/dashboard/templates/line/line-config.component.ts
deleted file mode 100644
index efd3372..0000000
--- a/ui/src/app/dashboard/templates/line/line-config.component.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-declare const require: any;
-
-export let spLineWidgetConfig = {
- template: require('./lineConfig.html'),
- bindings: {
- wid: '=',
- configForm: "="
- },
- controller: class LineConfigCtrl {
- constructor() {}
- },
- controllerAs: 'ctrl'
-};
diff --git a/ui/src/app/dashboard/templates/line/line-data-model.service.ts b/ui/src/app/dashboard/templates/line/line-data-model.service.ts
deleted file mode 100644
index 9cd24a7..0000000
--- a/ui/src/app/dashboard/templates/line/line-data-model.service.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import {SocketConnectionDataModel} from '../../socket-connection-data-model.service'
-
-export class LineDataModel extends SocketConnectionDataModel {
-
- constructor($http, id) {
- super($http, id);
- }
-
- newData(message) {
- this.updateScope(message);
- }
-
-};
-
-LineDataModel.$inject = ['$http'];
diff --git a/ui/src/app/dashboard/templates/line/line.directive.ts b/ui/src/app/dashboard/templates/line/line.directive.ts
deleted file mode 100644
index c98a8ab..0000000
--- a/ui/src/app/dashboard/templates/line/line.directive.ts
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import {WidgetInstances} from '../../widget-instances.service'
-
-'use strict';
-lineWidget.$inject = ['WidgetInstances'];
-declare const require: any;
-
-export default function lineWidget(WidgetInstances) {
- return {
- restrict: 'A',
- replace: true,
- template: require('./line.html'),
- scope: {
- data: '=',
- widgetId: '@'
- },
- controller: function ($scope) {
- WidgetInstances.get($scope.widgetId).then(function(data) {
- $scope.widgetConfig = data.visualisation.schema.config;
- });
- $scope.myChart = null;
- },
- link: function postLink(scope, element) {
- scope.$watch('data', function (data) {
- if (data) {
- if (!scope.myChart) {
- scope.myChart = element.epoch({
- type: 'time.line',
- data: [{ label: "Series 1", values: []}],
- axes: ['bottom', 'left'],
- range: [scope.widgetConfig.range.min, scope.widgetConfig.range.max]
- });
- } else {
- var time_value = data[scope.widgetConfig.selectedTimestampMapping.properties.runtimeName];
- // TODO find a better solution to format the long date for the epoch library
- time_value = parseInt(time_value.toString().slice(0, -3));
- var y_value = data[scope.widgetConfig.selectedNumberMapping.properties.runtimeName];
-
- scope.myChart.push([{time: time_value, y: y_value}]);
- }
-
- }
- });
- }
- };
-};
diff --git a/ui/src/app/dashboard/templates/line/line.html b/ui/src/app/dashboard/templates/line/line.html
deleted file mode 100644
index e3c8e50..0000000
--- a/ui/src/app/dashboard/templates/line/line.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<div id="lineChart" class="epoch category10" style="width: 400px; height: 250px; z-index:0"></div>
diff --git a/ui/src/app/dashboard/templates/line/lineConfig.html b/ui/src/app/dashboard/templates/line/lineConfig.html
deleted file mode 100644
index 2fb722c..0000000
--- a/ui/src/app/dashboard/templates/line/lineConfig.html
+++ /dev/null
@@ -1,60 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<div flex="100">
- <config-item flex="100" layout="row" element-title="Select time field">
- <div flex="100" layout="column">
- <md-input-container class="md-block" flex-gt-sm>
- <md-select ng-model="ctrl.wid.schema.config.selectedTimestampMapping">
- <md-option ng-value="time" ng-selected="index == 0"
- ng-repeat="(index, time) in ctrl.wid.schema.eventProperties | soDateTime">{{
- time.properties.runtimeName }}
- </md-option>
- </md-select>
- </md-input-container>
- </div>
- </config-item>
- <config-item flex="100" layout="row" element-title="Select number field">
- <div flex="100" layout="column">
- <md-input-container class="md-block" flex-gt-sm>
- <md-select ng-model="ctrl.wid.schema.config.selectedNumberMapping">
- <md-option ng-value="lineValue" ng-selected="index == 0"
- ng-repeat="(index, lineValue) in ctrl.wid.schema.eventProperties | numberFilter">{{
- lineValue.properties.runtimeName }}
- </md-option>
- </md-select>
- </md-input-container>
- </div>
- </config-item>
- <config-item flex="100" layout="row" element-title="Range">
- <div flex="100" layout="row">
- <div flex="50">
- <md-input-container>
- <label>Minimum</label>
- <input required ng-model="ctrl.wid.schema.config.range.min" style="color:black;">
- </md-input-container>
- </div>
- <div flex="50">
- <md-input-container>
- <label>Maximum</label>
- <input required ng-model="ctrl.wid.schema.config.range.max" style="color:black;">
- </md-input-container>
- </div>
- </div>
- </config-item>
-</div>
\ No newline at end of file
diff --git a/ui/src/app/dashboard/templates/map.deprecated/map-config.component.ts b/ui/src/app/dashboard/templates/map.deprecated/map-config.component.ts
deleted file mode 100644
index 41f9ef4..0000000
--- a/ui/src/app/dashboard/templates/map.deprecated/map-config.component.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-declare const require: any;
-
-export let spMapWidgetConfig = {
- template: require('./mapConfig.html'),
- bindings: {
- wid: '='
- },
- controller: class MapConfigCtrl {
- constructor() {}
- },
- controllerAs: 'ctrl'
-};
\ No newline at end of file
diff --git a/ui/src/app/dashboard/templates/map.deprecated/map-data-model.service.ts b/ui/src/app/dashboard/templates/map.deprecated/map-data-model.service.ts
deleted file mode 100644
index 8cae441..0000000
--- a/ui/src/app/dashboard/templates/map.deprecated/map-data-model.service.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import {SocketConnectionDataModel} from '../../socket-connection-data-model.service'
-
-
-export class MapDataModel extends SocketConnectionDataModel {
-
- constructor($http, id) {
- super($http, id);
- }
-
- newData(message) {
- this.updateScope(message);
- }
-
-};
-
-MapDataModel.$inject = ['$http'];
diff --git a/ui/src/app/dashboard/templates/map.deprecated/map.directive.ts b/ui/src/app/dashboard/templates/map.deprecated/map.directive.ts
deleted file mode 100644
index a8d92be..0000000
--- a/ui/src/app/dashboard/templates/map.deprecated/map.directive.ts
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import {WidgetInstances} from '../../widget-instances.service'
-
-'use strict';
-declare const require: any;
-mapWidget.$inject = ['WidgetInstances', 'NgMap'];
-
-export default function mapWidget(WidgetInstances, NgMap) {
- return {
- restrict: 'A',
- replace: true,
- template: require('./map.html'),
- scope: {
- data: '=',
- widgetId: '@'
- },
- controller: function ($scope) {
- WidgetInstances.get($scope.widgetId).then(function (data) {
- $scope.widgetConfig = data.visualisation.schema.config;
- });
- },
- link: function postLink(scope) {
- scope.$watch('data', function (data) {
- if (data) {
- scope.currentLocation = [data[scope.widgetConfig.selectedLongitudeMapping.properties.runtimeName],
- data[scope.widgetConfig.selectedLatitudeMapping.properties.runtimeName]];
- }
- });
- }
- };
-};
\ No newline at end of file
diff --git a/ui/src/app/dashboard/templates/map.deprecated/map.html b/ui/src/app/dashboard/templates/map.deprecated/map.html
deleted file mode 100644
index 550477c..0000000
--- a/ui/src/app/dashboard/templates/map.deprecated/map.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<div style="width:400px;height:600px;">
- <div map-lazy-load="https://maps.google.com/maps/api/js" >
- <ng-map center="[{{currentLocation[1]}},{{currentLocation[0]}}]" zoom="14" style="width:400px;height:600px;">
- <marker position="{{currentLocation[1]}},{{currentLocation[0]}}"></marker>
- </ng-map>
- </div>
-</div>
\ No newline at end of file
diff --git a/ui/src/app/dashboard/templates/map.deprecated/mapConfig.html b/ui/src/app/dashboard/templates/map.deprecated/mapConfig.html
deleted file mode 100644
index 1609d6c..0000000
--- a/ui/src/app/dashboard/templates/map.deprecated/mapConfig.html
+++ /dev/null
@@ -1,49 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<div layout="column" flex="100">
- <h4>Select Latitude</h4>
- <md-input-container class="md-block" flex-gt-sm>
- <md-select ng-model="ctrl.wid.schema.config.selectedLatitudeMapping">
- <md-option ng-value="lat" ng-selected="index == 1"
- ng-repeat="(index, lat) in ctrl.wid.schema.eventProperties | geoLat">{{
- lat.properties.runtimeName }}
- </md-option>
- </md-select>
- </md-input-container>
-
- <h4>Select Longitude</h4>
- <md-input-container class="md-block" flex-gt-sm>
- <md-select ng-model="ctrl.wid.schema.config.selectedLongitudeMapping">
- <md-option ng-value="lng" ng-selected="index == 1"
- ng-repeat="(index, lng) in ctrl.wid.schema.eventProperties | geoLng">{{
- lng.properties.runtimeName }}
- </md-option>
- </md-select>
- </md-input-container>
-
- <h4>Select Label</h4>
- <md-input-container class="md-block" flex-gt-sm>
- <md-select ng-model="ctrl.wid.schema.config.selectedLabelMapping">
- <md-option ng-value="labelVal" ng-selected="index == 1"
- ng-repeat="(index, labelVal) in ctrl.wid.schema.eventProperties">{{
- labelVal.properties.runtimeName }}
- </md-option>
- </md-select>
- </md-input-container>
-</div>
\ No newline at end of file
diff --git a/ui/src/app/dashboard/templates/map/map-config.component.ts b/ui/src/app/dashboard/templates/map/map-config.component.ts
deleted file mode 100644
index 0f5ece8..0000000
--- a/ui/src/app/dashboard/templates/map/map-config.component.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-declare const require: any;
-
-export let spMapWidgetConfig = {
- template: require('./mapConfig.html'),
- bindings: {
- wid: '='
- },
- controller: class MapConfigCtrl {
- markerTypes: string[];
-
- constructor() {
- this.markerTypes = ['Default', 'Car'];
- }
-
-
- },
- controllerAs: 'ctrl'
-};
\ No newline at end of file
diff --git a/ui/src/app/dashboard/templates/map/map-data-model.service.ts b/ui/src/app/dashboard/templates/map/map-data-model.service.ts
deleted file mode 100644
index 8cae441..0000000
--- a/ui/src/app/dashboard/templates/map/map-data-model.service.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import {SocketConnectionDataModel} from '../../socket-connection-data-model.service'
-
-
-export class MapDataModel extends SocketConnectionDataModel {
-
- constructor($http, id) {
- super($http, id);
- }
-
- newData(message) {
- this.updateScope(message);
- }
-
-};
-
-MapDataModel.$inject = ['$http'];
diff --git a/ui/src/app/dashboard/templates/map/map.directive.ts b/ui/src/app/dashboard/templates/map/map.directive.ts
deleted file mode 100644
index 19c4684..0000000
--- a/ui/src/app/dashboard/templates/map/map.directive.ts
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import {WidgetInstances} from '../../widget-instances.service'
-
-'use strict';
-mapWidget.$inject = ['WidgetInstances', 'NgMap'];
-declare let L;
-declare const require: any;
-
-export default function mapWidget(WidgetInstances, NgMap) {
- return {
- restrict: 'A',
- replace: true,
- template: require('./map.html'),
- scope: {
- data: '=',
- widgetId: '@'
- },
- controller: function ($scope) {
- $scope.refocus = true;
- $scope.markers = {};
- $scope.markersTimeout = {};
-
- WidgetInstances.get($scope.widgetId).then(function (data) {
- $scope.widgetConfig = data.visualisation.schema.config;
- });
-
- $scope.map = L.map("map");
-
- L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
- attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
- }).addTo($scope.map);
-
- this.toggleRefocus = function () {
- $scope.refocus = !$scope.refocus;
- }
- },
- link: function postLink(scope) {
- var carIcon = L.icon({
- iconUrl: 'assets/img/pe_icons/car.png',
-
- iconSize: [15, 15], // size of the icon
- shadowSize: [0, 0], // size of the shadow
- iconAnchor: [0, 0], // point of the icon which will correspond to marker's location
- shadowAnchor: [0, 0], // the same for the shadow
- popupAnchor: [0, 0] // point from which the popup should open relative to the iconAnchor
- });
-
- var getId = function (data) {
- return data[scope.widgetConfig.selectedLabelMapping.properties.runtimeName];
- };
-
- var getMarker = function(data) {
-
-
- var lat = data[scope.widgetConfig.selectedLatitudeMapping.properties.runtimeName];
- var long = data[scope.widgetConfig.selectedLongitudeMapping.properties.runtimeName];
- var text = "<h4>Id: " + getId(data) + "</h4></br>";
- for (var key in data) {;
- text = text.concat("<b>" +key +"</b>" + ": " + data[key] + "<br>");
- }
-
- var marker;
- if (scope.widgetConfig.selectedMarkerType == "Default") {
- marker = L.marker([lat, long])
- .addTo(scope.map)
- .bindPopup(text);
- } else {
- marker = L.marker([lat, long], {icon: carIcon})
- .addTo(scope.map)
- .bindPopup(text);
- }
-
- return marker;
-
- };
-
- scope.$watch('data', function (data) {
- if (data) {
-
- var marker = getMarker(data);
- var id = getId(data);
-
- if (id in scope.markers) {
- scope.map.removeLayer(scope.markers[id]);
- }
-
- var currentDate = new Date().getTime();
- scope.markers[id] = marker;
- scope.markersTimeout[id] = currentDate;
-
- if (scope.refocus) {
- var group = new L.featureGroup(Object.values(scope.markers));
- scope.map.fitBounds(group.getBounds());
- }
-
-
- for (var key in scope.markersTimeout) {
-
- if (scope.markersTimeout[key] + 5000 < currentDate) {
- scope.map.removeLayer(scope.markers[key]);
- }
- }
-
-
- // scope.map.panTo(new L.LatLng(lat, long));
-
- }
- });
- },
- controllerAs: 'ctrl'
- };
-};
\ No newline at end of file
diff --git a/ui/src/app/dashboard/templates/map/map.html b/ui/src/app/dashboard/templates/map/map.html
deleted file mode 100644
index a88e187..0000000
--- a/ui/src/app/dashboard/templates/map/map.html
+++ /dev/null
@@ -1,37 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<div style="height:100%; min-height: 60vh; width: 100%;">
- <div id="map" style="height:100%; min-height: 60vh; width: 100%; z-index: 0;">
- </div>
-
- <sp-button sp-button-flat class="md-icon-button" ng-click="ctrl.toggleRefocus()">
- <i ng-if="refocus" class="material-icons">
- center_focus_strong
- </i>
- <md-tooltip ng-if="refocus" md-direction="top">
- Deactivate focus on Markers
- </md-tooltip>
- <i ng-if="!refocus" class="material-icons">
- center_focus_weak
- </i>
- <md-tooltip ng-if="!refocus" md-direction="top">
- Activate focus on Markers
- </md-tooltip>
- </sp-button>
-</div>
diff --git a/ui/src/app/dashboard/templates/map/mapConfig.html b/ui/src/app/dashboard/templates/map/mapConfig.html
deleted file mode 100644
index e306243..0000000
--- a/ui/src/app/dashboard/templates/map/mapConfig.html
+++ /dev/null
@@ -1,61 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<div layout="column" flex="100">
-
- <h4>Select Label</h4>
- <md-input-container class="md-block" flex-gt-sm>
- <md-select ng-model="ctrl.wid.schema.config.selectedLabelMapping">
- <md-option ng-value="labelVal" ng-selected="index == 0"
- ng-repeat="(index, labelVal) in ctrl.wid.schema.eventProperties">{{
- labelVal.properties.runtimeName }}
- </md-option>
- </md-select>
- </md-input-container>
-
- <h4>Select Latitude</h4>
- <md-input-container class="md-block" flex-gt-sm>
- <md-select ng-model="ctrl.wid.schema.config.selectedLatitudeMapping">
- <md-option ng-value="lat" ng-selected="index == 0"
- ng-repeat="(index, lat) in ctrl.wid.schema.eventProperties | geoLat">{{
- lat.properties.runtimeName }}
- </md-option>
- </md-select>
- </md-input-container>
-
- <h4>Select Longitude</h4>
- <md-input-container class="md-block" flex-gt-sm>
- <md-select ng-model="ctrl.wid.schema.config.selectedLongitudeMapping">
- <md-option ng-value="lng" ng-selected="index == 0"
- ng-repeat="(index, lng) in ctrl.wid.schema.eventProperties | geoLng">{{
- lng.properties.runtimeName }}
- </md-option>
- </md-select>
- </md-input-container>
-
- <h4>Select Marker Type</h4>
- <md-input-container class="md-block" flex-gt-sm>
- <md-select ng-model="ctrl.wid.schema.config.selectedMarkerType">
- <md-option ng-value="markerType" ng-selected="index == 0"
- ng-repeat="(index, markerType) in ctrl.markerTypes ">{{
- markerType }}
- </md-option>
- </md-select>
- </md-input-container>
-
-</div>
\ No newline at end of file
diff --git a/ui/src/app/dashboard/templates/number/number-config.component.ts b/ui/src/app/dashboard/templates/number/number-config.component.ts
deleted file mode 100644
index 223c9c3..0000000
--- a/ui/src/app/dashboard/templates/number/number-config.component.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-declare const require: any;
-
-export let spNumberWidgetConfig = {
- template: require('./numberConfig.html'),
- bindings: {
- wid: '='
- },
- controller: class NumberConfigCtrl {
- constructor() {}
- },
- controllerAs: 'ctrl'
-};
diff --git a/ui/src/app/dashboard/templates/number/number-data-model.service.ts b/ui/src/app/dashboard/templates/number/number-data-model.service.ts
deleted file mode 100644
index 009e7a3..0000000
--- a/ui/src/app/dashboard/templates/number/number-data-model.service.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import {SocketConnectionDataModel} from '../../socket-connection-data-model.service';
-
-export class NumberDataModel extends SocketConnectionDataModel {
-
- constructor($http, id) {
- super($http, id);
- }
-
- newData(message) {
- this.updateScope(message);
- }
-
-};
-
-NumberDataModel.$inject = ['$http'];
diff --git a/ui/src/app/dashboard/templates/number/number.directive.ts b/ui/src/app/dashboard/templates/number/number.directive.ts
deleted file mode 100644
index 8c82ee9..0000000
--- a/ui/src/app/dashboard/templates/number/number.directive.ts
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import {WidgetInstances} from '../../widget-instances.service'
-
-'use strict';
-declare const require: any;
-numberWidget.$inject = ['WidgetInstances', '$filter'];
-
-export default function numberWidget(WidgetInstances, $filter) {
- return {
- restrict: 'A',
- replace: true,
- template: require('./number.html'),
- scope: {
- data: '=',
- widgetId: '@'
- },
- controller: function ($scope) {
- WidgetInstances.get($scope.widgetId).then(function (data) {
- $scope.selectedNumberProperty = data.visualisation.schema.selectedNumberProperty.properties.runtimeName;
- $scope.formatDate =
- data
- .visualisation
- .schema
- .selectedNumberProperty
- .properties
- .domainProperties
- .indexOf('http://test.de/timestamp') > -1;
- });
-
- $scope.getRandomColor = function() {
- var random = Math.floor(Math.random() * 6);
- var colors = ["darkblue", "#2196F3", "#3F51B5", "#00BCD4", "#03A9F4", "#673AB7"];
- return colors[random];
- }
-
- $scope.isNumber = function(number) {
- return (typeof number) === "number";
- }
-
- $scope.color = $scope.getRandomColor();
- },
- link: function postLink(scope) {
- scope.$watch('data', function (data) {
- if (data) {
- if (scope.formatDate) {
- scope.item = $filter('date')(data[scope.selectedNumberProperty], 'dd.MM.yyyy HH:mm:ss');
- } else {
- scope.item = data[scope.selectedNumberProperty];
- }
- }
- });
- }
- };
-};
diff --git a/ui/src/app/dashboard/templates/number/number.html b/ui/src/app/dashboard/templates/number/number.html
deleted file mode 100644
index 5354d45..0000000
--- a/ui/src/app/dashboard/templates/number/number.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<div id="circleNumber"
- style="background-color:{{color}};width: 300px; height: 150px; font-size: 30px; color: #fff; line-height: 150px; text-align: center; left: 50%; ">
- <div id="number">
- <div ng-if="isNumber(item)">{{item | number : 2}}</div>
- <div ng-if="!isNumber(item)">{{item}}</div>
- </div>
-</div>
diff --git a/ui/src/app/dashboard/templates/number/numberConfig.html b/ui/src/app/dashboard/templates/number/numberConfig.html
deleted file mode 100644
index f7c1310..0000000
--- a/ui/src/app/dashboard/templates/number/numberConfig.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<config-item flex="100" layout="row" element-title="Select value">
- <div flex="100" layout="column">
- <md-select ng-model="ctrl.wid.schema.selectedNumberProperty">
- <md-option ng-value="prop" ng-selected="index == 1"
- ng-repeat="(index, prop) in ctrl.wid.schema.eventProperties">{{ prop.properties.runtimeName }}
- </md-option>
- </md-select>
- </div>
-</config-item>
\ No newline at end of file
diff --git a/ui/src/app/dashboard/templates/raw/raw-config.component.ts b/ui/src/app/dashboard/templates/raw/raw-config.component.ts
deleted file mode 100644
index b3b8627..0000000
--- a/ui/src/app/dashboard/templates/raw/raw-config.component.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-declare const require: any;
-
-export let spRawWidgetConfig = {
- template: require('./rawConfig.html'),
- bindings: {
- wid: '='
- },
- controller: class RawConfigCtrl {
- constructor() {}
- },
- controllerAs: 'ctrl'
-};
\ No newline at end of file
diff --git a/ui/src/app/dashboard/templates/raw/raw-data-model.service.ts b/ui/src/app/dashboard/templates/raw/raw-data-model.service.ts
deleted file mode 100644
index 5522b78..0000000
--- a/ui/src/app/dashboard/templates/raw/raw-data-model.service.ts
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import {SocketConnectionDataModel} from '../../socket-connection-data-model.service'
-
-
-export class RawDataModel extends SocketConnectionDataModel {
-
- dataArray: any;
- dataArrayLength: any;
-
- constructor($http, id) {
- super($http, id);
- this.dataArray = [];
- this.dataArrayLength = 5;
-
- }
-
-
-
- newData(message) {
- if (this.dataArray.length > this.dataArrayLength - 1) {
- this.dataArray = this.dataArray.slice(Math.max(this.dataArray.length - this.dataArrayLength , 1));
- }
-
- this.dataArray.push(message);
- this.updateScope(this.dataArray);
- }
-
-};
-
-RawDataModel.$inject = ['$http'];
diff --git a/ui/src/app/dashboard/templates/raw/raw.directive.ts b/ui/src/app/dashboard/templates/raw/raw.directive.ts
deleted file mode 100644
index 20bbc62..0000000
--- a/ui/src/app/dashboard/templates/raw/raw.directive.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import {WidgetInstances} from '../../widget-instances.service'
-
-'use strict';
-declare const require: any;
-rawWidget.$inject = ['WidgetInstances'];
-
-export default function rawWidget(WidgetInstances) {
- return {
- restrict: 'A',
- replace: true,
- template: require('./raw.html'),
- scope: {
- data: '=',
- widgetId: '@'
- },
- controller: function ($scope) {
- WidgetInstances.get($scope.widgetId).then(function(data) {
- });
- },
- link: function postLink(scope) {
- scope.$watch('data', function (data) {
- if (data) {
- scope.items = data;
- }
- });
- }
- };
-};
\ No newline at end of file
diff --git a/ui/src/app/dashboard/templates/raw/raw.html b/ui/src/app/dashboard/templates/raw/raw.html
deleted file mode 100644
index 1e7c86c..0000000
--- a/ui/src/app/dashboard/templates/raw/raw.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<div style="width:100%">
- <div ng-repeat="item in items">
- {{item}}
- <md-divider/>
- </div>
-</div>
\ No newline at end of file
diff --git a/ui/src/app/dashboard/templates/raw/rawConfig.html b/ui/src/app/dashboard/templates/raw/rawConfig.html
deleted file mode 100644
index 436b025..0000000
--- a/ui/src/app/dashboard/templates/raw/rawConfig.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<h4>No further customization required.</h4>
\ No newline at end of file
diff --git a/ui/src/app/dashboard/templates/so.filter.ts b/ui/src/app/dashboard/templates/so.filter.ts
deleted file mode 100644
index 854f7dd..0000000
--- a/ui/src/app/dashboard/templates/so.filter.ts
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import * as angular from 'angular';
-
-function filter(soType) {
- return function (eventProperties) {
- var result = [];
- angular.forEach(eventProperties, function (eventProperty) {
- if (eventProperty.properties.domainProperties && eventProperty.properties.domainProperties.indexOf(soType) > -1) {
- result.push(eventProperty)
- }
- });
- return result;
- };
-}
-
-
-function nu() {
-
- return function (eventProperties) {
- var result = [];
- angular.forEach(eventProperties, function (eventProperty) {
- if (eventProperty.properties == 'http://www.w3.org/2001/XMLSchema#float') {
- result.push(eventProperty)
- }
- else if (eventProperty.properties.runtimeType == 'http://www.w3.org/2001/XMLSchema#integer') {
- result.push(eventProperty)
- }
- else if (eventProperty.properties.runtimeType == 'http://www.w3.org/2001/XMLSchema#double' ||
- (eventProperty.properties.runtimeType == 'http://www.w3.org/2001/XMLSchema#float')) {
- result.push(eventProperty)
- } else if (eventProperty.properties.domainProperties && eventProperty.properties.domainProperties.indexOf('http://schema.org/Number') > -1) {
- result.push(eventProperty)
- }
- });
- return result;
- };
-
- //var result = [];
-
- //result.push(filter('http://schema.org/Number'))
- //result.push(runtimeTypeFilter('http://www.w3.org/2001/XMLSchema#float'))
- //result.push(runtimeTypeFilter('http://www.w3.org/2001/XMLSchema#integer'))
- //result.push(runtimeTypeFilter('http://www.w3.org/2001/XMLSchema#double'))
-
-
- //return uniqueArraybyId(result, runtimeName);
-}
-
-function geoLat() {
- return filter('http://www.w3.org/2003/01/geo/wgs84_pos#lat');
-}
-
-function geoLng() {
- return filter('http://www.w3.org/2003/01/geo/wgs84_pos#long');
-}
-
-function soNumber() {
- return filter('http://schema.org/Number');
-};
-
-function image() {
- return filter("https://image.com");
-}
-
-function soDateTime() {
- return filter('http://schema.org/DateTime');
-};
-
-export default {
- nu: nu,
- soNumber: soNumber,
- soDateTime: soDateTime,
- geoLat: geoLat,
- geoLng: geoLng,
- image: image
-}
diff --git a/ui/src/app/dashboard/templates/table/table-config.component.ts b/ui/src/app/dashboard/templates/table/table-config.component.ts
deleted file mode 100644
index 7ca2899..0000000
--- a/ui/src/app/dashboard/templates/table/table-config.component.ts
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-declare const require: any;
-
-export let spTableWidgetConfig = {
- template: require('./tableConfig.html'),
- bindings: {
- wid: '='
- },
- controller: class TableConfigCtrl {
-
- wid: any;
- ShepherdService: any;
-
- constructor(ShepherdService) {
- this.ShepherdService = ShepherdService;
- }
-
- selectAll() {
- this.wid.schema.eventProperties.forEach(ep => {
- ep.isSelected = true;
- });
- this.ShepherdService.trigger("customize-viz")
-
- }
-
- deselectAll() {
- this.wid.schema.eventProperties.forEach(ep => {
- ep.isSelected = false;
- });
- }
- },
- controllerAs: 'ctrl'
-};
diff --git a/ui/src/app/dashboard/templates/table/table-data-model.service.ts b/ui/src/app/dashboard/templates/table/table-data-model.service.ts
deleted file mode 100644
index b91d9f0..0000000
--- a/ui/src/app/dashboard/templates/table/table-data-model.service.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import {SocketConnectionDataModel} from '../../socket-connection-data-model.service'
-
-export class TableDataModel extends SocketConnectionDataModel {
-
- dataArray: any;
- dataArrayLength: any;
-
- constructor($http, id) {
- super($http, id);
- this.dataArray = [];
- this.dataArrayLength = 5;
- }
-
- newData(message) {
- if (this.dataArray.length > this.dataArrayLength - 1) {
- this.dataArray = this.dataArray.slice(Math.max(this.dataArray.length - this.dataArrayLength , 1));
- }
-
- this.dataArray.push(message);
- this.updateScope(this.dataArray);
-
- }
-};
-
-TableDataModel.$inject = ['$http'];
diff --git a/ui/src/app/dashboard/templates/table/table.directive.ts b/ui/src/app/dashboard/templates/table/table.directive.ts
deleted file mode 100644
index f477428..0000000
--- a/ui/src/app/dashboard/templates/table/table.directive.ts
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import {WidgetInstances} from '../../widget-instances.service'
-import * as angular from 'angular';
-
-'use strict';
-declare const require: any;
-tableWidget.$inject = ['WidgetInstances', '$filter'];
-
-export default function tableWidget(WidgetInstances, $filter) {
- return {
- restrict: 'A',
- replace: true,
- template: require('./table.html'),
- scope: {
- data: '=',
- widgetId: '@'
- },
- controller: function ($scope) {
- $scope.tableOptions = {
- initialSorts: [
- { id: 'value', dir: '-' }
- ]
- };
-
- var formatDate = function(value) {
- return $filter('date')(value, 'yyyy-MM-dd HH:mm:ss');
- }
-
- var isDate = function(eventProperty) {
- if (eventProperty.properties.domainProperties && eventProperty.properties.domainProperties.indexOf('http://schema.org/DateTime')>-1) {
- return true;
- }
- return false;
- }
-
- $scope.columns = []
- $scope.ready = false;
-
- //Add the colums that where selected by the user
- WidgetInstances.get($scope.widgetId).then(function(widgetConfig) {
- angular.forEach(widgetConfig.visualisation.schema.eventProperties, function(prop) {
-
- if (prop.isSelected) {
- var name = prop.properties.runtimeName;
- var column = { id: name, key: name, label: name};
-
- if (isDate(prop)) {
- column['format'] = formatDate;
- }
-
- $scope.columns.push(column);
- $scope.ready = true;
- }
- });
-
- });
-
- },
- link: function postLink(scope) {
- scope.$watch('data', function (data) {
- if (data) {
- scope.items = data;
- }
- });
- }
- };
-};
diff --git a/ui/src/app/dashboard/templates/table/table.html b/ui/src/app/dashboard/templates/table/table.html
deleted file mode 100644
index cbf1a2f..0000000
--- a/ui/src/app/dashboard/templates/table/table.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<div class="top-n">
- <mlhr-table
- ng-if="ready"
- options="tableOptions"
- columns="columns"
- rows="items">
- </mlhr-table>
-</div>
diff --git a/ui/src/app/dashboard/templates/table/tableConfig.html b/ui/src/app/dashboard/templates/table/tableConfig.html
deleted file mode 100644
index a02ddfc..0000000
--- a/ui/src/app/dashboard/templates/table/tableConfig.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<config-item flex="100" layout="row" element-title="Select columns">
- <div flex="100" layout="row">
- <sp-button sp-button-blue sp-button-small-padding id="select-all-button" ng-click="ctrl.selectAll()">Select all</sp-button>
- <sp-button sp-button-gray sp-button-small-padding ng-click="ctrl.deselectAll()">Select none</sp-button>
- </div>
- <p/>
- <div flex="100" layout="column">
- <md-checkbox ng-model="prop.isSelected" ng-repeat="prop in ctrl.wid.schema.eventProperties"
- aria-label="{{prop.properties.runtimeName}}">
- {{prop.properties.runtimeName}}
- </md-checkbox>
- </div>
-</config-item>
\ No newline at end of file
diff --git a/ui/src/app/dashboard/templates/trafficlight/trafficlight-config.component.ts b/ui/src/app/dashboard/templates/trafficlight/trafficlight-config.component.ts
deleted file mode 100644
index a54e69b..0000000
--- a/ui/src/app/dashboard/templates/trafficlight/trafficlight-config.component.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-declare const require: any;
-
-export let spTrafficlightWidgetConfig = {
- template: require('./trafficlightConfig.html'),
- bindings: {
- wid: '='
- },
- controller: class TrafficlightConfigCtrl {
- constructor() {}
- },
- controllerAs: 'ctrl'
-};
diff --git a/ui/src/app/dashboard/templates/trafficlight/trafficlight-data-model.service.ts b/ui/src/app/dashboard/templates/trafficlight/trafficlight-data-model.service.ts
deleted file mode 100644
index 1c73cd5..0000000
--- a/ui/src/app/dashboard/templates/trafficlight/trafficlight-data-model.service.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import {SocketConnectionDataModel} from '../../socket-connection-data-model.service.js'
-
-export class TrafficLightDataModel extends SocketConnectionDataModel {
-
- constructor($http, id) {
- super($http, id);
- }
-
- newData(message) {
- this.updateScope(message);
- }
-
-};
-
-TrafficLightDataModel.$inject = ['$http'];
diff --git a/ui/src/app/dashboard/templates/trafficlight/trafficlight.directive.ts b/ui/src/app/dashboard/templates/trafficlight/trafficlight.directive.ts
deleted file mode 100644
index 1202fc2..0000000
--- a/ui/src/app/dashboard/templates/trafficlight/trafficlight.directive.ts
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import {WidgetInstances} from '../../widget-instances.service'
-
-'use strict';
-declare const require: any;
-trafficlightWidget.$inject = ['WidgetInstances'];
-
-export default function trafficlightWidget(WidgetInstances) {
- return {
- restrict: 'A',
- replace: true,
- template: require('./trafficlight.html'),
- scope: {
- data: '=',
- widgetId: '@'
- },
- controller: function ($scope) {
- WidgetInstances.get($scope.widgetId).then(function(data) {
- $scope.selectedNumberProperty = data.visualisation.schema.selectedNumberProperty.properties.runtimeName;
- $scope.criticalThresholdOperator = data.visualisation.config.critical.operator;
- $scope.criticalThresholdValue = data.visualisation.config.critical.value;
- $scope.criticalThresholdRange = data.visualisation.config.critical.range;
- });
-
- $scope.active = function(id, value) {
- if ((exceedsThreshold(value) && id == 0) ||
- (isInWarningRange(value) && id == 1) ||
- (isInOkRange(value) && id == 2)) {
- return "active";
- } else return "";
- }
-
- var exceedsThreshold = function(value) {
- if ($scope.criticalThresholdOperator == 'ge') {
- return value >= $scope.criticalThresholdValue;
- } else {
- return value <= $scope.criticalThresholdValue;
- }
- }
-
- var isInWarningRange = function(value) {
- if (exceedsThreshold(value)) return false;
- else {
- if ($scope.criticalThresholdOperator == 'ge') {
- return value >= ($scope.criticalThresholdValue - $scope.criticalThresholdValue*($scope.criticalThresholdRange/100));
- } else {
- return value <= ($scope.criticalThresholdValue + $scope.criticalThresholdValue*($scope.criticalThresholdRange/100));
- }
- }
- }
- var isInOkRange = function(value) {
- return !exceedsThreshold(value) && !isInWarningRange(value);
- }
- },
- link: function postLink(scope) {
- scope.$watch('data', function (data) {
- if (data) {
- scope.item = data;
- }
- });
- }
- };
-};
diff --git a/ui/src/app/dashboard/templates/trafficlight/trafficlight.html b/ui/src/app/dashboard/templates/trafficlight/trafficlight.html
deleted file mode 100644
index bd06fd9..0000000
--- a/ui/src/app/dashboard/templates/trafficlight/trafficlight.html
+++ /dev/null
@@ -1,23 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<div id="light">
- <span class="{{active(0, item[selectedNumberProperty])}}" id="red"></span>
- <span class="{{active(1, item[selectedNumberProperty])}}" id="orange"></span>
- <span class="{{active(2, item[selectedNumberProperty])}}" id="green"></span>
-</div>
\ No newline at end of file
diff --git a/ui/src/app/dashboard/templates/trafficlight/trafficlightConfig.html b/ui/src/app/dashboard/templates/trafficlight/trafficlightConfig.html
deleted file mode 100644
index ebfce9f..0000000
--- a/ui/src/app/dashboard/templates/trafficlight/trafficlightConfig.html
+++ /dev/null
@@ -1,62 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<div flex="100">
- <config-item flex="100" layout="row" element-title="Select value">
- <div flex="100" layout="column">
- <md-select ng-model="ctrl.wid.schema.selectedNumberProperty">
- <md-option ng-value="prop" ng-selected="index == 0"
- ng-repeat="(index, prop) in ctrl.wid.schema.eventProperties | numberFilter">{{
- prop.properties.runtimeName
- }}
- </md-option>
- </md-select>
- </div>
- </config-item>
-
- <config-item flex="100" layout="row" element-title="Critical Threshold">
- <div flex="100" layout="row">
- <div flex="50">
- <md-input-container>
- <label>Operator</label>
- <md-select required ng-model="ctrl.wid.config.critical.operator">
- <md-option ng-value="'ge'">upper limit</md-option>
- <md-option ng-value="'le'">under limit</md-option>
- </md-select>
- </md-input-container>
- </div>
- <div flex="50">
- <md-input-container>
- <label>Value</label>
- <input required ng-model="ctrl.wid.config.critical.value" style="color:black;">
- </md-input-container>
- </div>
- </div>
- </config-item>
-
- <config-item flex="100" layout="row" element-title="Warning Range">
- <div flex="100" layout="column">
- <div flex="100">
- <md-input-container>
- <label>Value</label>
- <input required ng-model="ctrl.wid.config.critical.range" style="color:black;">
- </md-input-container>
- </div>
- </div>
- </config-item>
-</div>
\ No newline at end of file
diff --git a/ui/src/app/dashboard/templates/verticalbar/verticalbar-config.component.ts b/ui/src/app/dashboard/templates/verticalbar/verticalbar-config.component.ts
deleted file mode 100644
index 466b965..0000000
--- a/ui/src/app/dashboard/templates/verticalbar/verticalbar-config.component.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-declare const require: any;
-
-export let spVerticalbarWidgetConfig = {
- restrict: 'E',
- template: require('./verticalbarConfig.html'),
- bindings: {
- wid: '='
- },
- controller: class VerticalbarConfigCtrl {
- constructor() {}
- },
- controllerAs: 'ctrl'
-};
diff --git a/ui/src/app/dashboard/templates/verticalbar/verticalbar-data-model.service.ts b/ui/src/app/dashboard/templates/verticalbar/verticalbar-data-model.service.ts
deleted file mode 100644
index 4e7b99c..0000000
--- a/ui/src/app/dashboard/templates/verticalbar/verticalbar-data-model.service.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import {SocketConnectionDataModel} from '../../socket-connection-data-model.service'
-
-export class VerticalbarDataModel extends SocketConnectionDataModel {
-
- constructor($http, id) {
- super($http, id);
- }
-
- newData(message) {
- this.updateScope(message);
- }
-
-};
-
-VerticalbarDataModel.$inject = ['$http'];
diff --git a/ui/src/app/dashboard/templates/verticalbar/verticalbar.directive.ts b/ui/src/app/dashboard/templates/verticalbar/verticalbar.directive.ts
deleted file mode 100644
index e46ec6e..0000000
--- a/ui/src/app/dashboard/templates/verticalbar/verticalbar.directive.ts
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import {WidgetInstances} from '../../widget-instances.service'
-
-'use strict';
-declare const require: any;
-verticalbarWidget.$inject = ['WidgetInstances'];
-
-export default function verticalbarWidget(WidgetInstances) {
- return {
- restrict: 'A',
- replace: true,
- template: require('./verticalbar.html'),
- scope: {
- data: '=',
- widgetId: '@'
- },
- controller: function ($scope) {
- WidgetInstances.get($scope.widgetId).then(function(widgetConfig) {
- $scope.selectedNumberProperty = widgetConfig.visualisation.schema.selectedNumberProperty.properties.runtimeName;
- $scope.min = widgetConfig.visualisation.config.min;
- $scope.max = widgetConfig.visualisation.config.max;
- });
-
- // TODO replace with min/max values
- $scope.printValue = function(value) {
- return 100 - percent(0, 100, value);
- }
-
- var percent = function(min, max, current) {
- return 100 * (current - $scope.min) / ($scope.max - $scope.min);
- }
-
-
- },
- link: function postLink(scope) {
- scope.$watch('data', function (data) {
- if (data) {
- scope.item = data;
- }
- });
- }
- };
-};
diff --git a/ui/src/app/dashboard/templates/verticalbar/verticalbar.html b/ui/src/app/dashboard/templates/verticalbar/verticalbar.html
deleted file mode 100644
index 3595273..0000000
--- a/ui/src/app/dashboard/templates/verticalbar/verticalbar.html
+++ /dev/null
@@ -1,36 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<div id='measuringCylinder' style="width:150px;min-height:200px;height:200px;">
- <div id='verticalBar' style="float:left;">
- <div id='barTop' style="border-top:2px #009688 solid;border-right:15px #009688 solid"></div>
- <div id='currentFill' style="width:200px;height:200px;border-width: 2px;border-style: solid;-webkit-border-radius: 2px;-moz-border-radius: 2px;border-radius: 2px;background-color: #009688;border-color: #009688;margin:-2px">
- <div id='currentFillPercent' style="background-color:white;max-height:100%;height:{{printValue(item[selectedNumberProperty])}}%"></div>
- <div id='marker'></div>
- </div>
- <div id='barBottom' style="border-top:2px #009688 solid;border-right:15px #009688 solid"></div>
- </div>
- <div id='legend' style="position:relative;top:-200px;left:-50px;">
- <div id='valueTop'>{{max}}</div>
- <div id='space'>
- <!--<div id='legendSpace' style="min-height:10px;max-height:169px;height:%"></div>-->
- <div id='valueCurrent'style="color:black;font-weight:bold;position:relative;left:60px;top:{{(printValue(item[selectedNumberProperty])+20)}}px">{{item[selectedNumberProperty] | number : 2}}</div>
- </div>
- <div id='valueBottom' style="position:relative;top:130px;color:#009688;font-weight:bold;">{{min}}</div>
- </div>
-</div>
\ No newline at end of file
diff --git a/ui/src/app/dashboard/templates/verticalbar/verticalbarConfig.html b/ui/src/app/dashboard/templates/verticalbar/verticalbarConfig.html
deleted file mode 100644
index e0d2782..0000000
--- a/ui/src/app/dashboard/templates/verticalbar/verticalbarConfig.html
+++ /dev/null
@@ -1,49 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<div flex="100">
- <config-item flex="100" layout="row" element-title="Select value">
- <div flex="100" layout="column">
- <md-select ng-model="ctrl.wid.schema.selectedNumberProperty">
- <md-option ng-value="prop" ng-selected="index == 1"
- ng-repeat="(index, prop) in ctrl.wid.schema.eventProperties | numberFilter">{{
- prop.properties.runtimeName }}
- </md-option>
- </md-select>
- </div>
- </config-item>
-
- <config-item flex="100" layout="row" element-title="Vertical bar settings">
- <div flex="100" layout="column">
- <div layout="row" flex="100" layout-align="center center">
- <div flex="50">
- <md-input-container>
- <label>Minimum</label>
- <input ng-model="ctrl.wid.config.min">
- </md-input-container>
- </div>
- <div flex="50">
- <md-input-container>
- <label>Maximum</label>
- <input ng-model="ctrl.wid.config.max">
- </md-input-container>
- </div>
- </div>
- </div>
- </config-item>
-</div>
\ No newline at end of file
diff --git a/ui/src/app/dashboard/templates/widget-templates.service.ts b/ui/src/app/dashboard/templates/widget-templates.service.ts
deleted file mode 100644
index ca6a35a..0000000
--- a/ui/src/app/dashboard/templates/widget-templates.service.ts
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import * as angular from 'angular';
-
-export class WidgetTemplates {
-
- widgetTypes: any;
-
- constructor(TableDataModel,
- NumberDataModel,
- LineDataModel,
- VerticalbarDataModel,
- GaugeDataModel,
- TrafficLightDataModel,
- RawDataModel,
- MapDataModel,
- HeatmapDataModel,
- ImageDataModel,
- HtmlDataModel) {
-
-
- //Register the new widgets here
- this.widgetTypes = {
- table: {
- name: 'table',
- label: 'Table Visualisation',
- icon: 'format_list_numbered',
- directive: 'sp-table-widget',
- dataModel: TableDataModel,
- },
- number: {
- name: 'number',
- label: 'Single Value Visualisation',
- directive: 'sp-number-widget',
- icon: 'exposure_plus_2',
- dataModel: NumberDataModel,
- },
- line: {
- name: 'line',
- label: 'Line Chart',
- icon: 'show_chart',
- directive: 'sp-line-widget',
- dataModel: LineDataModel,
- },
- verticalbar: {
- name: 'verticalbar',
- label: 'Vertical Bar Chart',
- icon: 'insert_chart',
- directive: 'sp-verticalbar-widget',
- dataModel: VerticalbarDataModel,
- },
- gauge: {
- name: 'gauge',
- label: 'Gauge',
- icon: 'network_check',
- directive: 'sp-gauge-widget',
- dataModel: GaugeDataModel,
- },
- trafficlight: {
- name: 'trafficlight',
- label: 'Traffic Light',
- icon: 'traffic',
- directive: 'sp-trafficlight-widget',
- dataModel: TrafficLightDataModel,
- },
- raw: {
- name: 'raw',
- label: 'Raw Data',
- icon: '',
- directive: 'sp-raw-widget',
- dataModel: RawDataModel,
- },
- map: {
- name: 'map',
- label: 'Map',
- icon: 'map',
- directive: 'sp-map-widget',
- dataModel: MapDataModel,
- },
- // heatmap: {
- // name: 'heatmap',
- // label: 'Heatmap',
- // icon: '',
- // directive: 'sp-heatmap-widget',
- // dataModel: HeatmapDataModel,
- // },
- image: {
- name: 'image',
- label: 'Image',
- icon: 'image',
- directive: 'sp-image-widget',
- dataModel: ImageDataModel,
- },
- html: {
- name: 'html',
- label: 'HTML',
- icon: 'web_asset',
- directive: 'sp-html-widget',
- dataModel: HtmlDataModel,
- }
-
- }
- }
-
- getDataModel(name) {
- return this.widgetTypes[name].dataModel;
- }
-
- getDirectiveName(name) {
- return this.widgetTypes[name].directive;
- }
-
- getAllNames() {
- var result = [];
- angular.forEach(this.widgetTypes, function (w) {
- var vis = {};
- vis['name'] = w.name;
- vis['label'] = w.label;
- vis['icon'] = w.icon;
- result.push(vis);
- });
-
- return result;
- }
-
-};
-
-WidgetTemplates.$inject = [
- 'TableDataModel',
- 'NumberDataModel',
- 'LineDataModel',
- 'VerticalbarDataModel',
- 'GaugeDataModel',
- 'TrafficLightDataModel',
- 'RawDataModel',
- 'MapDataModel',
- 'HeatmapDataModel',
- 'ImageDataModel',
- 'HtmlDataModel'
-];
-
diff --git a/ui/src/app/dashboard/widget-data-model.service.ts b/ui/src/app/dashboard/widget-data-model.service.ts
deleted file mode 100644
index c7a015d..0000000
--- a/ui/src/app/dashboard/widget-data-model.service.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// factory('WidgetDataModel', function () {
-export class WidgetDataModel {
-
- dataAttrName: any;
- dataModelOptions: any;
- widgetScope: any;
-
- constructor() {}
-
- setup(widget, scope) {
- this.dataAttrName = widget.dataAttrName;
- this.dataModelOptions = widget.dataModelOptions;
- this.widgetScope = scope;
- }
-
- updateScope(data) {
- this.widgetScope.widgetData = data;
- }
-
- init() {
- // to be overridden by subclasses
- }
-
- destroy() {
- // to be overridden by subclasses
- }
-
-}
diff --git a/ui/src/app/dashboard/widget-instances.service.ts b/ui/src/app/dashboard/widget-instances.service.ts
deleted file mode 100644
index 125c80b..0000000
--- a/ui/src/app/dashboard/widget-instances.service.ts
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import * as angular from 'angular';
-import * as _ from 'lodash';
-
-export class WidgetInstances {
-
- $http: any;
- WidgetTemplates: any;
-
- constructor($http, WidgetTemplates) {
- this.$http = $http;
- this.WidgetTemplates = WidgetTemplates;
- }
-
- getId() {
- return Math.floor((1 + Math.random()) * 0x10000);
- }
-
- getWidgets() {
- return this.$http.get('/dashboard/_all_docs?include_docs=true').then(data => {
- var result = [];
- angular.forEach(data.data.rows, d => {
- result.push(d.doc);
- });
-
- return result;
- });
- }
-
- add(widget) {
- var id = this.getId();
- widget.id = id;
- this.$http.post('/dashboard', widget).then(() => {
- }, err => {
- console.log(err);
- });
- }
-
- remove(widget) {
- return this.$http.delete('/dashboard/'+ widget._id + '?rev=' + widget._rev);
- }
-
- get(id) {
- return this.getWidgets().then(data => {
- var result = _.filter(data, d => {
- return d.id == id;
- });
-
- return result[0];
- });
- }
-
-
- getWidgetDashboardDefinition(widget) {
- var name = widget.visualisation.name + " - " +widget.visualisation.visualizationName + ' (' + widget.visualisationType + ')';
- var directive = this.WidgetTemplates.getDirectiveName(widget.visualisationType);
- var dataModel = this.WidgetTemplates.getDataModel(widget.visualisationType);
-
- return {
- name: name,
- directive: directive,
- title: widget.id,
- dataAttrName: 'data',
- dataModelType: dataModel,
- dataModelArgs: widget.visualisationId,
- attrs: {
- 'widget-id': widget.id
- },
- style: {
- width: '30%'
- },
- layoutId: widget.layoutId
- }
- }
-
- getAllWidgetDefinitions() {
- var result = [];
-
- return this.getWidgets().then(data => {
- angular.forEach(data, (w, key) => {
- result.push(this.getWidgetDashboardDefinition(w));
- });
-
- return result;
- });
- }
-
-};
-
-WidgetInstances.$inject = ['$http', 'WidgetTemplates'];
-