This is an automated email from the ASF dual-hosted git repository.
zehnder pushed a commit to branch 3045-remove-deprecated-assetdashboardresource
in repository https://gitbox.apache.org/repos/asf/streampipes.git
The following commit(s) were added to
refs/heads/3045-remove-deprecated-assetdashboardresource by this push:
new f326d8d349 refactor(#3045): Remove deprecated asset dashboard.
f326d8d349 is described below
commit f326d8d349423c6e44f4987ffce6c8d49266aaf0
Author: Philipp Zehnder <[email protected]>
AuthorDate: Wed Jul 17 17:42:06 2024 +0200
refactor(#3045): Remove deprecated asset dashboard.
---
.../assetdashboard/AssetDashboardConfig.java | 115 -------
.../model/client/assetdashboard/CanvasElement.java | 55 ----
.../model/client/assetdashboard/ImageInfo.java | 97 ------
.../rest/impl/AssetDashboardResource.java | 176 -----------
.../streampipes/storage/api/INoSqlStorage.java | 3 -
.../storage/couchdb/CouchDbStorageManager.java | 9 -
.../app-asset-monitoring.component.html | 52 ----
.../app-asset-monitoring.component.scss | 25 --
.../app-asset-monitoring.component.ts | 64 ----
.../app-asset-monitoring.module.ts | 76 -----
.../app-asset-monitoring.routes.ts | 27 --
.../create-asset/create-asset.component.html | 87 ------
.../create-asset/create-asset.component.scss | 29 --
.../create-asset/create-asset.component.ts | 340 ---------------------
.../dashboard-overview.component.html | 83 -----
.../dashboard-overview.component.scss | 29 --
.../dashboard-overview.component.ts | 61 ----
.../view-asset/view-asset.component.html | 45 ---
.../view-asset/view-asset.component.scss | 28 --
.../components/view-asset/view-asset.component.ts | 179 -----------
.../dialog/add-link/add-link-dialog.component.html | 73 -----
.../dialog/add-link/add-link-dialog.component.scss | 23 --
.../dialog/add-link/add-link-dialog.component.ts | 55 ----
.../add-pipeline-dialog.component.html | 164 ----------
.../add-pipeline-dialog.component.scss | 52 ----
.../add-pipeline/add-pipeline-dialog.component.ts | 168 ----------
.../save-dashboard-dialog.component.html | 61 ----
.../save-dashboard-dialog.component.scss | 32 --
.../save-dashboard-dialog.component.ts | 111 -------
.../model/canvas-attributes.model.ts | 36 ---
.../model/canvas-configuration.model.ts | 24 --
.../model/canvas-element.model.ts | 25 --
.../model/dashboard-configuration.model.ts | 31 --
.../app-asset-monitoring/model/image-info.model.ts | 31 --
.../model/selected-visualization-data.model.ts | 35 ---
.../app/app-asset-monitoring/model/test-data.json | 126 --------
.../app-asset-monitoring/services/rest.service.ts | 87 ------
.../app-asset-monitoring/services/shape.service.ts | 162 ----------
ui/src/app/app-overview/app-overview.module.ts | 2 -
39 files changed, 2878 deletions(-)
diff --git
a/streampipes-model-client/src/main/java/org/apache/streampipes/model/client/assetdashboard/AssetDashboardConfig.java
b/streampipes-model-client/src/main/java/org/apache/streampipes/model/client/assetdashboard/AssetDashboardConfig.java
deleted file mode 100644
index 9d162c9595..0000000000
---
a/streampipes-model-client/src/main/java/org/apache/streampipes/model/client/assetdashboard/AssetDashboardConfig.java
+++ /dev/null
@@ -1,115 +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.
- *
- */
-package org.apache.streampipes.model.client.assetdashboard;
-
-import org.apache.streampipes.model.shared.api.Storable;
-
-import com.google.gson.annotations.SerializedName;
-
-import java.util.List;
-import java.util.Map;
-
-public class AssetDashboardConfig implements Storable {
-
- private @SerializedName("_id") String dashboardId;
- private @SerializedName("_rev") String rev;
-
- private String dashboardName;
- private String dashboardDescription;
- private ImageInfo imageInfo;
- private Map<String, Object> attrs;
- private String className;
- private List<CanvasElement> children;
-
- public AssetDashboardConfig() {
- }
-
- public String getDashboardName() {
- return dashboardName;
- }
-
- public void setDashboardName(String dashboardName) {
- this.dashboardName = dashboardName;
- }
-
- public String getDashboardDescription() {
- return dashboardDescription;
- }
-
- public void setDashboardDescription(String dashboardDescription) {
- this.dashboardDescription = dashboardDescription;
- }
-
- public Map<String, Object> getAttrs() {
- return attrs;
- }
-
- public void setAttrs(Map<String, Object> attrs) {
- this.attrs = attrs;
- }
-
- public String getClassName() {
- return className;
- }
-
- public void setClassName(String className) {
- this.className = className;
- }
-
- public List<CanvasElement> getChildren() {
- return children;
- }
-
- public void setChildren(List<CanvasElement> children) {
- this.children = children;
- }
-
- public ImageInfo getImageInfo() {
- return imageInfo;
- }
-
- public void setImageInfo(ImageInfo imageInfo) {
- this.imageInfo = imageInfo;
- }
-
- public String getDashboardId() {
- return dashboardId;
- }
-
- public void setDashboardId(String dashboardId) {
- this.dashboardId = dashboardId;
- }
-
- public String getRev() {
- return rev;
- }
-
- public void setRev(String rev) {
- this.rev = rev;
- }
-
- @Override
- public String getElementId() {
- return this.dashboardId;
- }
-
- @Override
- public void setElementId(String elementId) {
- this.dashboardId = elementId;
- }
-}
diff --git
a/streampipes-model-client/src/main/java/org/apache/streampipes/model/client/assetdashboard/CanvasElement.java
b/streampipes-model-client/src/main/java/org/apache/streampipes/model/client/assetdashboard/CanvasElement.java
deleted file mode 100644
index a0cefd20ce..0000000000
---
a/streampipes-model-client/src/main/java/org/apache/streampipes/model/client/assetdashboard/CanvasElement.java
+++ /dev/null
@@ -1,55 +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.
- *
- */
-package org.apache.streampipes.model.client.assetdashboard;
-
-import java.util.List;
-import java.util.Map;
-
-public class CanvasElement {
-
- private Map<String, Object> attrs;
- private String className;
- private List<CanvasElement> children;
-
- public CanvasElement() {
- }
-
- public Map<String, Object> getAttrs() {
- return attrs;
- }
-
- public void setAttrs(Map<String, Object> attrs) {
- this.attrs = attrs;
- }
-
- public String getClassName() {
- return className;
- }
-
- public void setClassName(String className) {
- this.className = className;
- }
-
- public List<CanvasElement> getChildren() {
- return children;
- }
-
- public void setChildren(List<CanvasElement> children) {
- this.children = children;
- }
-}
diff --git
a/streampipes-model-client/src/main/java/org/apache/streampipes/model/client/assetdashboard/ImageInfo.java
b/streampipes-model-client/src/main/java/org/apache/streampipes/model/client/assetdashboard/ImageInfo.java
deleted file mode 100644
index b80aeaf58b..0000000000
---
a/streampipes-model-client/src/main/java/org/apache/streampipes/model/client/assetdashboard/ImageInfo.java
+++ /dev/null
@@ -1,97 +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.
- *
- */
-package org.apache.streampipes.model.client.assetdashboard;
-
-public class ImageInfo {
-
- private String imageName;
- private float x;
- private float y;
- private float width;
- private float height;
- private float scaleX = 1;
- private float scaleY = 1;
- private float rotation = 0;
-
- public ImageInfo() {
- }
-
- public float getX() {
- return x;
- }
-
- public void setX(float x) {
- this.x = x;
- }
-
- public float getY() {
- return y;
- }
-
- public void setY(float y) {
- this.y = y;
- }
-
- public float getWidth() {
- return width;
- }
-
- public void setWidth(float width) {
- this.width = width;
- }
-
- public float getHeight() {
- return height;
- }
-
- public void setHeight(float height) {
- this.height = height;
- }
-
- public float getScaleX() {
- return scaleX;
- }
-
- public void setScaleX(float scaleX) {
- this.scaleX = scaleX;
- }
-
- public float getScaleY() {
- return scaleY;
- }
-
- public void setScaleY(float scaleY) {
- this.scaleY = scaleY;
- }
-
- public String getImageName() {
- return imageName;
- }
-
- public void setImageName(String imageName) {
- this.imageName = imageName;
- }
-
- public float getRotation() {
- return rotation;
- }
-
- public void setRotation(float rotation) {
- this.rotation = rotation;
- }
-}
diff --git
a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/AssetDashboardResource.java
b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/AssetDashboardResource.java
deleted file mode 100644
index ed64308423..0000000000
---
a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/AssetDashboardResource.java
+++ /dev/null
@@ -1,176 +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.
- *
- */
-package org.apache.streampipes.rest.impl;
-
-import org.apache.streampipes.manager.file.FileManager;
-import org.apache.streampipes.model.client.assetdashboard.AssetDashboardConfig;
-import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
-import org.apache.streampipes.rest.shared.exception.SpMessageException;
-import org.apache.streampipes.storage.api.CRUDStorage;
-import org.apache.streampipes.storage.management.StorageDispatcher;
-
-import org.apache.commons.io.FileUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestPart;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.FileNameMap;
-import java.net.URLConnection;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.util.List;
-
-@RestController
-@RequestMapping("/api/v2/asset-dashboards")
-@Deprecated(forRemoval = true, since = "0.95.0")
-public class AssetDashboardResource extends AbstractRestResource {
-
- private static final Logger LOG =
LoggerFactory.getLogger(AssetDashboardResource.class);
-
- private static final String APP_ID =
"org.apache.streampipes.apps.assetdashboard";
-
- @GetMapping(path = "/{dashboardId}", produces =
MediaType.APPLICATION_JSON_VALUE)
- public ResponseEntity<AssetDashboardConfig>
getAssetDashboard(@PathVariable("dashboardId") String dashboardId) {
- return ok(getNoSqlStorage().getAssetDashboardStorage()
- .getElementById(dashboardId));
- }
-
- @PutMapping(
- path = "/{dashboardId}",
- produces = MediaType.APPLICATION_JSON_VALUE,
- consumes = MediaType.APPLICATION_JSON_VALUE)
- public ResponseEntity<Void> updateAssetDashboard(
- @PathVariable("dashboardId") String dashboardId,
- @RequestBody AssetDashboardConfig dashboardConfig
- ) {
- AssetDashboardConfig dashboard =
getAssetDashboardStorage().getElementById(dashboardId);
- dashboardConfig.setRev(dashboard.getRev());
- getNoSqlStorage().getAssetDashboardStorage()
- .updateElement(dashboardConfig);
- return ok();
- }
-
- @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
- public ResponseEntity<List<AssetDashboardConfig>> getAllDashboards() {
- return ok(getNoSqlStorage().getAssetDashboardStorage()
- .findAll());
- }
-
- @PostMapping(
- produces = MediaType.APPLICATION_JSON_VALUE,
- consumes = MediaType.APPLICATION_JSON_VALUE)
- public ResponseEntity<Void> storeAssetDashboard(@RequestBody
AssetDashboardConfig dashboardConfig) {
- getNoSqlStorage().getAssetDashboardStorage()
- .persist(dashboardConfig);
- return ok();
- }
-
- @DeleteMapping(path = "/{dashboardId}")
- public ResponseEntity<Void>
deleteAssetDashboard(@PathVariable("dashboardId") String dashboardId) {
- getNoSqlStorage().getAssetDashboardStorage()
- .deleteElementById(dashboardId);
- return ok();
- }
-
- @GetMapping(path = "/images/{imageName}")
- public ResponseEntity<byte[]> getDashboardImage(@PathVariable("imageName")
String imageName) {
- try {
- var sanitizedFileName = new FileManager().sanitizeFilename(imageName);
- java.nio.file.Path path = Paths.get(getTargetFile(sanitizedFileName));
- File file = new File(path.toString());
- FileNameMap fileNameMap = URLConnection.getFileNameMap();
- String mimeType = fileNameMap.getContentTypeFor(file.getName());
- HttpHeaders headers = new HttpHeaders();
- headers.setContentType(MediaType.parseMediaType(mimeType));
- headers.setContentDispositionFormData("attachment", "filename"); // You
can adjust the filename as needed
-
- return new ResponseEntity<>(Files.readAllBytes(path), headers,
org.springframework.http.HttpStatus.OK);
- } catch (IOException e) {
- LOG.error(e.getMessage(), e);
- throw new SpMessageException(HttpStatus.INTERNAL_SERVER_ERROR, e);
- }
- }
-
-
- @PostMapping(path = "/images", consumes =
MediaType.MULTIPART_FORM_DATA_VALUE)
- public ResponseEntity<Void> storeDashboardImage(@RequestPart("file_upload")
MultipartFile fileDetail) {
- try {
- var fileName = fileDetail.getName();
-
- if (!new FileManager().validateFileType(fileName)) {
- LOG.error("File type of file " + fileName + " is not supported");
- fail();
- }
-
- storeFile(fileDetail.getName(), fileDetail.getInputStream());
- return ok();
- } catch (IOException e) {
- LOG.error("Could not extract image input stream from request", e);
- return fail();
- }
- }
-
- private void storeFile(String fileName, InputStream fileInputStream) {
-
- var targetDirectory = new File(getTargetDirectory());
- if (!targetDirectory.exists()) {
- targetDirectory.mkdirs();
- }
-
- var sanitizedFileName = new FileManager().sanitizeFilename(fileName);
-
- var targetFile = new File(getTargetFile(sanitizedFileName));
-
- try {
- FileUtils.copyInputStreamToFile(fileInputStream, targetFile);
- } catch (IOException e) {
- LOG.error(e.getMessage(), e);
- throw new SpMessageException(HttpStatus.INTERNAL_SERVER_ERROR, e);
- }
- }
-
- private String getTargetDirectory() {
- return System.getProperty("user.home") + File.separator + ".streampipes"
- + File.separator + "assets" + File.separator + APP_ID;
- }
-
- private String getTargetFile(String filename) {
- return getTargetDirectory() + File.separator + filename;
- }
-
- private CRUDStorage<AssetDashboardConfig> getAssetDashboardStorage() {
- return StorageDispatcher.INSTANCE.getNoSqlStore()
- .getAssetDashboardStorage();
- }
-}
diff --git
a/streampipes-storage-api/src/main/java/org/apache/streampipes/storage/api/INoSqlStorage.java
b/streampipes-storage-api/src/main/java/org/apache/streampipes/storage/api/INoSqlStorage.java
index 2b8c0203d7..481bdd6871 100644
---
a/streampipes-storage-api/src/main/java/org/apache/streampipes/storage/api/INoSqlStorage.java
+++
b/streampipes-storage-api/src/main/java/org/apache/streampipes/storage/api/INoSqlStorage.java
@@ -17,7 +17,6 @@
*/
package org.apache.streampipes.storage.api;
-import org.apache.streampipes.model.client.assetdashboard.AssetDashboardConfig;
import org.apache.streampipes.model.client.user.Group;
import org.apache.streampipes.model.client.user.PasswordRecoveryToken;
import org.apache.streampipes.model.client.user.UserActivationToken;
@@ -49,8 +48,6 @@ public interface INoSqlStorage {
INotificationStorage getNotificationStorageApi();
- CRUDStorage<AssetDashboardConfig> getAssetDashboardStorage();
-
CRUDStorage<DataLakeMeasure> getDataLakeStorage();
CRUDStorage<FileMetadata> getFileMetadataStorage();
diff --git
a/streampipes-storage-couchdb/src/main/java/org/apache/streampipes/storage/couchdb/CouchDbStorageManager.java
b/streampipes-storage-couchdb/src/main/java/org/apache/streampipes/storage/couchdb/CouchDbStorageManager.java
index 8f9cd5826b..c368713da7 100644
---
a/streampipes-storage-couchdb/src/main/java/org/apache/streampipes/storage/couchdb/CouchDbStorageManager.java
+++
b/streampipes-storage-couchdb/src/main/java/org/apache/streampipes/storage/couchdb/CouchDbStorageManager.java
@@ -17,7 +17,6 @@
*/
package org.apache.streampipes.storage.couchdb;
-import org.apache.streampipes.model.client.assetdashboard.AssetDashboardConfig;
import org.apache.streampipes.model.client.user.Group;
import org.apache.streampipes.model.client.user.PasswordRecoveryToken;
import org.apache.streampipes.model.client.user.UserActivationToken;
@@ -118,14 +117,6 @@ public enum CouchDbStorageManager implements INoSqlStorage
{
return new NotificationStorageImpl();
}
- @Override
- public CRUDStorage<AssetDashboardConfig> getAssetDashboardStorage() {
- return new DefaultCrudStorage<>(
- () -> Utils.getCouchDbGsonClient("assetdashboard"),
- AssetDashboardConfig.class
- );
- }
-
@Override
public CRUDStorage<DataLakeMeasure> getDataLakeStorage() {
return new DefaultCrudStorage<>(
diff --git
a/ui/src/app/app-asset-monitoring/app-asset-monitoring.component.html
b/ui/src/app/app-asset-monitoring/app-asset-monitoring.component.html
deleted file mode 100644
index 7fe7439dc4..0000000000
--- a/ui/src/app/app-asset-monitoring/app-asset-monitoring.component.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.
- ~
- -->
-
-<sp-basic-view showBackLink="true" [backLinkTarget]="['apps', 'overview']">
- <ng-container nav>
- <mat-tab-group
- [selectedIndex]="selectedIndex"
- (selectedIndexChange)="selectedIndexChange($event)"
- color="accent"
- >
- <mat-tab label="Asset Dashboards"> </mat-tab>
- <mat-tab id="all-adapters" label="New Asset Dashboard"> </mat-tab>
- </mat-tab-group>
- </ng-container>
-
- <div fxLayout="column" fxFlex="100">
- <sp-asset-dashboard-overview
- *ngIf="selectedIndex === 0 && !dashboardSelected"
- fxFlex="100"
- (selectedDashboard)="openDashboard($event)"
- (createDashboard)="selectedIndex = 1"
- ></sp-asset-dashboard-overview>
- <sp-view-asset
- fxFlex="100"
- *ngIf="selectedIndex === 0 && dashboardSelected"
- [dashboardConfig]="selectedDashboard"
- (dashboardClosed)="closeDashboard($event)"
- (editDashboardEmitter)="editDashboard($event)"
- ></sp-view-asset>
- <sp-create-asset
- *ngIf="selectedIndex === 1"
- fxFlex="100"
- (dashboardClosed)="closeDashboard($event)"
- [dashboardConfig]="selectedDashboard"
- ></sp-create-asset>
- </div>
-</sp-basic-view>
diff --git
a/ui/src/app/app-asset-monitoring/app-asset-monitoring.component.scss
b/ui/src/app/app-asset-monitoring/app-asset-monitoring.component.scss
deleted file mode 100644
index 618e5b0499..0000000000
--- a/ui/src/app/app-asset-monitoring/app-asset-monitoring.component.scss
+++ /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.
- *
- */
-
-.page-container-padding {
- width: 100%;
-}
-
-.page-container-padding-inner {
- padding: 10px;
-}
diff --git a/ui/src/app/app-asset-monitoring/app-asset-monitoring.component.ts
b/ui/src/app/app-asset-monitoring/app-asset-monitoring.component.ts
deleted file mode 100644
index 945d1e5822..0000000000
--- a/ui/src/app/app-asset-monitoring/app-asset-monitoring.component.ts
+++ /dev/null
@@ -1,64 +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 { Component, EventEmitter, OnInit, Output } from '@angular/core';
-import { DashboardConfiguration } from './model/dashboard-configuration.model';
-import { SpBreadcrumbService } from '@streampipes/shared-ui';
-import { SpAppRoutes } from '../app-overview/apps.routes';
-import { SpAppAssetMonitoringRoutes } from './app-asset-monitoring.routes';
-
-@Component({
- selector: 'sp-app-asset-monitoring',
- templateUrl: './app-asset-monitoring.component.html',
- styleUrls: ['./app-asset-monitoring.component.scss'],
-})
-export class AppAssetMonitoringComponent implements OnInit {
- selectedIndex = 0;
- dashboardSelected = false;
- selectedDashboard: DashboardConfiguration;
- @Output() appOpened = new EventEmitter<boolean>();
-
- constructor(private breadcrumbService: SpBreadcrumbService) {}
-
- ngOnInit() {
- this.breadcrumbService.updateBreadcrumb([
- SpAppRoutes.BASE,
- this.breadcrumbService.removeLink(SpAppAssetMonitoringRoutes.BASE),
- ]);
- this.appOpened.emit(true);
- }
-
- selectedIndexChange(index: number) {
- this.selectedIndex = index;
- }
-
- openDashboard(dashboardConfig: DashboardConfiguration) {
- this.selectedDashboard = dashboardConfig;
- this.dashboardSelected = true;
- }
-
- closeDashboard(dashboardClosed: boolean) {
- this.dashboardSelected = false;
- this.selectedIndex = 0;
- }
-
- editDashboard(dashboardConfig: DashboardConfiguration) {
- this.selectedDashboard = dashboardConfig;
- this.selectedIndex = 1;
- }
-}
diff --git a/ui/src/app/app-asset-monitoring/app-asset-monitoring.module.ts
b/ui/src/app/app-asset-monitoring/app-asset-monitoring.module.ts
deleted file mode 100644
index df9d4bfe46..0000000000
--- a/ui/src/app/app-asset-monitoring/app-asset-monitoring.module.ts
+++ /dev/null
@@ -1,76 +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 { NgModule } from '@angular/core';
-import { FlexLayoutModule } from '@ngbracket/ngx-layout';
-import { CommonModule } from '@angular/common';
-
-import { AppAssetMonitoringComponent } from './app-asset-monitoring.component';
-
-import { ViewAssetComponent } from
'./components/view-asset/view-asset.component';
-import { CreateAssetComponent } from
'./components/create-asset/create-asset.component';
-import { AddPipelineDialogComponent } from
'./dialog/add-pipeline/add-pipeline-dialog.component';
-import { MatFormFieldModule } from '@angular/material/form-field';
-import { MatGridListModule } from '@angular/material/grid-list';
-import { MatInputModule } from '@angular/material/input';
-import { FormsModule } from '@angular/forms';
-import { ColorPickerModule } from 'ngx-color-picker';
-import { SaveDashboardDialogComponent } from
'./dialog/save-dashboard/save-dashboard-dialog.component';
-import { AssetDashboardOverviewComponent } from
'./components/dashboard-overview/dashboard-overview.component';
-import { AddLinkDialogComponent } from
'./dialog/add-link/add-link-dialog.component';
-import { RouterModule } from '@angular/router';
-import { SharedUiModule } from '@streampipes/shared-ui';
-import { MatDividerModule } from '@angular/material/divider';
-import { MatIconModule } from '@angular/material/icon';
-import { MatTabsModule } from '@angular/material/tabs';
-import { MatButtonModule } from '@angular/material/button';
-
-@NgModule({
- imports: [
- CommonModule,
- FlexLayoutModule,
- MatDividerModule,
- MatGridListModule,
- MatIconModule,
- MatTabsModule,
- MatButtonModule,
- MatInputModule,
- MatFormFieldModule,
- FormsModule,
- ColorPickerModule,
- RouterModule.forChild([
- {
- path: '',
- component: AppAssetMonitoringComponent,
- },
- ]),
- SharedUiModule,
- ],
- declarations: [
- AppAssetMonitoringComponent,
- CreateAssetComponent,
- ViewAssetComponent,
- AddLinkDialogComponent,
- AddPipelineDialogComponent,
- SaveDashboardDialogComponent,
- AssetDashboardOverviewComponent,
- ],
- providers: [],
- exports: [AppAssetMonitoringComponent],
-})
-export class AppAssetMonitoringModule {}
diff --git a/ui/src/app/app-asset-monitoring/app-asset-monitoring.routes.ts
b/ui/src/app/app-asset-monitoring/app-asset-monitoring.routes.ts
deleted file mode 100644
index 16d3facbb7..0000000000
--- a/ui/src/app/app-asset-monitoring/app-asset-monitoring.routes.ts
+++ /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.
- *
- */
-
-import { SpBreadcrumbItem } from '@streampipes/shared-ui';
-import { SpAppRoutes } from '../app-overview/apps.routes';
-
-export class SpAppAssetMonitoringRoutes {
- static BASE: SpBreadcrumbItem = {
- label: 'Asset Monitoring',
- link: [SpAppRoutes.APP_BASE_LINK, 'asset-monitoring'],
- };
-}
diff --git
a/ui/src/app/app-asset-monitoring/components/create-asset/create-asset.component.html
b/ui/src/app/app-asset-monitoring/components/create-asset/create-asset.component.html
deleted file mode 100644
index d5654571d5..0000000000
---
a/ui/src/app/app-asset-monitoring/components/create-asset/create-asset.component.html
+++ /dev/null
@@ -1,87 +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 fxLayout="column" fxFlex="100">
- <input
- type="file"
- (change)="handleFileInput($event)"
- accept="image/*"
- #file
- style="display: none"
- />
- <div class="sp-tab-bg sp-blue-bg page-container-nav">
- <div fxLayout="row" fxFlex="100" fxLayoutAlign="start center">
- <div>
- <button
- color="accent"
- class="mat-basic"
- mat-button
- (click)="prepareDashboard()"
- type="submit"
- [disabled]="!backgroundImagePresent || !measurementPresent"
- >
- <mat-icon>save</mat-icon> Save
- </button>
- </div>
- <div>
- <button
- color="accent"
- mat-button
- (click)="file.click()"
- type="submit"
- [disabled]="backgroundImagePresent"
- >
- <mat-icon>file_upload</mat-icon> <span>Add
image</span>
- </button>
- </div>
- <div>
- <button
- color="accent"
- mat-button
- (click)="openAddPipelineDialog()"
- >
- <mat-icon>add</mat-icon> Add value
- </button>
- </div>
- <div>
- <button color="accent" mat-button
(click)="openAddLinkDialog()">
- <span fxLayoutAlign="start center"
- ><i class="material-icons">link</i> Add link</span
- >
- </button>
- </div>
- <div fxFlex fxLayout="row" fxLayoutAlign="end center">
- <button
- color="accent"
- mat-icon-button
- (click)="clearCanvas()"
- matTooltip="Clear"
- >
- <i class="material-icons"> clear </i>
- </button>
- </div>
- </div>
- </div>
- <div id="outerAssemblyArea" class="asset-configuration-board-panel">
- <div
- id="asset-configuration-board-canvas"
- class="asset-configuration-board-canvas"
- fxLayoutAlign="center center"
- ></div>
- </div>
-</div>
diff --git
a/ui/src/app/app-asset-monitoring/components/create-asset/create-asset.component.scss
b/ui/src/app/app-asset-monitoring/components/create-asset/create-asset.component.scss
deleted file mode 100644
index 457e5201c8..0000000000
---
a/ui/src/app/app-asset-monitoring/components/create-asset/create-asset.component.scss
+++ /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.
- *
- */
-
-.asset-configuration-board-panel {
- min-height: calc(100vh - 70px);
-}
-
-.asset-configuration-board-canvas {
- width: 1400px;
- height: 900px;
- border: 2px solid rgb(27, 20, 100);
- margin: 20px auto;
- background: white;
-}
diff --git
a/ui/src/app/app-asset-monitoring/components/create-asset/create-asset.component.ts
b/ui/src/app/app-asset-monitoring/components/create-asset/create-asset.component.ts
deleted file mode 100644
index e3d1569bb6..0000000000
---
a/ui/src/app/app-asset-monitoring/components/create-asset/create-asset.component.ts
+++ /dev/null
@@ -1,340 +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 {
- AfterViewInit,
- Component,
- EventEmitter,
- HostListener,
- Input,
- Output,
-} from '@angular/core';
-import Konva from 'konva';
-import { AddPipelineDialogComponent } from
'../../dialog/add-pipeline/add-pipeline-dialog.component';
-import { MatDialog } from '@angular/material/dialog';
-import { ShapeService } from '../../services/shape.service';
-import { SaveDashboardDialogComponent } from
'../../dialog/save-dashboard/save-dashboard-dialog.component';
-import { PanelType, DialogService } from '@streampipes/shared-ui';
-import { DashboardConfiguration } from
'../../model/dashboard-configuration.model';
-import { RestService } from '../../services/rest.service';
-import { AddLinkDialogComponent } from
'../../dialog/add-link/add-link-dialog.component';
-import { IdGeneratorService } from
'../../../core-services/id-generator/id-generator.service';
-
-interface Window {
- Image: any;
-}
-
-declare const window: Window;
-
-@Component({
- selector: 'sp-create-asset',
- templateUrl: './create-asset.component.html',
- styleUrls: ['./create-asset.component.scss'],
-})
-export class CreateAssetComponent implements AfterViewInit {
- fileName: any;
- selectedUploadFile: File;
-
- mainCanvasStage: Konva.Stage;
- backgroundImageLayer: any;
- mainLayer: any;
-
- currentlySelectedShape: any;
-
- IMAGE_ID = 'main-image';
-
- backgroundImagePresent = false;
- measurementPresent = false;
- editMode = false;
-
- @Input()
- dashboardConfig: DashboardConfiguration;
-
- @Output() dashboardClosed = new EventEmitter<boolean>();
-
- keyboardListenerActive = true;
-
- constructor(
- public dialog: MatDialog,
- public shapeService: ShapeService,
- private dialogService: DialogService,
- private restService: RestService,
- private idGeneratorService: IdGeneratorService,
- ) {}
-
- ngAfterViewInit() {
- const width = 1400;
- const height = 900;
- if (!this.dashboardConfig) {
- this.mainCanvasStage = new Konva.Stage({
- container: 'asset-configuration-board-canvas',
- width,
- height,
- });
- this.initLayers();
- } else {
- this.editMode = true;
- this.makeEditable();
- this.mainCanvasStage = Konva.Node.create(
- this.dashboardConfig,
- 'asset-configuration-board-canvas',
- );
- this.mainCanvasStage.draw();
-
- this.backgroundImageLayer = this.mainCanvasStage.children[0];
- this.mainLayer = this.mainCanvasStage.children[1];
- const groups = this.mainLayer.getChildren().find('Group');
- groups.forEach(g => {
- const id = this.idGeneratorService.generate(6);
- g.id(id);
- g.setDraggable(true);
- this.addTransformerToShape(id, g);
- });
- this.makeClickable();
- this.showImage();
- this.backgroundImageLayer.moveToBottom();
- this.mainCanvasStage.draw();
- this.measurementPresent = true;
- }
-
- const container = this.mainCanvasStage.container();
- container.focus();
- }
-
- makeEditable() {
- this.dashboardConfig.imageInfo.draggable = true;
- this.dashboardConfig.imageInfo.id = this.IMAGE_ID;
- }
-
- initLayers() {
- this.mainLayer = new Konva.Layer();
- this.backgroundImageLayer = new Konva.Layer();
-
- this.makeClickable();
- this.mainCanvasStage.add(this.backgroundImageLayer);
- this.mainCanvasStage.add(this.mainLayer);
- }
-
- makeClickable() {
- this.backgroundImageLayer.on('click', evt => {
- this.currentlySelectedShape = evt.target;
- });
- this.mainLayer.on('click', evt => {
- let parentElement = evt.target.getParent();
- while (!parentElement.id()) {
- parentElement = parentElement.getParent();
- }
- this.currentlySelectedShape = parentElement;
- });
- }
-
- handleFileInput(event: any) {
- const files: any = event.target.files;
- this.selectedUploadFile = files[0];
- this.fileName = this.selectedUploadFile.name;
-
- const image = new window.Image();
- image.onload = () => {
- const desiredWidth = Math.min(
- this.mainCanvasStage.width(),
- image.width,
- );
- const aspectRatio = image.width / image.height;
- const desiredHeight =
- image.width > image.height
- ? desiredWidth / aspectRatio
- : desiredWidth * aspectRatio;
- const imageCanvas = new Konva.Image({
- image,
- width: desiredWidth,
- height: desiredHeight,
- x: 0,
- y: 0,
- draggable: true,
- id: this.IMAGE_ID,
- });
-
- this.addImageTransformer(imageCanvas);
- this.currentlySelectedShape = imageCanvas;
- };
-
- const reader = new FileReader();
- reader.onload = e => (image.src = reader.result);
-
- reader.readAsDataURL(this.selectedUploadFile);
- event.target.value = null;
- }
-
- addImageTransformer(imageCanvas: any) {
- this.backgroundImageLayer.add(imageCanvas);
- this.backgroundImageLayer.draw();
-
- const tr = this.getNewTransformer(this.IMAGE_ID);
- this.backgroundImageLayer.add(tr);
- tr.attachTo(imageCanvas);
- this.backgroundImageLayer.moveToBottom();
- this.backgroundImageLayer.draw();
- this.backgroundImagePresent = true;
- }
-
- prepareDashboard() {
- const dialogRef = this.dialogService.open(
- SaveDashboardDialogComponent,
- {
- panelType: PanelType.SLIDE_IN_PANEL,
- title: 'Save asset dashboard',
- width: '50vw',
- data: {
- dashboardCanvas: this.mainCanvasStage as any,
- file: this.selectedUploadFile,
- editMode: this.editMode,
- dashboardConfig: this.dashboardConfig,
- },
- },
- );
- dialogRef.afterClosed().subscribe(closed => {
- this.dashboardClosed.emit(true);
- });
- }
-
- clearCanvas() {
- this.backgroundImageLayer.destroy();
- this.mainLayer.destroy();
- this.initLayers();
- this.backgroundImagePresent = false;
- this.measurementPresent = false;
- }
-
- openAddPipelineDialog(): void {
- this.keyboardListenerActive = false;
- const dialogRef = this.dialogService.open(AddPipelineDialogComponent, {
- panelType: PanelType.SLIDE_IN_PANEL,
- title: 'Add visualization',
- width: '50vw',
- data: {},
- });
-
- dialogRef.afterClosed().subscribe(result => {
- if (result) {
- const visGroup =
- this.shapeService.makeNewMeasurementShape(result);
- this.addNewVisulizationItem(visGroup);
- this.measurementPresent = true;
- this.mainLayer.draw();
- }
- this.keyboardListenerActive = true;
- });
- }
-
- openAddLinkDialog() {
- this.keyboardListenerActive = false;
- const dialogRef = this.dialogService.open(AddLinkDialogComponent, {
- panelType: PanelType.SLIDE_IN_PANEL,
- title: 'Add link',
- width: '50vw',
- data: {},
- });
-
- dialogRef.afterClosed().subscribe(result => {
- if (result) {
- console.log(result);
- this.addNewVisulizationItem(result);
- }
- this.keyboardListenerActive = true;
- });
- }
-
- @HostListener('document:keydown', ['$event'])
- handleKeyboardEvent(event: KeyboardEvent) {
- if (this.keyboardListenerActive) {
- const delta = 4;
- if (event.code === 'Delete') {
- const id = this.currentlySelectedShape.id();
- this.mainCanvasStage
- .findOne('#' + id + '-transformer')
- .destroy();
- this.currentlySelectedShape.destroy();
- if (id === this.IMAGE_ID) {
- this.backgroundImagePresent = false;
- } else {
- const remainingElementIds = this.mainLayer.find('Group');
- if (remainingElementIds.length === 0) {
- this.measurementPresent = false;
- }
- }
- } else if (event.code === 'ArrowLeft') {
- this.currentlySelectedShape.x(
- this.currentlySelectedShape.x() - delta,
- );
- } else if (event.code === 'ArrowRight') {
- this.currentlySelectedShape.x(
- this.currentlySelectedShape.x() + delta,
- );
- } else if (event.code === 'ArrowDown') {
- this.currentlySelectedShape.y(
- this.currentlySelectedShape.y() + delta,
- );
- } else if (event.code === 'ArrowUp') {
- this.currentlySelectedShape.y(
- this.currentlySelectedShape.y() - delta,
- );
- }
- this.backgroundImageLayer.draw();
- this.mainLayer.draw();
- }
- }
-
- addNewVisulizationItem(visGroup) {
- const id = this.idGeneratorService.generate(6);
- visGroup.id(id);
- this.mainLayer.add(visGroup);
- this.addTransformerToShape(id, visGroup);
- }
-
- addTransformerToShape(id: string, visGroup: any) {
- const tr = this.getNewTransformer(id);
- this.mainLayer.add(tr);
- tr.attachTo(visGroup);
- this.mainLayer.draw();
- this.currentlySelectedShape = visGroup;
- }
-
- getNewTransformer(id: string): Konva.Transformer {
- return new Konva.Transformer({
- anchorStroke: 'white',
- anchorFill: '#39B54A',
- anchorSize: 10,
- borderStroke: 'green',
- borderDash: [3, 3],
- keepRatio: true,
- id: id + '-transformer',
- });
- }
-
- showImage() {
- const image = new window.Image();
- image.src = this.restService.getImageUrl(
- this.dashboardConfig.imageInfo.imageName,
- );
- this.dashboardConfig.imageInfo.image = image;
- image.onload = () => {
- const imageCanvas = new
Konva.Image(this.dashboardConfig.imageInfo);
- this.addImageTransformer(imageCanvas);
- };
- }
-}
diff --git
a/ui/src/app/app-asset-monitoring/components/dashboard-overview/dashboard-overview.component.html
b/ui/src/app/app-asset-monitoring/components/dashboard-overview/dashboard-overview.component.html
deleted file mode 100644
index 6724e0a4df..0000000000
---
a/ui/src/app/app-asset-monitoring/components/dashboard-overview/dashboard-overview.component.html
+++ /dev/null
@@ -1,83 +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 fxFlex="100" fxLayout="column" class="page-container-padding-inner">
- <h1>Asset Dashboards</h1>
- <mat-grid-list
- [cols]="3"
- [rowHeight]="500"
- [gutterSize]="10"
- fxFlex="100"
- *ngIf="dashboardConfigs.length > 0"
- >
- <mat-grid-tile
- class="gray"
- *ngFor="let dashboardConfig of dashboardConfigs"
- >
- <mat-card class="example-card">
- <mat-card-header>
- <mat-card-title>
- {{ dashboardConfig.dashboardName }}</mat-card-title
- >
- <mat-card-subtitle>{{
- dashboardConfig.dashboardDescription
- }}</mat-card-subtitle>
- </mat-card-header>
- <img mat-card-image [src]="getImageUrl(dashboardConfig)" />
- <mat-card-content>
- <p></p>
- </mat-card-content>
- <mat-card-actions>
- <button
- mat-button
- mat-raised-button
- color="accent"
- (click)="openDashboard(dashboardConfig)"
- >
- Open Dashboard
- </button>
- <button
- mat-button
- mat-raised-button
- class="mat-basic"
- (click)="deleteDashboard(dashboardConfig.dashboardId)"
- >
- Delete
- </button>
- </mat-card-actions>
- </mat-card>
- </mat-grid-tile>
- </mat-grid-list>
- <div
- *ngIf="dashboardConfigs.length === 0"
- fxLayoutAlign="center center"
- fxFlex="100"
- fxLayout="column"
- >
- <h4>No asset dashboards available</h4>
- <button
- mat-button
- mat-raised-button
- color="accent"
- style="margin-top: 10px"
- (click)="createDashboard.emit()"
- >
- Create new
- </button>
- </div>
-</div>
diff --git
a/ui/src/app/app-asset-monitoring/components/dashboard-overview/dashboard-overview.component.scss
b/ui/src/app/app-asset-monitoring/components/dashboard-overview/dashboard-overview.component.scss
deleted file mode 100644
index 39527e95b7..0000000000
---
a/ui/src/app/app-asset-monitoring/components/dashboard-overview/dashboard-overview.component.scss
+++ /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.
- *
- */
-
-.example-card {
- max-width: 400px;
-}
-
-mat-card {
- box-shadow:
- 0 2px 1px -1px rgba(0, 0, 0, 0.2),
- 0 1px 1px 0 rgba(0, 0, 0, 0.14),
- 0 1px 3px 0 rgba(0, 0, 0, 0.12);
- margin: 10px;
-}
diff --git
a/ui/src/app/app-asset-monitoring/components/dashboard-overview/dashboard-overview.component.ts
b/ui/src/app/app-asset-monitoring/components/dashboard-overview/dashboard-overview.component.ts
deleted file mode 100644
index 7f7748e946..0000000000
---
a/ui/src/app/app-asset-monitoring/components/dashboard-overview/dashboard-overview.component.ts
+++ /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.
- *
- */
-
-import { Component, EventEmitter, OnInit, Output } from '@angular/core';
-import { RestService } from '../../services/rest.service';
-import { DashboardConfiguration } from
'../../model/dashboard-configuration.model';
-
-@Component({
- selector: 'sp-asset-dashboard-overview',
- templateUrl: './dashboard-overview.component.html',
- styleUrls: ['./dashboard-overview.component.scss'],
-})
-export class AssetDashboardOverviewComponent implements OnInit {
- @Output() selectedDashboard = new EventEmitter<DashboardConfiguration>();
- @Output() createDashboard = new EventEmitter<void>();
-
- dashboardConfigs: DashboardConfiguration[] = [];
-
- constructor(private restService: RestService) {}
-
- ngOnInit() {
- this.getDashboards();
- }
-
- getImageUrl(dashboardConfig: DashboardConfiguration) {
- return this.restService.getImageUrl(
- dashboardConfig.imageInfo.imageName,
- );
- }
-
- getDashboards() {
- this.restService.getDashboards().subscribe(response => {
- this.dashboardConfigs = response;
- });
- }
-
- openDashboard(dashboardConfig: DashboardConfiguration) {
- this.selectedDashboard.emit(dashboardConfig);
- }
-
- deleteDashboard(dashboardId: string) {
- this.restService.deleteDashboard(dashboardId).subscribe(response => {
- this.getDashboards();
- });
- }
-}
diff --git
a/ui/src/app/app-asset-monitoring/components/view-asset/view-asset.component.html
b/ui/src/app/app-asset-monitoring/components/view-asset/view-asset.component.html
deleted file mode 100644
index e9187a6c3b..0000000000
---
a/ui/src/app/app-asset-monitoring/components/view-asset/view-asset.component.html
+++ /dev/null
@@ -1,45 +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 fxFlex="100" fxLayout="column" class="page-container-padding-inner">
- <div fxLayout="row">
- <div fxLayout="fill">
- <h1>{{ dashboardConfig.dashboardName }}</h1>
- </div>
- <div fxFlex="100" fxLayout="row" fxLayoutAlign="end center">
- <button
- mat-button
- mat-raised-button
- color="accent"
- (click)="editDashboard()"
- class="mr-10"
- >
- Edit dashboard
- </button>
- <button
- mat-button
- mat-raised-button
- class="mat-basic"
- (click)="closeDashboard()"
- >
- Close dashboard
- </button>
- </div>
- </div>
- <div id="container" class="asset-view-canvas"></div>
-</div>
diff --git
a/ui/src/app/app-asset-monitoring/components/view-asset/view-asset.component.scss
b/ui/src/app/app-asset-monitoring/components/view-asset/view-asset.component.scss
deleted file mode 100644
index 39b9d68bb7..0000000000
---
a/ui/src/app/app-asset-monitoring/components/view-asset/view-asset.component.scss
+++ /dev/null
@@ -1,28 +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.
- *
- */
-
-.asset-view-canvas {
- width: 1400px;
- height: 900px;
- border: 2px solid rgb(27, 20, 100);
- margin: 20px auto;
-}
-
-.mr-10 {
- margin-right: 10px;
-}
diff --git
a/ui/src/app/app-asset-monitoring/components/view-asset/view-asset.component.ts
b/ui/src/app/app-asset-monitoring/components/view-asset/view-asset.component.ts
deleted file mode 100644
index cd67c268b6..0000000000
---
a/ui/src/app/app-asset-monitoring/components/view-asset/view-asset.component.ts
+++ /dev/null
@@ -1,179 +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 {
- AfterViewInit,
- Component,
- EventEmitter,
- Input,
- OnDestroy,
- Output,
-} from '@angular/core';
-
-import Konva from 'konva';
-import { DashboardConfiguration } from
'../../model/dashboard-configuration.model';
-import { RestService } from '../../services/rest.service';
-import {
- DatalakeQueryParameterBuilder,
- DatalakeRestService,
- SpQueryResult,
- DashboardService,
-} from '@streampipes/platform-services';
-import { Subscription, timer } from 'rxjs';
-import { switchMap } from 'rxjs/operators';
-
-interface Window {
- Image: any;
-}
-
-declare const window: Window;
-
-@Component({
- selector: 'sp-view-asset',
- templateUrl: './view-asset.component.html',
- styleUrls: ['./view-asset.component.scss'],
-})
-export class ViewAssetComponent implements AfterViewInit, OnDestroy {
- @Input() dashboardConfig: DashboardConfiguration;
- @Output() dashboardClosed = new EventEmitter<boolean>();
- @Output() editDashboardEmitter = new
EventEmitter<DashboardConfiguration>();
-
- mainCanvasStage: any;
- mainLayer: any;
- backgroundImageLayer: any;
-
- subscriptions: Subscription[] = [];
-
- constructor(
- private restService: RestService,
- private dashboardService: DashboardService,
- private dataLakeRestService: DatalakeRestService,
- ) {}
-
- ngAfterViewInit() {
- this.mainCanvasStage = Konva.Node.create(
- this.dashboardConfig,
- 'container',
- );
- this.mainCanvasStage.draw();
-
- this.backgroundImageLayer = new Konva.Layer();
- this.showImage();
- this.mainCanvasStage.add(this.backgroundImageLayer);
- const labels = this.mainCanvasStage.find('Label');
- labels.each(label => {
- label.on('mouseenter', () => this.onMouseEnter(label));
- label.on('mouseleave', () => this.onMouseLeave(label));
- label.on('click', () => this.onLinkClicked(label));
- });
-
- this.backgroundImageLayer.moveToBottom();
- this.mainCanvasStage.draw();
- this.updateMeasurements();
- }
-
- onMouseEnter(label) {
- label.children[0].attrs.fontStyle = 'bold';
- this.mainCanvasStage.draw();
- }
-
- onMouseLeave(label) {
- label.children[0].attrs.fontStyle = 'normal';
- this.mainCanvasStage.draw();
- }
-
- onLinkClicked(label) {
- const href = label.children[0].attrs.hyperlink;
- const newWindow = label.children[0].attrs.newWindow;
- newWindow
- ? (window as any).open(href)
- : ((window as any).location.href = href);
- }
-
- updateMeasurements() {
- const dynamicShapes = this.mainCanvasStage.find('.dynamic-text');
- dynamicShapes.forEach(ds => {
- const monitoredField = ds.text();
- const measurement = ds.attrs.dataLakeMeasure;
- const subscription = timer(0, 2000)
- .pipe(
- switchMap(() =>
- this.dataLakeRestService.getData(
- measurement,
- this.buildQuery(),
- ),
- ),
- )
- .subscribe(queryResult => {
- this.handleResponse(ds, monitoredField, queryResult);
- });
- this.subscriptions.push(subscription);
- });
- }
-
- handleResponse(
- ds: any,
- monitoredField: string,
- queryResult: SpQueryResult,
- ): void {
- if (queryResult.total > 0) {
- if (queryResult.allDataSeries.length === 1) {
- const series = queryResult.allDataSeries[0];
- if (series.rows.length > 0) {
- const row = series.rows[0];
- const event = {};
- series.headers.forEach((fieldName, index) => {
- event[fieldName] = row[index];
- });
- ds.text(event[monitoredField]);
- this.mainCanvasStage.draw();
- }
- }
- }
- }
-
- buildQuery() {
- const queryBuilder = DatalakeQueryParameterBuilder.create();
- return queryBuilder.withLimit(1).withOrdering('DESC').build();
- }
-
- showImage() {
- const image = new window.Image();
- image.src = this.restService.getImageUrl(
- this.dashboardConfig.imageInfo.imageName,
- );
- this.dashboardConfig.imageInfo.image = image;
- image.onload = () => {
- const imageCanvas = new
Konva.Image(this.dashboardConfig.imageInfo);
- this.backgroundImageLayer.add(imageCanvas);
- this.backgroundImageLayer.draw();
- };
- }
-
- closeDashboard() {
- this.dashboardClosed.emit(true);
- }
-
- editDashboard() {
- this.editDashboardEmitter.emit(this.dashboardConfig);
- }
-
- ngOnDestroy(): void {
- this.subscriptions.forEach(s => s.unsubscribe());
- }
-}
diff --git
a/ui/src/app/app-asset-monitoring/dialog/add-link/add-link-dialog.component.html
b/ui/src/app/app-asset-monitoring/dialog/add-link/add-link-dialog.component.html
deleted file mode 100644
index b2a3919fb7..0000000000
---
a/ui/src/app/app-asset-monitoring/dialog/add-link/add-link-dialog.component.html
+++ /dev/null
@@ -1,73 +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="sp-dialog-container">
- <div class="sp-dialog-content p-15">
- <div fxFlex="100" fxLayout="column">
- <h4>New link</h4>
- <div class="dialog-margin-bottom" fxLayout="column">
- <mat-form-field class="dialog-margin-bottom" color="accent">
- <mat-label>Label</mat-label>
- <input
- matInput
- placeholder="Label"
- [(ngModel)]="linkLabel"
- />
- <mat-hint
- >The label that should be displayed as link</mat-hint
- >
- </mat-form-field>
- <mat-form-field color="accent">
- <mat-label>Target</mat-label>
- <input
- matInput
- placeholder="Label"
- [(ngModel)]="linkHref"
- />
- <mat-hint>The target URL of the link</mat-hint>
- </mat-form-field>
- <mat-form-field color="accent">
- <mat-label>Font Size</mat-label>
- <input
- matInput
- placeholder="Label"
- [(ngModel)]="labelFontSize"
- />
- <mat-hint>Font Size</mat-hint>
- </mat-form-field>
- <mat-checkbox [(ngModel)]="newWindow"
- >Open in new window</mat-checkbox
- >
- </div>
- </div>
- </div>
- <mat-divider></mat-divider>
- <div class="sp-dialog-actions">
- <button
- mat-button
- mat-raised-button
- class="mat-basic mr-10"
- (click)="cancel()"
- >
- Cancel
- </button>
- <button mat-button mat-raised-button color="accent" (click)="add()">
- Add
- </button>
- </div>
-</div>
diff --git
a/ui/src/app/app-asset-monitoring/dialog/add-link/add-link-dialog.component.scss
b/ui/src/app/app-asset-monitoring/dialog/add-link/add-link-dialog.component.scss
deleted file mode 100644
index 0a5104be4d..0000000000
---
a/ui/src/app/app-asset-monitoring/dialog/add-link/add-link-dialog.component.scss
+++ /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.
- *
- */
-
-@import '../../../../scss/sp/sp-dialog.scss';
-
-.mr-10 {
- margin-right: 10px;
-}
diff --git
a/ui/src/app/app-asset-monitoring/dialog/add-link/add-link-dialog.component.ts
b/ui/src/app/app-asset-monitoring/dialog/add-link/add-link-dialog.component.ts
deleted file mode 100644
index 9dc2b03427..0000000000
---
a/ui/src/app/app-asset-monitoring/dialog/add-link/add-link-dialog.component.ts
+++ /dev/null
@@ -1,55 +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 { Component } from '@angular/core';
-import { DialogRef } from '@streampipes/shared-ui';
-import { ShapeService } from '../../services/shape.service';
-import { HyperlinkConfig } from
'../../model/selected-visualization-data.model';
-
-@Component({
- selector: 'sp-add-link-dialog-component',
- templateUrl: 'add-link-dialog.component.html',
- styleUrls: ['./add-link-dialog.component.scss'],
-})
-export class AddLinkDialogComponent {
- linkLabel: string;
- linkHref: string;
- labelFontSize = 12;
- newWindow = false;
-
- constructor(
- private dialogRef: DialogRef<AddLinkDialogComponent>,
- private shapeService: ShapeService,
- ) {}
-
- cancel() {
- this.dialogRef.close();
- }
-
- add() {
- const hyperlinkConfig: HyperlinkConfig = {
- linkLabel: this.linkLabel,
- linkHref: this.linkHref,
- labelFontSize: this.labelFontSize,
- newWindow: this.newWindow,
- };
-
- const group = this.shapeService.makeNewHyperlinkGroup(hyperlinkConfig);
- this.dialogRef.close(group);
- }
-}
diff --git
a/ui/src/app/app-asset-monitoring/dialog/add-pipeline/add-pipeline-dialog.component.html
b/ui/src/app/app-asset-monitoring/dialog/add-pipeline/add-pipeline-dialog.component.html
deleted file mode 100644
index 5aef9519e6..0000000000
---
a/ui/src/app/app-asset-monitoring/dialog/add-pipeline/add-pipeline-dialog.component.html
+++ /dev/null
@@ -1,164 +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="sp-dialog-container">
- <div class="sp-dialog-content p-15">
- <div fxFlex="100">
- <div fxFlex="100" style="margin: 5px; width: 100%">
- <div *ngIf="page === 'select-pipeline'">
- <div *ngIf="page === 'select-pipeline'">
- <h4>{{ pages[0].description }}</h4>
- <mat-list>
- <mat-list-item
- *ngFor="let pipeline of visualizablePipelines"
- (click)="selectPipeline(pipeline)"
- class="list-item"
- >
- <div
- matListItemAvatar
- class="pipeline-avatar sp-accent-bg"
- >
- {{ iconText(pipeline.pipelineName) }}
- </div>
- <span matListItemTitle>{{
- pipeline.pipelineName
- }}</span>
- <p matListItemLine>
- {{ pipeline.measureName }}
- </p>
- </mat-list-item>
- </mat-list>
- </div>
- </div>
-
- <!-- Select Type -->
- <div *ngIf="page === 'select-measurement'" fxLayout="column">
- <h4>{{ pages[1].description }}</h4>
- <div fxFlex="100" fxLayout="column">
- <mat-radio-group
- fxLayout="column"
- class="example-radio-group"
- [(ngModel)]="selectedMeasurement"
- >
- <mat-radio-button
- class="example-radio-button"
- *ngFor="
- let prop of selectedVisualization
- .eventSchema.eventProperties
- "
- [value]="prop.runtimeName"
- >
- {{ prop.runtimeName }}
- </mat-radio-button>
- </mat-radio-group>
- </div>
- </div>
-
- <!-- Select Scheme -->
- <div *ngIf="page === 'select-label'" fxLayout="column">
- <b
- ><h4>{{ pages[2].description }}</h4></b
- >
- <div fxFlex="100" fxLayout="column">
- <mat-form-field
- style="margin-bottom: 10px"
- color="accent"
- >
- <mat-label>Label</mat-label>
- <input
- matInput
- placeholder="Label"
- [(ngModel)]="selectedLabel"
- value="Label"
- />
- <mat-hint
- >Enter the label that will identify the
- measurement</mat-hint
- >
- </mat-form-field>
- <div fxLayout="row" class="element-margin">
- <mat-label fxFlex="50"
- >Label Background Color</mat-label
- >
- <input
- [(colorPicker)]="selectedLabelBackgroundColor"
- [style.background]="
- selectedLabelBackgroundColor
- "
- />
- </div>
- <div fxLayout="row" class="element-margin">
- <mat-label fxFlex="50">Label Text Color</mat-label>
- <input
- [(colorPicker)]="selectedLabelTextColor"
- [style.background]="selectedLabelTextColor"
- />
- </div>
- <div fxLayout="row" class="element-margin">
- <mat-label fxFlex="50"
- >Measurement Value Background Color</mat-label
- >
- <input
- [(colorPicker)]="
- selectedMeasurementBackgroundColor
- "
- [style.background]="
- selectedMeasurementBackgroundColor
- "
- />
- </div>
- <div fxLayout="row" class="element-margin">
- <mat-label fxFlex="50"
- >Measurement Value Text Color</mat-label
- >
- <input
- [(colorPicker)]="selectedMeasurementTextColor"
- [style.background]="
- selectedMeasurementTextColor
- "
- />
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <mat-divider></mat-divider>
- <div class="sp-dialog-actions">
- <button
- mat-button
- mat-raised-button
- class="mat-basic mr-10"
- (click)="onCancel()"
- >
- Cancel
- </button>
- <button
- mat-button
- mat-raised-button
- class="mat-basic mr-10"
- (click)="back()"
- *ngIf="!('select-pipeline' === page)"
- >
- Back
- </button>
- <button mat-button mat-raised-button color="accent" (click)="next()">
- Next
- </button>
- </div>
-</div>
diff --git
a/ui/src/app/app-asset-monitoring/dialog/add-pipeline/add-pipeline-dialog.component.scss
b/ui/src/app/app-asset-monitoring/dialog/add-pipeline/add-pipeline-dialog.component.scss
deleted file mode 100644
index cdf80f50ad..0000000000
---
a/ui/src/app/app-asset-monitoring/dialog/add-pipeline/add-pipeline-dialog.component.scss
+++ /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.
- *
- */
-
-@import '../../../../scss/sp/sp-dialog.scss';
-
-.element-margin {
- margin-top: 10px;
- margin-bottom: 10px;
-}
-
-.mat-radio-button {
- padding: 10px;
-}
-
-.mat-radio-button {
- padding: 10px;
-}
-
-.pipeline-avatar {
- align-items: center;
- justify-content: center;
- display: flex;
- color: white;
-}
-
-.list-item:hover {
- background: var(--color-bg-1);
- cursor: pointer;
-}
-
-.list-item {
- border-bottom: 1px solid #bdbdbd;
-}
-
-.mr-10 {
- margin-right: 10px;
-}
diff --git
a/ui/src/app/app-asset-monitoring/dialog/add-pipeline/add-pipeline-dialog.component.ts
b/ui/src/app/app-asset-monitoring/dialog/add-pipeline/add-pipeline-dialog.component.ts
deleted file mode 100644
index a1508555e2..0000000000
---
a/ui/src/app/app-asset-monitoring/dialog/add-pipeline/add-pipeline-dialog.component.ts
+++ /dev/null
@@ -1,168 +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 { Component, OnInit } from '@angular/core';
-import { RestApi } from '../../../services/rest-api.service';
-import { RestService } from '../../services/rest.service';
-import { ElementIconText } from
'../../../services/get-element-icon-text.service';
-import { SelectedVisualizationData } from
'../../model/selected-visualization-data.model';
-import { DialogRef } from '@streampipes/shared-ui';
-import {
- DataLakeMeasure,
- DatalakeRestService,
- DataViewDataExplorerService,
-} from '@streampipes/platform-services';
-import { zip } from 'rxjs';
-
-@Component({
- selector: 'sp-add-pipeline-dialog-component',
- templateUrl: './add-pipeline-dialog.component.html',
- styleUrls: ['./add-pipeline-dialog.component.scss'],
-})
-export class AddPipelineDialogComponent implements OnInit {
- pages = [
- {
- type: 'select-pipeline',
- title: 'Select Pipeline',
- description: "Select a pipeline you'd like to visualize",
- },
- {
- type: 'select-measurement',
- title: 'Measurement Value',
- description: 'Select measurement',
- },
- {
- type: 'select-label',
- title: 'Label',
- description: 'Choose label',
- },
- ];
-
- visualizablePipelines: DataLakeMeasure[] = [];
-
- selectedVisualization: DataLakeMeasure;
- selectedType: any;
- selectedMeasurement: any;
- page: any = 'select-pipeline';
-
- selectedLabelBackgroundColor = '#FFFFFF';
- selectedLabelTextColor = '#1B1464';
- selectedMeasurementBackgroundColor = '#39B54A';
- selectedMeasurementTextColor = '#FFFFFF';
- selectedLabel: string;
-
- constructor(
- private dialogRef: DialogRef<AddPipelineDialogComponent>,
- private restApi: RestApi,
- private restService: RestService,
- private dataLakeRestService: DatalakeRestService,
- private dataExplorerService: DataViewDataExplorerService,
- public elementIconText: ElementIconText,
- ) {}
-
- ngOnInit() {
- this.loadVisualizablePipelines();
- }
-
- loadVisualizablePipelines() {
- zip(
- this.dataExplorerService.getAllPersistedDataStreams(),
- this.dataLakeRestService.getAllMeasurementSeries(),
- ).subscribe(res => {
- const visualizablePipelines = res[0];
- visualizablePipelines.forEach(p => {
- const measurement = res[1].find(m => {
- return m.measureName === p.measureName;
- });
- p.eventSchema = measurement.eventSchema;
- });
- this.visualizablePipelines = visualizablePipelines;
- });
- }
-
- onCancel(): void {
- this.dialogRef.close();
- }
-
- getSelectedPipelineCss(vis) {
- return this.getSelectedCss(this.selectedVisualization, 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';
- }
- }
-
- selectPipeline(vis) {
- this.selectedVisualization = vis;
- this.next();
- }
-
- next() {
- if (this.page === 'select-pipeline') {
- this.page = 'select-measurement';
- } else if (this.page === 'select-measurement') {
- this.page = 'select-label';
- } else {
- const selectedConfig: SelectedVisualizationData =
- {} as SelectedVisualizationData;
- selectedConfig.labelBackgroundColor =
- this.selectedLabelBackgroundColor;
- selectedConfig.labelTextColor = this.selectedLabelTextColor;
- selectedConfig.measurementBackgroundColor =
- this.selectedMeasurementBackgroundColor;
- selectedConfig.measurementTextColor =
- this.selectedMeasurementTextColor;
- selectedConfig.measurement = this.selectedMeasurement;
- selectedConfig.visualizationId =
- this.selectedVisualization.pipelineId;
- selectedConfig.label = this.selectedLabel;
- selectedConfig.dataLakeMeasure =
- this.selectedVisualization.measureName;
-
- this.dialogRef.close(selectedConfig);
- }
- }
-
- back() {
- if (this.page === 'select-measurement') {
- this.page = 'select-pipeline';
- } else if (this.page === 'select-label') {
- this.page = 'select-measurement';
- }
- }
-
- iconText(s) {
- return this.elementIconText.getElementIconText(s);
- }
-}
diff --git
a/ui/src/app/app-asset-monitoring/dialog/save-dashboard/save-dashboard-dialog.component.html
b/ui/src/app/app-asset-monitoring/dialog/save-dashboard/save-dashboard-dialog.component.html
deleted file mode 100644
index 93d8183005..0000000000
---
a/ui/src/app/app-asset-monitoring/dialog/save-dashboard/save-dashboard-dialog.component.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 class="sp-dialog-container">
- <div class="sp-dialog-content p-15">
- <div fxFlex="100" fxLayout="column">
- <h4>Dashboard Settings</h4>
- <div class="dialog-margin-bottom" fxLayout="column">
- <mat-form-field class="dialog-margin-bottom" color="accent">
- <mat-label>Dashboard Name</mat-label>
- <input
- matInput
- placeholder="Label"
- [(ngModel)]="dashboardName"
- />
- <mat-hint>The name of your new asset dashboard</mat-hint>
- </mat-form-field>
- <mat-form-field color="accent">
- <mat-label>Description</mat-label>
- <input
- matInput
- placeholder="Label"
- [(ngModel)]="dashboardDescription"
- />
- <mat-hint
- >The description of your new asset dashboard</mat-hint
- >
- </mat-form-field>
- </div>
- </div>
- </div>
- <mat-divider></mat-divider>
- <div class="sp-dialog-actions">
- <button
- mat-button
- mat-raised-button
- class="mat-basic mr-10"
- (click)="cancel()"
- >
- Cancel
- </button>
- <button mat-button mat-raised-button color="accent" (click)="save()">
- Save
- </button>
- </div>
-</div>
diff --git
a/ui/src/app/app-asset-monitoring/dialog/save-dashboard/save-dashboard-dialog.component.scss
b/ui/src/app/app-asset-monitoring/dialog/save-dashboard/save-dashboard-dialog.component.scss
deleted file mode 100644
index da2aed864a..0000000000
---
a/ui/src/app/app-asset-monitoring/dialog/save-dashboard/save-dashboard-dialog.component.scss
+++ /dev/null
@@ -1,32 +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 '../../../../scss/sp/sp-dialog.scss';
-
-.element-margin {
- margin-top: 10px;
- margin-bottom: 10px;
-}
-
-.mr-10 {
- margin-right: 10px;
-}
-
-.dialog-margin-bottom {
- margin-bottom: 10px;
-}
diff --git
a/ui/src/app/app-asset-monitoring/dialog/save-dashboard/save-dashboard-dialog.component.ts
b/ui/src/app/app-asset-monitoring/dialog/save-dashboard/save-dashboard-dialog.component.ts
deleted file mode 100644
index 0a4a2cbf10..0000000000
---
a/ui/src/app/app-asset-monitoring/dialog/save-dashboard/save-dashboard-dialog.component.ts
+++ /dev/null
@@ -1,111 +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 { Component, Input, OnInit } from '@angular/core';
-import { RestService } from '../../services/rest.service';
-import { DashboardConfiguration } from
'../../model/dashboard-configuration.model';
-import { ImageInfo } from '../../model/image-info.model';
-import { DialogRef } from '@streampipes/shared-ui';
-import Konva from 'konva';
-import Stage = Konva.Stage;
-
-@Component({
- selector: 'sp-save-dashboard-dialog-component',
- templateUrl: 'save-dashboard-dialog.component.html',
- styleUrls: ['./save-dashboard-dialog.component.scss'],
-})
-export class SaveDashboardDialogComponent implements OnInit {
- dashboardName: string;
- dashboardDescription: string;
-
- @Input()
- dashboardCanvas: Stage;
-
- @Input()
- file: File;
-
- @Input()
- editMode: boolean;
-
- @Input()
- dashboardConfig: DashboardConfiguration;
-
- constructor(
- private dialogRef: DialogRef<SaveDashboardDialogComponent>,
- private restService: RestService,
- ) {}
-
- ngOnInit() {
- if (this.editMode) {
- this.dashboardName = this.dashboardConfig.dashboardName;
- this.dashboardDescription =
- this.dashboardConfig.dashboardDescription;
- }
- }
-
- cancel() {
- this.dialogRef.close();
- }
-
- save() {
- // save image
- if (this.file) {
- this.restService.storeImage(this.file).subscribe(response => {});
- }
-
- // save dashboard
- const imageInfo = this.makeImageInfo();
- const dashboardConfig = this.makeDashboardConfig();
- dashboardConfig.dashboardName = this.dashboardName;
- dashboardConfig.dashboardDescription = this.dashboardDescription;
- dashboardConfig.imageInfo = imageInfo;
- dashboardConfig.imageInfo.draggable = false;
- if (this.file) {
- dashboardConfig.imageInfo.imageName = this.file.name;
- }
-
- if (this.editMode) {
- dashboardConfig.dashboardId = this.dashboardConfig.dashboardId;
- }
-
- const observable = this.editMode
- ? this.restService.updateDashboard(dashboardConfig)
- : this.restService.storeDashboard(dashboardConfig);
- observable.subscribe(response => {
- this.dialogRef.close();
- });
- }
-
- makeImageInfo(): ImageInfo {
- const imageShape = this.dashboardCanvas.findOne('#main-image');
- return imageShape.attrs as ImageInfo;
- }
-
- makeDashboardConfig(): DashboardConfiguration {
- const canvas = this.dashboardCanvas;
- const transformerShapes = Array.from(canvas.find('Transformer'));
- transformerShapes.forEach(shape => {
- shape.destroy();
- });
-
- const mainShape = canvas.findOne('#main-image');
- mainShape.destroy();
-
- return JSON.parse(canvas.toJSON());
- }
-}
diff --git a/ui/src/app/app-asset-monitoring/model/canvas-attributes.model.ts
b/ui/src/app/app-asset-monitoring/model/canvas-attributes.model.ts
deleted file mode 100644
index e65920f769..0000000000
--- a/ui/src/app/app-asset-monitoring/model/canvas-attributes.model.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 interface CanvasAttributes {
- x: number;
- y: number;
- visualizationId: string;
- scaleX: number;
- scaleY: number;
- fill: string;
- id: string;
- text: string;
- width: number;
- height: number;
- rotation: number;
- brokerUrl: string;
- topic: string;
- name: string;
- align: string;
- fontSize: string;
-}
diff --git
a/ui/src/app/app-asset-monitoring/model/canvas-configuration.model.ts
b/ui/src/app/app-asset-monitoring/model/canvas-configuration.model.ts
deleted file mode 100644
index 30ee9ebdc8..0000000000
--- a/ui/src/app/app-asset-monitoring/model/canvas-configuration.model.ts
+++ /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.
- *
- */
-
-import Konva from 'konva';
-
-export interface CanvasConfiguration {
- file: File;
- dashboardCanvas: Konva.Stage;
-}
diff --git a/ui/src/app/app-asset-monitoring/model/canvas-element.model.ts
b/ui/src/app/app-asset-monitoring/model/canvas-element.model.ts
deleted file mode 100644
index 9bba980de4..0000000000
--- a/ui/src/app/app-asset-monitoring/model/canvas-element.model.ts
+++ /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.
- *
- */
-
-import { CanvasAttributes } from './canvas-attributes.model';
-
-export interface CanvasElement {
- attrs: CanvasAttributes;
- className: string;
- children: CanvasElement[];
-}
diff --git
a/ui/src/app/app-asset-monitoring/model/dashboard-configuration.model.ts
b/ui/src/app/app-asset-monitoring/model/dashboard-configuration.model.ts
deleted file mode 100644
index 6ab768c5db..0000000000
--- a/ui/src/app/app-asset-monitoring/model/dashboard-configuration.model.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 { CanvasElement } from './canvas-element.model';
-import { CanvasAttributes } from './canvas-attributes.model';
-import { ImageInfo } from './image-info.model';
-
-export interface DashboardConfiguration {
- dashboardName: string;
- dashboardDescription: string;
- dashboardId: string;
- imageInfo: ImageInfo;
- attrs: CanvasAttributes;
- className: string;
- children: CanvasElement[];
-}
diff --git a/ui/src/app/app-asset-monitoring/model/image-info.model.ts
b/ui/src/app/app-asset-monitoring/model/image-info.model.ts
deleted file mode 100644
index ca011eb321..0000000000
--- a/ui/src/app/app-asset-monitoring/model/image-info.model.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.
- *
- */
-
-export interface ImageInfo {
- imageName: string;
- x: number;
- y: number;
- width: number;
- height: number;
- scaleX: number;
- scaleY: number;
- rotation: number;
- image: any;
- draggable: boolean;
- id: string;
-}
diff --git
a/ui/src/app/app-asset-monitoring/model/selected-visualization-data.model.ts
b/ui/src/app/app-asset-monitoring/model/selected-visualization-data.model.ts
deleted file mode 100644
index 611bc0d6ef..0000000000
--- a/ui/src/app/app-asset-monitoring/model/selected-visualization-data.model.ts
+++ /dev/null
@@ -1,35 +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 interface SelectedVisualizationData {
- labelBackgroundColor: string;
- labelTextColor: string;
- measurementBackgroundColor: string;
- measurementTextColor: string;
- visualizationId: string;
- measurement: string;
- label: string;
- dataLakeMeasure: string;
-}
-
-export interface HyperlinkConfig {
- linkLabel: string;
- linkHref: string;
- labelFontSize: number;
- newWindow: boolean;
-}
diff --git a/ui/src/app/app-asset-monitoring/model/test-data.json
b/ui/src/app/app-asset-monitoring/model/test-data.json
deleted file mode 100644
index 4c2d5ed6d9..0000000000
--- a/ui/src/app/app-asset-monitoring/model/test-data.json
+++ /dev/null
@@ -1,126 +0,0 @@
-{
- "attrs": {
- "width": 1200,
- "height": 900
- },
- "className": "Stage",
- "children": [
- {
- "attrs": {},
- "className": "Layer",
- "children": [
- {
- "attrs": {
- "x": -372,
- "y": -316,
- "draggable": true
- },
- "className": "Image"
- },
- {
- "attrs": {
- "anchorStroke": "red",
- "anchorFill": "yellow",
- "anchorSize": 20,
- "borderStroke": "green",
- "borderDash": [3, 3]
- },
- "className": "Transformer"
- }
- ]
- },
- {
- "attrs": {},
- "className": "Layer",
- "children": [
- {
- "attrs": {
- "x": -495.3078833627492,
- "y": -165.10262778758306,
- "draggable": true,
- "pipelineId": "123",
- "scaleX": 3.5637828473447883,
- "scaleY": 3.5637828473447883
- },
- "className": "Group",
- "children": [
- {
- "attrs": {
- "x": 120,
- "y": 40,
- "pipelineId": "123"
- },
- "className": "Group",
- "children": [
- {
- "attrs": {
- "x": 120,
- "y": 40,
- "fill": "#FFFFFF",
- "width": 120,
- "height": 30,
- "id": "hi-id"
- },
- "className": "Rect"
- },
- {
- "attrs": {
- "x": 120,
- "y": 40,
- "width": 120,
- "height": 30,
- "fill": "#000000",
- "id": "my-text"
- },
- "className": "Text"
- }
- ]
- },
- {
- "attrs": {
- "x": 120,
- "y": 40,
- "pipelineId": "123"
- },
- "className": "Group",
- "children": [
- {
- "attrs": {
- "x": 120,
- "y": 70,
- "fill": "#FFFFFF",
- "width": 80,
- "height": 15,
- "id": "hi-id"
- },
- "className": "Rect"
- },
- {
- "attrs": {
- "text": "randomString",
- "x": 120,
- "y": 70,
- "width": 80,
- "height": 15,
- "fill": "#000000",
- "id": "my-text"
- },
- "className": "Text"
- }
- ]
- }
- ]
- },
- {
- "attrs": {
- "anchorStroke": "red",
- "anchorFill": "yellow",
- "borderStroke": "green",
- "borderDash": [3, 3]
- },
- "className": "Transformer"
- }
- ]
- }
- ]
-}
diff --git a/ui/src/app/app-asset-monitoring/services/rest.service.ts
b/ui/src/app/app-asset-monitoring/services/rest.service.ts
deleted file mode 100644
index 5e107245f3..0000000000
--- a/ui/src/app/app-asset-monitoring/services/rest.service.ts
+++ /dev/null
@@ -1,87 +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 { HttpClient } from '@angular/common/http';
-import { Injectable } from '@angular/core';
-import { map } from 'rxjs/operators';
-import { Observable } from 'rxjs';
-import { DashboardConfiguration } from
'../model/dashboard-configuration.model';
-import { PlatformServicesCommons } from '@streampipes/platform-services';
-
-@Injectable({ providedIn: 'root' })
-export class RestService {
- constructor(
- private http: HttpClient,
- private platformServicesCommons: PlatformServicesCommons,
- ) {}
-
- getVisualizablePipelines(): Observable<any> {
- return this.http.get(
- '/visualizablepipeline/_all_docs?include_docs=true',
- );
- }
-
- getPipeline(pipelineId): Observable<any> {
- return this.http.get('/pipeline/' + pipelineId);
- }
-
- storeImage(file: File): Observable<any> {
- const data: FormData = new FormData();
- data.append('file_upload', file, file.name);
- return this.http.post(this.imagePath, data).pipe(
- map(res => {
- return res;
- }),
- );
- }
-
- deleteDashboard(dashboardId: string) {
- return this.http.delete(`${this.url}/${dashboardId}`);
- }
-
- storeDashboard(dashboardConfig: DashboardConfiguration) {
- return this.http.post(this.url, dashboardConfig);
- }
-
- updateDashboard(dashboardConfig: DashboardConfiguration) {
- return this.http.put(
- this.url + '/' + dashboardConfig.dashboardId,
- dashboardConfig,
- );
- }
-
- getDashboards(): Observable<DashboardConfiguration[]> {
- return this.http.get(this.url).pipe(
- map(response => {
- return response as DashboardConfiguration[];
- }),
- );
- }
-
- getImageUrl(imageName: string): string {
- return `${this.imagePath}/${imageName}`;
- }
-
- private get url() {
- return `${this.platformServicesCommons.apiBasePath}/asset-dashboards`;
- }
-
- private get imagePath() {
- return `${this.url}/images`;
- }
-}
diff --git a/ui/src/app/app-asset-monitoring/services/shape.service.ts
b/ui/src/app/app-asset-monitoring/services/shape.service.ts
deleted file mode 100644
index 07fd333db0..0000000000
--- a/ui/src/app/app-asset-monitoring/services/shape.service.ts
+++ /dev/null
@@ -1,162 +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 { Injectable } from '@angular/core';
-
-import Konva from 'konva';
-import {
- HyperlinkConfig,
- SelectedVisualizationData,
-} from '../model/selected-visualization-data.model';
-
-@Injectable({ providedIn: 'root' })
-export class ShapeService {
- constructor() {}
-
- makeNewHyperlinkGroup(hyperlinkConfig: HyperlinkConfig) {
- const group = this.makeGroup(true);
- group.add(this.makeHyperlinkLabel(hyperlinkConfig));
- return group;
- }
-
- makeHyperlinkLabel(hyperlinkConfig: HyperlinkConfig): Konva.Label {
- const label = new Konva.Label({
- x: 200,
- y: 40,
- });
- label.add(this.makeHyperlinkText(hyperlinkConfig));
- return label;
- }
-
- makeHyperlinkText(hyperlinkConfig: HyperlinkConfig): Konva.Text {
- const settings: any = {
- text: hyperlinkConfig.linkLabel,
- width: 'auto',
- height: 'auto',
- hyperlink: hyperlinkConfig.linkHref,
- newWindow: hyperlinkConfig.newWindow,
- textDecoration: 'underline',
- fill: '#62e497',
- fontSize: hyperlinkConfig.labelFontSize,
- };
- return new Konva.Text(settings);
- }
-
- makeNewMeasurementShape(
- visualizationConfig: SelectedVisualizationData,
- ): Konva.Group {
- const visualizationGroup = this.makeGroup(true);
- visualizationGroup.add(this.makeLabelGroup(visualizationConfig));
- visualizationGroup.add(this.makeMeasurementGroup(visualizationConfig));
- return visualizationGroup;
- }
-
- makeLabelGroup(config: SelectedVisualizationData): Konva.Group {
- const labelGroup = this.makeGroup(false);
- labelGroup.add(
- this.makeRect(config.labelBackgroundColor, 120, 40, 140, 20),
- );
- labelGroup.add(
- this.makeText(
- config,
- config.label,
- config.labelTextColor,
- 120,
- 45,
- 140,
- 20,
- false,
- ),
- );
- return labelGroup;
- }
-
- makeMeasurementGroup(config: SelectedVisualizationData): Konva.Group {
- const measurementGroup = this.makeGroup(false);
- measurementGroup.add(
- this.makeRect(config.measurementBackgroundColor, 120, 60, 140, 40),
- );
- measurementGroup.add(
- this.makeText(
- config,
- config.measurement,
- config.measurementTextColor,
- 120,
- 65,
- 140,
- 40,
- true,
- ),
- );
- return measurementGroup;
- }
-
- makeGroup(draggable: boolean): Konva.Group {
- return new Konva.Group({
- x: 120,
- y: 40,
- draggable,
- });
- }
-
- makeRect(
- fillColor: string,
- x: number,
- y: number,
- width: number,
- height: number,
- ): Konva.Rect {
- return new Konva.Rect({
- x,
- y,
- fill: fillColor,
- width,
- height,
- });
- }
-
- makeText(
- config: SelectedVisualizationData,
- text: string,
- textColor: string,
- x: number,
- y: number,
- width: number | string,
- height: number | string,
- dynamicContent: boolean,
- ): Konva.Text {
- const textSettings: any = {
- text,
- x,
- y,
- width,
- height,
- fill: textColor,
- align: 'center',
- fontSize: '15',
- };
-
- if (dynamicContent) {
- textSettings.name = 'dynamic-text';
- textSettings.dataLakeMeasure = config.dataLakeMeasure;
- textSettings.fontSize = '30';
- }
-
- return new Konva.Text(textSettings);
- }
-}
diff --git a/ui/src/app/app-overview/app-overview.module.ts
b/ui/src/app/app-overview/app-overview.module.ts
index eef43de838..a4601deb08 100644
--- a/ui/src/app/app-overview/app-overview.module.ts
+++ b/ui/src/app/app-overview/app-overview.module.ts
@@ -24,7 +24,6 @@ import { FormsModule } from '@angular/forms';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatGridListModule } from '@angular/material/grid-list';
import { MatInputModule } from '@angular/material/input';
-import { AppAssetMonitoringModule } from
'../app-asset-monitoring/app-asset-monitoring.module';
import { AppOverviewComponent } from './app-overview.component';
import { RouterModule } from '@angular/router';
import { AvailableAppsService } from './apps';
@@ -34,7 +33,6 @@ import { MatButtonModule } from '@angular/material/button';
@NgModule({
imports: [
- AppAssetMonitoringModule,
CommonModule,
FlexLayoutModule,
FormsModule,