This is an automated email from the ASF dual-hosted git repository.
dominikriemer pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/streampipes.git
The following commit(s) were added to refs/heads/dev by this push:
new 23539aafb5 feat: Introduce summary DTO for resource overview (#4541)
23539aafb5 is described below
commit 23539aafb5353dea8f038393b7e51bb755074cb5
Author: Dominik Riemer <[email protected]>
AuthorDate: Fri Jun 12 07:54:41 2026 +0200
feat: Introduce summary DTO for resource overview (#4541)
---
.../model/dashboard/DashboardSummaryDto.java | 9 +-
.../model/pipeline/PipelineSummaryDto.java | 15 +-
.../model/resource/ResourceSummaryDto.java | 9 +-
streampipes-resource-management/pom.xml | 10 ++
.../resource/management/CrudResourceManager.java | 3 +
.../management/DataExplorerResourceManager.java | 19 +++
.../management/PipelineResourceManager.java | 31 +++-
.../permission}/SpPermissionEvaluator.java | 2 +-
.../base/impl/AbstractAuthGuardedRestResource.java | 5 +
.../rest/impl/AdapterMonitoringResource.java | 2 +-
.../streampipes/rest/impl/PipelineResource.java | 10 ++
.../rest/impl/connect/AdapterResource.java | 2 +-
.../impl/dashboard/DataLakeDashboardResource.java | 8 +
.../impl/datalake/AbstractDataLakeResource.java | 2 +-
.../minimal/StreamPipesCoreApplicationMinimal.java | 2 +-
.../service/core/StreamPipesCoreApplication.java | 3 +-
.../src/lib/apis/dashboard.service.ts | 14 ++
.../src/lib/apis/pipeline.service.ts | 10 ++
.../lib/model/resource/resource-summary.model.ts | 26 +++-
.../platform-services/src/public-api.ts | 1 +
.../dashboard-overview-table.component.html | 22 +--
.../dashboard-overview-table.component.ts | 161 +++++++++++----------
.../actions/pipeline-actions.component.html | 4 +-
.../pipeline-details/pipeline-details.component.ts | 8 +-
.../pipeline-overview.component.html | 18 ++-
.../pipeline-overview.component.ts | 19 +--
.../delete-pipeline-dialog.component.html | 8 +-
.../delete-pipeline-dialog.component.ts | 17 ++-
.../pipeline-notifications.component.html | 41 +++---
.../pipeline-notifications.component.ts | 24 ++-
ui/src/app/pipelines/pipelines.component.ts | 9 +-
.../services/pipeline-operations.service.ts | 27 ++--
32 files changed, 369 insertions(+), 172 deletions(-)
diff --git
a/streampipes-resource-management/src/main/java/org/apache/streampipes/resource/management/PipelineResourceManager.java
b/streampipes-model/src/main/java/org/apache/streampipes/model/dashboard/DashboardSummaryDto.java
similarity index 71%
copy from
streampipes-resource-management/src/main/java/org/apache/streampipes/resource/management/PipelineResourceManager.java
copy to
streampipes-model/src/main/java/org/apache/streampipes/model/dashboard/DashboardSummaryDto.java
index 21692f9239..cd1c04fcd7 100644
---
a/streampipes-resource-management/src/main/java/org/apache/streampipes/resource/management/PipelineResourceManager.java
+++
b/streampipes-model/src/main/java/org/apache/streampipes/model/dashboard/DashboardSummaryDto.java
@@ -15,7 +15,12 @@
* limitations under the License.
*
*/
-package org.apache.streampipes.resource.management;
-public class PipelineResourceManager {
+package org.apache.streampipes.model.dashboard;
+
+public record DashboardSummaryDto(String elementId,
+ String name,
+ String description,
+ long createdAtEpochMs,
+ long lastModifiedEpochMs) {
}
diff --git
a/streampipes-resource-management/src/main/java/org/apache/streampipes/resource/management/PipelineResourceManager.java
b/streampipes-model/src/main/java/org/apache/streampipes/model/pipeline/PipelineSummaryDto.java
similarity index 59%
copy from
streampipes-resource-management/src/main/java/org/apache/streampipes/resource/management/PipelineResourceManager.java
copy to
streampipes-model/src/main/java/org/apache/streampipes/model/pipeline/PipelineSummaryDto.java
index 21692f9239..eb3bdd12ea 100644
---
a/streampipes-resource-management/src/main/java/org/apache/streampipes/resource/management/PipelineResourceManager.java
+++
b/streampipes-model/src/main/java/org/apache/streampipes/model/pipeline/PipelineSummaryDto.java
@@ -15,7 +15,18 @@
* limitations under the License.
*
*/
-package org.apache.streampipes.resource.management;
-public class PipelineResourceManager {
+package org.apache.streampipes.model.pipeline;
+
+import java.util.List;
+
+public record PipelineSummaryDto(String elementId,
+ String name,
+ String description,
+ long createdAt,
+ boolean running,
+ PipelineHealthStatus healthStatus,
+ List<String> pipelineNotifications,
+ boolean valid
+ ) {
}
diff --git
a/streampipes-resource-management/src/main/java/org/apache/streampipes/resource/management/PipelineResourceManager.java
b/streampipes-model/src/main/java/org/apache/streampipes/model/resource/ResourceSummaryDto.java
similarity index 81%
copy from
streampipes-resource-management/src/main/java/org/apache/streampipes/resource/management/PipelineResourceManager.java
copy to
streampipes-model/src/main/java/org/apache/streampipes/model/resource/ResourceSummaryDto.java
index 21692f9239..2d3439a3da 100644
---
a/streampipes-resource-management/src/main/java/org/apache/streampipes/resource/management/PipelineResourceManager.java
+++
b/streampipes-model/src/main/java/org/apache/streampipes/model/resource/ResourceSummaryDto.java
@@ -15,7 +15,10 @@
* limitations under the License.
*
*/
-package org.apache.streampipes.resource.management;
-public class PipelineResourceManager {
-}
+package org.apache.streampipes.model.resource;
+
+import java.util.List;
+
+public record ResourceSummaryDto<T>(List<T> resources,
+ int totalCount) {}
diff --git a/streampipes-resource-management/pom.xml
b/streampipes-resource-management/pom.xml
index 7cda933c3b..84f29f9bb5 100644
--- a/streampipes-resource-management/pom.xml
+++ b/streampipes-resource-management/pom.xml
@@ -43,6 +43,16 @@
<version>0.99.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-core</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </dependency>
+
<!-- Test dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
diff --git
a/streampipes-resource-management/src/main/java/org/apache/streampipes/resource/management/CrudResourceManager.java
b/streampipes-resource-management/src/main/java/org/apache/streampipes/resource/management/CrudResourceManager.java
index a67c6e40f3..b4e9782173 100644
---
a/streampipes-resource-management/src/main/java/org/apache/streampipes/resource/management/CrudResourceManager.java
+++
b/streampipes-resource-management/src/main/java/org/apache/streampipes/resource/management/CrudResourceManager.java
@@ -20,6 +20,7 @@ package org.apache.streampipes.resource.management;
import org.apache.streampipes.model.client.user.Permission;
import org.apache.streampipes.model.shared.api.Storable;
import org.apache.streampipes.model.util.ElementIdGenerator;
+import
org.apache.streampipes.resource.management.permission.SpPermissionEvaluator;
import org.apache.streampipes.storage.api.core.CRUDStorage;
import java.util.List;
@@ -28,11 +29,13 @@ public class CrudResourceManager<T extends Storable>
extends AbstractResourceManager<CRUDStorage<T>> {
private final Class<T> elementClass;
+ protected final SpPermissionEvaluator permissionEvaluator;
public CrudResourceManager(CRUDStorage<T> db,
Class<T> elementClass) {
super(db);
this.elementClass = elementClass;
+ this.permissionEvaluator = new SpPermissionEvaluator();
}
public List<T> findAll() {
diff --git
a/streampipes-resource-management/src/main/java/org/apache/streampipes/resource/management/DataExplorerResourceManager.java
b/streampipes-resource-management/src/main/java/org/apache/streampipes/resource/management/DataExplorerResourceManager.java
index cb5aa69656..f4fd8d00c0 100644
---
a/streampipes-resource-management/src/main/java/org/apache/streampipes/resource/management/DataExplorerResourceManager.java
+++
b/streampipes-resource-management/src/main/java/org/apache/streampipes/resource/management/DataExplorerResourceManager.java
@@ -19,11 +19,15 @@ package org.apache.streampipes.resource.management;
import org.apache.streampipes.model.dashboard.CompositeDashboardModel;
import org.apache.streampipes.model.dashboard.DashboardModel;
+import org.apache.streampipes.model.dashboard.DashboardSummaryDto;
import org.apache.streampipes.model.datalake.DataExplorerWidgetModel;
+import org.apache.streampipes.model.resource.ResourceSummaryDto;
import org.apache.streampipes.storage.api.explorer.IDataExplorerWidgetStorage;
import org.apache.streampipes.storage.api.explorer.IDataLakeMeasureStorage;
import org.apache.streampipes.storage.management.StorageDispatcher;
+import org.springframework.security.core.Authentication;
+
import java.util.List;
import java.util.Map;
@@ -38,6 +42,21 @@ public class DataExplorerResourceManager extends
CrudResourceManager<DashboardMo
this.dataLakeMeasureStorage =
StorageDispatcher.INSTANCE.getNoSqlStore().getDataLakeStorage();
}
+ public ResourceSummaryDto<DashboardSummaryDto> getSummary(Authentication
auth) {
+ var dashboards = findAll()
+ .stream()
+ .filter(dashboard -> permissionEvaluator.hasPermission(auth,
dashboard.getElementId(), "READ"))
+ .map(dashboard -> new DashboardSummaryDto(
+ dashboard.getElementId(),
+ dashboard.getName(),
+ dashboard.getDescription(),
+ dashboard.getMetadata().getCreatedAtEpochMs(),
+ dashboard.getMetadata().getLastModifiedEpochMs()))
+ .toList();
+
+ return new ResourceSummaryDto<>(dashboards, dashboards.size());
+ }
+
public CompositeDashboardModel getCompositeDashboard(String dashboardId) {
var dashboard = db.getElementById(dashboardId);
var widgets = dashboard.getWidgets().stream()
diff --git
a/streampipes-resource-management/src/main/java/org/apache/streampipes/resource/management/PipelineResourceManager.java
b/streampipes-resource-management/src/main/java/org/apache/streampipes/resource/management/PipelineResourceManager.java
index 21692f9239..260d5c1145 100644
---
a/streampipes-resource-management/src/main/java/org/apache/streampipes/resource/management/PipelineResourceManager.java
+++
b/streampipes-resource-management/src/main/java/org/apache/streampipes/resource/management/PipelineResourceManager.java
@@ -17,5 +17,34 @@
*/
package org.apache.streampipes.resource.management;
-public class PipelineResourceManager {
+import org.apache.streampipes.model.pipeline.Pipeline;
+import org.apache.streampipes.model.pipeline.PipelineSummaryDto;
+import org.apache.streampipes.model.resource.ResourceSummaryDto;
+import org.apache.streampipes.storage.management.StorageDispatcher;
+
+import org.springframework.security.core.Authentication;
+
+public class PipelineResourceManager extends CrudResourceManager<Pipeline> {
+
+ public PipelineResourceManager() {
+ super(StorageDispatcher.INSTANCE.getNoSqlStore().getPipelineStorageAPI(),
Pipeline.class);
+ }
+
+ public ResourceSummaryDto<PipelineSummaryDto> getSummary(Authentication
auth) {
+ var pipelines = findAll()
+ .stream()
+ .filter(pipeline -> permissionEvaluator.hasPermission(auth,
pipeline.getElementId(), "READ"))
+ .map(pipeline -> new PipelineSummaryDto(
+ pipeline.getElementId(),
+ pipeline.getName(),
+ pipeline.getDescription(),
+ pipeline.getCreatedAt(),
+ pipeline.isRunning(),
+ pipeline.getHealthStatus(),
+ pipeline.getPipelineNotifications(),
+ pipeline.isValid()))
+ .toList();
+
+ return new ResourceSummaryDto<>(pipelines, pipelines.size());
+ }
}
diff --git
a/streampipes-rest/src/main/java/org/apache/streampipes/rest/security/SpPermissionEvaluator.java
b/streampipes-resource-management/src/main/java/org/apache/streampipes/resource/management/permission/SpPermissionEvaluator.java
similarity index 98%
rename from
streampipes-rest/src/main/java/org/apache/streampipes/rest/security/SpPermissionEvaluator.java
rename to
streampipes-resource-management/src/main/java/org/apache/streampipes/resource/management/permission/SpPermissionEvaluator.java
index 1efe69cd66..0c208847c4 100644
---
a/streampipes-rest/src/main/java/org/apache/streampipes/rest/security/SpPermissionEvaluator.java
+++
b/streampipes-resource-management/src/main/java/org/apache/streampipes/resource/management/permission/SpPermissionEvaluator.java
@@ -15,7 +15,7 @@
* limitations under the License.
*
*/
-package org.apache.streampipes.rest.security;
+package org.apache.streampipes.resource.management.permission;
import org.apache.streampipes.model.client.user.DefaultRole;
import org.apache.streampipes.model.client.user.Permission;
diff --git
a/streampipes-rest-core-base/src/main/java/org/apache/streampipes/rest/core/base/impl/AbstractAuthGuardedRestResource.java
b/streampipes-rest-core-base/src/main/java/org/apache/streampipes/rest/core/base/impl/AbstractAuthGuardedRestResource.java
index 34134979d9..ae5eb81695 100644
---
a/streampipes-rest-core-base/src/main/java/org/apache/streampipes/rest/core/base/impl/AbstractAuthGuardedRestResource.java
+++
b/streampipes-rest-core-base/src/main/java/org/apache/streampipes/rest/core/base/impl/AbstractAuthGuardedRestResource.java
@@ -21,6 +21,7 @@ package org.apache.streampipes.rest.core.base.impl;
import org.apache.streampipes.model.client.user.DefaultRole;
import org.apache.streampipes.user.management.model.PrincipalUserDetails;
+import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import java.util.ArrayList;
@@ -41,6 +42,10 @@ public class AbstractAuthGuardedRestResource extends
AbstractRestResource {
return SecurityContextHolder.getContext().getAuthentication().getName();
}
+ protected Authentication getAuthentication() {
+ return SecurityContextHolder.getContext().getAuthentication();
+ }
+
protected PrincipalUserDetails<?> getPrincipal() {
return (PrincipalUserDetails<?>)
SecurityContextHolder.getContext().getAuthentication().getPrincipal();
}
diff --git
a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/AdapterMonitoringResource.java
b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/AdapterMonitoringResource.java
index 487526d812..ff77d6a6d0 100644
---
a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/AdapterMonitoringResource.java
+++
b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/AdapterMonitoringResource.java
@@ -26,7 +26,7 @@ import
org.apache.streampipes.model.base.NamedStreamPipesEntity;
import org.apache.streampipes.model.client.user.DefaultPrivilege;
import org.apache.streampipes.model.connect.adapter.AdapterDescription;
import org.apache.streampipes.model.monitoring.SpMetricsEntry;
-import org.apache.streampipes.rest.security.SpPermissionEvaluator;
+import
org.apache.streampipes.resource.management.permission.SpPermissionEvaluator;
import org.apache.streampipes.storage.api.connect.IAdapterStorage;
import org.apache.streampipes.storage.management.StorageDispatcher;
diff --git
a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineResource.java
b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineResource.java
index 077f0e7a2c..1ccfa70fb3 100644
---
a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineResource.java
+++
b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineResource.java
@@ -39,7 +39,10 @@ import org.apache.streampipes.model.message.SuccessMessage;
import org.apache.streampipes.model.pipeline.Pipeline;
import
org.apache.streampipes.model.pipeline.PipelineElementRecommendationMessage;
import org.apache.streampipes.model.pipeline.PipelineOperationStatus;
+import org.apache.streampipes.model.pipeline.PipelineSummaryDto;
import org.apache.streampipes.model.pipeline.compact.CompactPipeline;
+import org.apache.streampipes.model.resource.ResourceSummaryDto;
+import org.apache.streampipes.resource.management.PipelineResourceManager;
import
org.apache.streampipes.rest.core.base.impl.AbstractAuthGuardedRestResource;
import org.apache.streampipes.rest.shared.exception.SpMessageException;
import org.apache.streampipes.rest.shared.exception.SpNotificationException;
@@ -109,6 +112,13 @@ public class PipelineResource extends
AbstractAuthGuardedRestResource {
return PipelineManager.getAllPipelines();
}
+ @GetMapping(path = "/summary", produces = MediaType.APPLICATION_JSON_VALUE)
+ @PreAuthorize("this.hasReadAuthority()")
+ public ResourceSummaryDto<PipelineSummaryDto> getPipelineSummary() {
+ return new PipelineResourceManager().getSummary(getAuthentication());
+ }
+
+
@GetMapping(
path = "{pipelineId}/status",
produces = MediaType.APPLICATION_JSON_VALUE)
diff --git
a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/AdapterResource.java
b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/AdapterResource.java
index 235135bcdf..692b49ae9a 100644
---
a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/AdapterResource.java
+++
b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/AdapterResource.java
@@ -37,10 +37,10 @@ import org.apache.streampipes.model.monitoring.SpLogMessage;
import org.apache.streampipes.model.util.ElementIdGenerator;
import org.apache.streampipes.resource.management.PermissionResourceManager;
import org.apache.streampipes.resource.management.SpResourceManager;
+import
org.apache.streampipes.resource.management.permission.SpPermissionEvaluator;
import org.apache.streampipes.rest.event.AdapterDeletedEvent;
import org.apache.streampipes.rest.event.AdapterUpdatedEvent;
import org.apache.streampipes.rest.security.AuthConstants;
-import org.apache.streampipes.rest.security.SpPermissionEvaluator;
import org.apache.streampipes.rest.shared.constants.SpMediaType;
import org.apache.streampipes.storage.api.pipeline.IPipelineStorage;
import org.apache.streampipes.storage.management.StorageDispatcher;
diff --git
a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/DataLakeDashboardResource.java
b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/DataLakeDashboardResource.java
index fd10324883..f940c21a0e 100644
---
a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/DataLakeDashboardResource.java
+++
b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/DataLakeDashboardResource.java
@@ -21,6 +21,8 @@ package org.apache.streampipes.rest.impl.dashboard;
import org.apache.streampipes.model.client.user.DefaultPrivilege;
import org.apache.streampipes.model.dashboard.DashboardModel;
+import org.apache.streampipes.model.dashboard.DashboardSummaryDto;
+import org.apache.streampipes.model.resource.ResourceSummaryDto;
import org.apache.streampipes.resource.management.DataExplorerResourceManager;
import
org.apache.streampipes.rest.core.base.impl.AbstractAuthGuardedRestResource;
import org.apache.streampipes.storage.api.user.IPermissionStorage;
@@ -61,6 +63,12 @@ public class DataLakeDashboardResource extends
AbstractAuthGuardedRestResource {
return getResourceManager().findAll();
}
+ @GetMapping(path = "/summary", produces = MediaType.APPLICATION_JSON_VALUE)
+ @PreAuthorize("this.hasReadAuthority()")
+ public ResourceSummaryDto<DashboardSummaryDto> getDashboardSummary() {
+ return getResourceManager().getSummary(getAuthentication());
+ }
+
@GetMapping(path = "/{dashboardId}", produces =
MediaType.APPLICATION_JSON_VALUE)
@PreAuthorize("this.hasReadAuthority() and hasPermission(#dashboardId,
'READ')")
public DashboardModel getDashboard(@PathVariable("dashboardId") String
dashboardId) {
diff --git
a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/AbstractDataLakeResource.java
b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/AbstractDataLakeResource.java
index 36df49e52e..87e3a8aa5b 100644
---
a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/AbstractDataLakeResource.java
+++
b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/AbstractDataLakeResource.java
@@ -20,8 +20,8 @@ package org.apache.streampipes.rest.impl.datalake;
import org.apache.streampipes.dataexplorer.api.IDataExplorerSchemaManagement;
import org.apache.streampipes.dataexplorer.management.DataExplorerDispatcher;
import org.apache.streampipes.model.client.user.DefaultPrivilege;
+import
org.apache.streampipes.resource.management.permission.SpPermissionEvaluator;
import
org.apache.streampipes.rest.core.base.impl.AbstractAuthGuardedRestResource;
-import org.apache.streampipes.rest.security.SpPermissionEvaluator;
import org.apache.streampipes.storage.api.explorer.IDataLakeMeasureStorage;
import org.apache.streampipes.storage.management.StorageDispatcher;
diff --git
a/streampipes-service-core-minimal/src/main/java/org/apache/streampipes/service/core/minimal/StreamPipesCoreApplicationMinimal.java
b/streampipes-service-core-minimal/src/main/java/org/apache/streampipes/service/core/minimal/StreamPipesCoreApplicationMinimal.java
index eb62ec0fcc..467be87746 100644
---
a/streampipes-service-core-minimal/src/main/java/org/apache/streampipes/service/core/minimal/StreamPipesCoreApplicationMinimal.java
+++
b/streampipes-service-core-minimal/src/main/java/org/apache/streampipes/service/core/minimal/StreamPipesCoreApplicationMinimal.java
@@ -22,7 +22,7 @@ import
org.apache.streampipes.connect.transformer.groovy.GroovyScriptEngine;
import org.apache.streampipes.connect.transformer.js.GraalJsScriptEngine;
import org.apache.streampipes.messaging.mqtt.SpMqttProtocolFactory;
import org.apache.streampipes.messaging.nats.SpNatsProtocolFactory;
-import org.apache.streampipes.rest.security.SpPermissionEvaluator;
+import
org.apache.streampipes.resource.management.permission.SpPermissionEvaluator;
import org.apache.streampipes.service.base.StreamPipesPrometheusConfig;
import org.apache.streampipes.service.core.OpenApiConfiguration;
import org.apache.streampipes.service.core.StreamPipesCoreApplication;
diff --git
a/streampipes-service-core/src/main/java/org/apache/streampipes/service/core/StreamPipesCoreApplication.java
b/streampipes-service-core/src/main/java/org/apache/streampipes/service/core/StreamPipesCoreApplication.java
index bffcc1be4d..33e8726054 100644
---
a/streampipes-service-core/src/main/java/org/apache/streampipes/service/core/StreamPipesCoreApplication.java
+++
b/streampipes-service-core/src/main/java/org/apache/streampipes/service/core/StreamPipesCoreApplication.java
@@ -50,6 +50,7 @@ import
org.apache.streampipes.model.configuration.SpCoreConfigurationStatus;
import org.apache.streampipes.model.pipeline.Pipeline;
import org.apache.streampipes.model.pipeline.PipelineOperationStatus;
import org.apache.streampipes.resource.management.SpResourceManager;
+import
org.apache.streampipes.resource.management.permission.SpPermissionEvaluator;
import org.apache.streampipes.service.base.BaseNetworkingConfig;
import org.apache.streampipes.service.base.StreamPipesPrometheusConfig;
import org.apache.streampipes.service.base.StreamPipesServiceBase;
@@ -90,7 +91,7 @@ import java.util.function.Supplier;
@EnableScheduling
@Import({OpenApiConfiguration.class, StreamPipesPasswordEncoder.class,
StreamPipesPrometheusConfig.class, WebSecurityConfig.class,
WelcomePageController.class,
- StorageApiConfiguration.class, ExtensionServiceRequestConfiguration.class})
+ StorageApiConfiguration.class, ExtensionServiceRequestConfiguration.class,
SpPermissionEvaluator.class})
@ComponentScan({"org.apache.streampipes.rest.*",
"org.apache.streampipes.service.core.oauth2",
"org.apache.streampipes.service.core.scheduler"})
public class StreamPipesCoreApplication extends StreamPipesServiceBase {
diff --git
a/ui/projects/streampipes/platform-services/src/lib/apis/dashboard.service.ts
b/ui/projects/streampipes/platform-services/src/lib/apis/dashboard.service.ts
index 06dee0d3bc..9cbcb4dc3c 100644
---
a/ui/projects/streampipes/platform-services/src/lib/apis/dashboard.service.ts
+++
b/ui/projects/streampipes/platform-services/src/lib/apis/dashboard.service.ts
@@ -25,6 +25,10 @@ import {
Dashboard,
} from '../model/dashboard/dashboard.model';
import { NGX_LOADING_BAR_IGNORED } from '@ngx-loading-bar/http-client';
+import {
+ DashboardSummaryDto,
+ ResourceSummaryDto,
+} from '../model/resource/resource-summary.model';
@Injectable({
providedIn: 'root',
@@ -37,6 +41,12 @@ export class DashboardService {
return this.sharedDatalakeRestService.getDashboards(this.dashboardUrl);
}
+ getDashboardSummary(): Observable<ResourceSummaryDto<DashboardSummaryDto>>
{
+ return this.http.get<ResourceSummaryDto<DashboardSummaryDto>>(
+ `${this.dashboardUrl}/summary`,
+ );
+ }
+
getDashboard(dashboardId: string): Observable<Dashboard> {
return this.http.get<Dashboard>(`${this.dashboardUrl}/${dashboardId}`);
}
@@ -70,6 +80,10 @@ export class DashboardService {
);
}
+ deleteDashboardById(elementId: string): Observable<any> {
+ return this.http.delete(`${this.dashboardUrl}/${elementId}`);
+ }
+
saveDashboard(dashboard: Dashboard): Observable<any> {
return this.sharedDatalakeRestService.saveDashboard(
this.dashboardUrl,
diff --git
a/ui/projects/streampipes/platform-services/src/lib/apis/pipeline.service.ts
b/ui/projects/streampipes/platform-services/src/lib/apis/pipeline.service.ts
index 6d9a10aaf9..9c0a835853 100644
--- a/ui/projects/streampipes/platform-services/src/lib/apis/pipeline.service.ts
+++ b/ui/projects/streampipes/platform-services/src/lib/apis/pipeline.service.ts
@@ -31,6 +31,10 @@ import {
PipelineStatusMessage,
} from '../model/gen/streampipes-model';
import { map } from 'rxjs/operators';
+import {
+ PipelineSummaryDto,
+ ResourceSummaryDto,
+} from '../model/resource/resource-summary.model';
@Injectable({
providedIn: 'root',
@@ -127,6 +131,12 @@ export class PipelineService {
);
}
+ getPipelineSummary(): Observable<ResourceSummaryDto<PipelineSummaryDto>> {
+ return this.http.get<ResourceSummaryDto<PipelineSummaryDto>>(
+ `${this.apiBasePath}/pipelines/summary`,
+ );
+ }
+
deleteOwnPipeline(pipelineId): Observable<any> {
return this.http.delete(`${this.apiBasePath}/pipelines/${pipelineId}`);
}
diff --git
a/streampipes-resource-management/src/main/java/org/apache/streampipes/resource/management/PipelineResourceManager.java
b/ui/projects/streampipes/platform-services/src/lib/model/resource/resource-summary.model.ts
similarity index 58%
copy from
streampipes-resource-management/src/main/java/org/apache/streampipes/resource/management/PipelineResourceManager.java
copy to
ui/projects/streampipes/platform-services/src/lib/model/resource/resource-summary.model.ts
index 21692f9239..c3913ce834 100644
---
a/streampipes-resource-management/src/main/java/org/apache/streampipes/resource/management/PipelineResourceManager.java
+++
b/ui/projects/streampipes/platform-services/src/lib/model/resource/resource-summary.model.ts
@@ -15,7 +15,29 @@
* limitations under the License.
*
*/
-package org.apache.streampipes.resource.management;
-public class PipelineResourceManager {
+import { PipelineHealthStatus } from '../gen/streampipes-model';
+
+export interface ResourceSummaryDto<T> {
+ totalCount: number;
+ resources: T[];
+}
+
+export interface DashboardSummaryDto {
+ elementId: string;
+ name: string;
+ description: string;
+ createdAtEpochMs: number;
+ lastModifiedEpochMs: number;
+}
+
+export interface PipelineSummaryDto {
+ elementId: string;
+ name: string;
+ description: string;
+ createdAt: number;
+ running: boolean;
+ healthStatus: PipelineHealthStatus;
+ pipelineNotifications: string[];
+ valid: true;
}
diff --git a/ui/projects/streampipes/platform-services/src/public-api.ts
b/ui/projects/streampipes/platform-services/src/public-api.ts
index 732732d5d7..5b0b9cb75e 100644
--- a/ui/projects/streampipes/platform-services/src/public-api.ts
+++ b/ui/projects/streampipes/platform-services/src/public-api.ts
@@ -69,6 +69,7 @@ export * from './lib/model/config/general-config.model';
export * from './lib/model/measurement-unit/MeasurementUnit';
export * from './lib/model/gen/streampipes-model-client';
export * from './lib/model/gen/streampipes-model';
+export * from './lib/model/resource/resource-summary.model';
export * from './lib/model/datalake/data-lake-query-config.model';
export * from './lib/query/DatalakeQueryParameterBuilder';
diff --git
a/ui/src/app/dashboard/components/overview/dashboard-overview-table/dashboard-overview-table.component.html
b/ui/src/app/dashboard/components/overview/dashboard-overview-table/dashboard-overview-table.component.html
index dc8aefe950..fec74756b8 100644
---
a/ui/src/app/dashboard/components/overview/dashboard-overview-table/dashboard-overview-table.component.html
+++
b/ui/src/app/dashboard/components/overview/dashboard-overview-table/dashboard-overview-table.component.html
@@ -59,16 +59,11 @@
{{ 'Last modified' | translate }}
</th>
<td mat-cell *matCellDef="let element">
- @if (element.metadata) {
+ @if (element.lastModifiedEpochMs !== null) {
<div>
- {{
- this.formatDate(
- element.metadata.lastModifiedEpochMs
- )
- }}
+ {{ this.formatDate(element.lastModifiedEpochMs) }}
</div>
- }
- @if (!element.metadata) {
+ } @else {
<div>–</div>
}
</td>
@@ -79,16 +74,11 @@
{{ 'Created' | translate }}
</th>
<td mat-cell *matCellDef="let element">
- @if (element.metadata) {
+ @if (element.createdAtEpochMs !== null) {
<div>
- {{
- this.formatDate(
- element.metadata.createdAtEpochMs
- )
- }}
+ {{ this.formatDate(element.createdAtEpochMs) }}
</div>
- }
- @if (!element.metadata) {
+ } @else {
<div>–</div>
}
</td>
diff --git
a/ui/src/app/dashboard/components/overview/dashboard-overview-table/dashboard-overview-table.component.ts
b/ui/src/app/dashboard/components/overview/dashboard-overview-table/dashboard-overview-table.component.ts
index 94119f19d8..d31c558a07 100644
---
a/ui/src/app/dashboard/components/overview/dashboard-overview-table/dashboard-overview-table.component.ts
+++
b/ui/src/app/dashboard/components/overview/dashboard-overview-table/dashboard-overview-table.component.ts
@@ -32,23 +32,26 @@ import {
MatHeaderCellDef,
MatTableDataSource,
} from '@angular/material/table';
-import { Dashboard, DashboardService } from '@streampipes/platform-services';
+import {
+ Dashboard,
+ DashboardService,
+ DashboardSummaryDto,
+} from '@streampipes/platform-services';
import {
ConfirmDialogComponent,
DateFormatService,
DialogService,
+ ObjectManageDialogComponent,
+ ObjectManageDialogResourceConfig,
PanelType,
SpAssetBrowserService,
- SpTableAssetContextConfig,
SpBasicHeaderTitleComponent,
SpTableActionsDirective,
+ SpTableAssetContextConfig,
SpTableComponent,
- ObjectManageDialogResourceConfig,
- ObjectManageDialogComponent,
} from '@streampipes/shared-ui';
import { MatDialog } from '@angular/material/dialog';
import { DataExplorerDashboardService } from
'../../../../dashboard-shared/services/dashboard.service';
-import { ChartSharedService } from
'../../../../chart-shared/services/chart-shared.service';
import { TranslatePipe, TranslateService } from '@ngx-translate/core';
import { Router } from '@angular/router';
import { CloneDashboardDialogComponent } from
'../../../dialogs/clone-dashboard/clone-dashboard-dialog.component';
@@ -94,7 +97,7 @@ export class DashboardOverviewTableComponent implements
OnInit, OnDestroy {
@Input()
hasDashboardWritePrivileges: boolean;
- dataSource = new MatTableDataSource<Dashboard>();
+ dataSource = new MatTableDataSource<DashboardSummaryDto>();
@ViewChild(MatSort)
sort: MatSort;
@@ -110,12 +113,11 @@ export class DashboardOverviewTableComponent implements
OnInit, OnDestroy {
resourceLinkType: 'dashboard',
resourceIdKey: 'elementId',
};
- dashboards: Dashboard[] = [];
- filteredDashboards: Dashboard[] = [];
+ dashboards: DashboardSummaryDto[] = [];
+ filteredDashboards: DashboardSummaryDto[] = [];
private dashboardService = inject(DashboardService);
private dataExplorerDashboardService =
inject(DataExplorerDashboardService);
- private dataExplorerSharedService = inject(ChartSharedService);
private dialog = inject(MatDialog);
protected translateService = inject(TranslateService);
protected dateFormatService = inject(DateFormatService);
@@ -137,9 +139,9 @@ export class DashboardOverviewTableComponent implements
OnInit, OnDestroy {
this.dataSource.sortingDataAccessor = (dashboard, column) => {
if (column === 'lastModified') {
- return dashboard.metadata.lastModifiedEpochMs;
+ return dashboard.lastModifiedEpochMs;
} else if (column === 'createdAt') {
- return dashboard.metadata.createdAtEpochMs;
+ return dashboard.createdAtEpochMs;
}
return dashboard[column];
};
@@ -147,52 +149,49 @@ export class DashboardOverviewTableComponent implements
OnInit, OnDestroy {
this.getDashboards();
}
- showManageDialog(resource: Dashboard) {
- const resourceConfig: ObjectManageDialogResourceConfig<Dashboard> = {
- resourceLabel: 'Dashboard',
- nameLabel: 'Dashboard title',
- descriptionLabel: 'Dashboard description',
- nameProperty: 'name',
- assetLinkType: 'dashboard',
- assetLinkCheckboxLabel:
- 'Add the current dashboard to an existing asset',
- saveResource: resource =>
- this.dashboardService.updateDashboard(resource),
- };
- const dialogRef = this.dialogService.open(ObjectManageDialogComponent,
{
- panelType: PanelType.SLIDE_IN_PANEL,
- title: this.translateService.instant('Manage'),
- width: '50vw',
- data: {
- objectInstanceId: resource.elementId,
- resource: { ...resource },
- saveMode: 'immediate',
- resourceConfig,
- headerTitle:
- this.translateService.instant('Manage Dashboard ') +
- resource.name,
- },
- });
- dialogRef.afterClosed().subscribe(refresh => {
- if (refresh) {
- this.getDashboards();
- }
- });
- }
-
- openEditDashboardDialog(dashboard: Dashboard) {
- const dialogRef =
- this.dataExplorerDashboardService.openDashboardModificationDialog(
- false,
- dashboard,
- );
-
- dialogRef.afterClosed().subscribe(() => {
- this.getDashboards();
- });
+ showManageDialog(dashboard: DashboardSummaryDto) {
+ this.dashboardService
+ .getDashboard(dashboard.elementId)
+ .subscribe(resource => {
+ const resourceConfig:
ObjectManageDialogResourceConfig<Dashboard> =
+ {
+ resourceLabel: 'Dashboard',
+ nameLabel: 'Name',
+ descriptionLabel: 'Description',
+ nameProperty: 'name',
+ assetLinkType: 'dashboard',
+ assetLinkCheckboxLabel:
+ 'Add the current dashboard to an existing asset',
+ saveResource: resource =>
+ this.dashboardService.updateDashboard(resource),
+ };
+ const dialogRef = this.dialogService.open(
+ ObjectManageDialogComponent,
+ {
+ panelType: PanelType.SLIDE_IN_PANEL,
+ title: this.translateService.instant('Manage'),
+ width: '50vw',
+ data: {
+ objectInstanceId: resource.elementId,
+ resource: { ...resource },
+ saveMode: 'immediate',
+ resourceConfig,
+ headerTitle:
+ this.translateService.instant(
+ 'Manage Dashboard ',
+ ) + resource.name,
+ },
+ },
+ );
+ dialogRef.afterClosed().subscribe(refresh => {
+ if (refresh) {
+ this.getDashboards();
+ }
+ });
+ });
}
- openDeleteDashboardDialog(dashboard: Dashboard) {
+ openDeleteDashboardDialog(dashboard: DashboardSummaryDto) {
const dialogRef = this.dialog.open(ConfirmDialogComponent, {
width: '600px',
data: {
@@ -212,7 +211,7 @@ export class DashboardOverviewTableComponent implements
OnInit, OnDestroy {
dialogRef.afterClosed().subscribe(result => {
if (result === 'confirm') {
this.dashboardService
- .deleteDashboard(dashboard)
+ .deleteDashboardById(dashboard.elementId)
.subscribe(() => {
this.getDashboards();
});
@@ -220,17 +219,19 @@ export class DashboardOverviewTableComponent implements
OnInit, OnDestroy {
});
}
- showDashboard(dashboard: Dashboard) {
+ showDashboard(dashboard: DashboardSummaryDto) {
this.routingService.navigateToDashboard(false, dashboard.elementId);
}
- editDashboard(dashboard: Dashboard) {
+ editDashboard(dashboard: DashboardSummaryDto) {
this.routingService.navigateToDashboard(true, dashboard.elementId);
}
getDashboards() {
- this.dashboardService.getDashboards().subscribe(data => {
- this.dashboards = data.sort((a, b) =>
a.name.localeCompare(b.name));
+ this.dashboardService.getDashboardSummary().subscribe(data => {
+ this.dashboards = data.resources.sort((a, b) =>
+ a.name.localeCompare(b.name),
+ );
this.applyDashboardFilters(this.currentFilterIds);
});
}
@@ -261,26 +262,30 @@ export class DashboardOverviewTableComponent implements
OnInit, OnDestroy {
return
`${window.location.protocol}//${window.location.host}/#/dashboard-kiosk/${dashboardId}`;
}
- openCloneDialog(dashboard: Dashboard): void {
- const dialogRef = this.dialogService.open(
- CloneDashboardDialogComponent,
- {
- panelType: PanelType.SLIDE_IN_PANEL,
- title: this.translateService.instant('Clone dashboard'),
- width: '50vw',
- data: {
- dashboard: dashboard,
- },
- },
- );
- dialogRef.afterClosed().subscribe(result => {
- if (result) {
- this.getDashboards();
- }
- });
+ openCloneDialog(dashboardSummary: DashboardSummaryDto): void {
+ this.dashboardService
+ .getDashboard(dashboardSummary.elementId)
+ .subscribe(dashboard => {
+ const dialogRef = this.dialogService.open(
+ CloneDashboardDialogComponent,
+ {
+ panelType: PanelType.SLIDE_IN_PANEL,
+ title: this.translateService.instant('Clone
dashboard'),
+ width: '50vw',
+ data: {
+ dashboard: dashboard,
+ },
+ },
+ );
+ dialogRef.afterClosed().subscribe(result => {
+ if (result) {
+ this.getDashboards();
+ }
+ });
+ });
}
- onRowClicked(dashboard: Dashboard) {
+ onRowClicked(dashboard: DashboardSummaryDto) {
this.showDashboard(dashboard);
}
diff --git
a/ui/src/app/pipeline-details/components/pipeline-details-expansion-panel/actions/pipeline-actions.component.html
b/ui/src/app/pipeline-details/components/pipeline-details-expansion-panel/actions/pipeline-actions.component.html
index 4f76dafa39..665427d73f 100644
---
a/ui/src/app/pipeline-details/components/pipeline-details-expansion-panel/actions/pipeline-actions.component.html
+++
b/ui/src/app/pipeline-details/components/pipeline-details-expansion-panel/actions/pipeline-actions.component.html
@@ -74,7 +74,9 @@
[disabled]="!hasWritePipelinePrivileges"
(click)="
pipelineOperationsService.showDeleteDialog(
- pipeline,
+ pipeline.elementId,
+ pipeline.name,
+ pipeline.running,
reloadPipelineEmitter,
this.switchToPipelineView
)
diff --git a/ui/src/app/pipeline-details/pipeline-details.component.ts
b/ui/src/app/pipeline-details/pipeline-details.component.ts
index 138faea569..4634f3e5d3 100644
--- a/ui/src/app/pipeline-details/pipeline-details.component.ts
+++ b/ui/src/app/pipeline-details/pipeline-details.component.ts
@@ -16,7 +16,7 @@
*
*/
-import { Component, OnDestroy, OnInit, ViewChild, inject } from
'@angular/core';
+import { Component, inject, OnDestroy, OnInit, ViewChild } from
'@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { AuthService } from '../services/auth.service';
import {
@@ -35,6 +35,7 @@ import {
KeyboardShortcutService,
PanelType,
ShortcutRegistration,
+ SpBasicViewComponent,
SpBreadcrumbService,
} from '@streampipes/shared-ui';
import { SpPipelineRoutes } from '../pipelines/pipelines.breadcrumb';
@@ -45,7 +46,6 @@ import { PipelinePreviewComponent } from
'./components/preview/pipeline-preview.
import { HttpContext } from '@angular/common/http';
import { NGX_LOADING_BAR_IGNORED } from '@ngx-loading-bar/http-client';
import { PipelineCodeDialogComponent } from
'./dialogs/pipeline-code/pipeline-code-dialog.component';
-import { SpBasicViewComponent } from '@streampipes/shared-ui';
import {
FlexDirective,
LayoutAlignDirective,
@@ -277,7 +277,9 @@ export class SpPipelineDetailsComponent implements OnInit,
OnDestroy {
deletePipeline(): void {
this.pipelineOperationsService.showDeleteDialog(
- this.pipeline,
+ this.pipeline._id,
+ this.pipeline.name,
+ this.pipeline.running,
null,
() => this.router.navigate(['pipelines']),
);
diff --git
a/ui/src/app/pipelines/components/pipeline-overview/pipeline-overview.component.html
b/ui/src/app/pipelines/components/pipeline-overview/pipeline-overview.component.html
index cee5e86ca3..bc1d182188 100644
---
a/ui/src/app/pipelines/components/pipeline-overview/pipeline-overview.component.html
+++
b/ui/src/app/pipelines/components/pipeline-overview/pipeline-overview.component.html
@@ -25,7 +25,7 @@
hasPipelineWritePrivileges ? bulkPipelineActionOptions : []
"
featureCardId="pipeline"
- resourceIdKey="_id"
+ resourceIdKey="elementId"
[assetContextConfig]="assetContextConfig"
[showActionsMenu]="true"
[rowsClickable]="true"
@@ -125,7 +125,7 @@
data-cy="start-pipeline-button"
(click)="
pipelineOperationsService.startPipeline(
- pipeline._id,
+ pipeline.elementId,
refreshPipelinesEmitter,
toggleRunningOperation
);
@@ -148,7 +148,7 @@
data-cy="stop-pipeline-button"
(click)="
pipelineOperationsService.stopPipeline(
- pipeline._id,
+ pipeline.elementId,
refreshPipelinesEmitter,
toggleRunningOperation
);
@@ -193,7 +193,9 @@
<ng-template spTableActions let-element>
<button
mat-menu-item
-
(click)="pipelineOperationsService.showPipelineDetails(element._id)"
+ (click)="
+
pipelineOperationsService.showPipelineDetails(element.elementId)
+ "
>
<mat-icon>visibility</mat-icon>
<span>{{ 'Show' | translate }}</span>
@@ -201,7 +203,9 @@
@if (hasPipelineWritePrivileges) {
<button
mat-menu-item
- (click)="pipelineOperationsService.modifyPipeline(element._id)"
+ (click)="
+ pipelineOperationsService.modifyPipeline(element.elementId)
+ "
data-cy="modify-pipeline-btn"
>
<mat-icon>mode_edit</mat-icon>
@@ -226,7 +230,9 @@
mat-menu-item
(click)="
pipelineOperationsService.showDeleteDialog(
- element,
+ element.elementId,
+ element.name,
+ element.running,
refreshPipelinesEmitter
)
"
diff --git
a/ui/src/app/pipelines/components/pipeline-overview/pipeline-overview.component.ts
b/ui/src/app/pipelines/components/pipeline-overview/pipeline-overview.component.ts
index 2951379335..78500323e3 100644
---
a/ui/src/app/pipelines/components/pipeline-overview/pipeline-overview.component.ts
+++
b/ui/src/app/pipelines/components/pipeline-overview/pipeline-overview.component.ts
@@ -16,7 +16,7 @@
*
*/
-import { Pipeline } from '@streampipes/platform-services';
+import { PipelineSummaryDto } from '@streampipes/platform-services';
import {
Component,
EventEmitter,
@@ -45,11 +45,11 @@ import {
DialogRef,
DialogService,
PanelType,
+ SpTableActionsDirective,
SpTableAssetContextConfig,
+ SpTableComponent,
SpTableMultiActionExecuteEvent,
SpTableMultiActionOption,
- SpTableActionsDirective,
- SpTableComponent,
} from '@streampipes/shared-ui';
import { Subscription } from 'rxjs';
import {
@@ -92,7 +92,7 @@ import { TranslatePipe } from '@ngx-translate/core';
],
})
export class PipelineOverviewComponent implements OnInit, OnDestroy {
- _pipelines: Pipeline[];
+ _pipelines: PipelineSummaryDto[];
@Output()
refreshPipelinesEmitter: EventEmitter<boolean> =
@@ -107,7 +107,8 @@ export class PipelineOverviewComponent implements OnInit,
OnDestroy {
'actions',
];
- dataSource: MatTableDataSource<Pipeline> = new MatTableDataSource();
+ dataSource: MatTableDataSource<PipelineSummaryDto> =
+ new MatTableDataSource();
@ViewChild(MatSort) sort: MatSort;
starting = false;
@@ -147,7 +148,7 @@ export class PipelineOverviewComponent implements OnInit,
OnDestroy {
}
}
- openPipelineNotificationsDialog(pipeline: Pipeline) {
+ openPipelineNotificationsDialog(pipeline: PipelineSummaryDto) {
this.pipelineOperationsService.showPipelineNotificationsDialog(
pipeline,
this.refreshPipelinesEmitter,
@@ -159,7 +160,7 @@ export class PipelineOverviewComponent implements OnInit,
OnDestroy {
}
@Input()
- set pipelines(pipelines: Pipeline[]) {
+ set pipelines(pipelines: PipelineSummaryDto[]) {
this._pipelines = pipelines;
this.addPipelinesToTable();
}
@@ -180,7 +181,7 @@ export class PipelineOverviewComponent implements OnInit,
OnDestroy {
}
startStopSelectedPipelines(
- selectedPipelines: Pipeline[],
+ selectedPipelines: PipelineSummaryDto[],
action: boolean,
forceStop = false,
) {
@@ -212,7 +213,7 @@ export class PipelineOverviewComponent implements OnInit,
OnDestroy {
}
executeSelectedPipelineAction(
- event: SpTableMultiActionExecuteEvent<Pipeline>,
+ event: SpTableMultiActionExecuteEvent<PipelineSummaryDto>,
) {
if (
!this.hasPipelineWritePrivileges ||
diff --git
a/ui/src/app/pipelines/dialog/delete-pipeline/delete-pipeline-dialog.component.html
b/ui/src/app/pipelines/dialog/delete-pipeline/delete-pipeline-dialog.component.html
index 37d3339e76..476d67b0cf 100644
---
a/ui/src/app/pipelines/dialog/delete-pipeline/delete-pipeline-dialog.component.html
+++
b/ui/src/app/pipelines/dialog/delete-pipeline/delete-pipeline-dialog.component.html
@@ -31,11 +31,11 @@
'Do you really want to delete pipeline'
| translate
}}
- {{ pipeline.name }}?
+ {{ name }}?
</h4></b
>
<b>
- @if (pipeline.running) {
+ @if (running) {
<h4>
{{
'This pipeline is still running.'
@@ -55,7 +55,7 @@
fxLayoutAlign="center center"
fxLayout="column"
>
- @if (!pipeline.running) {
+ @if (!running) {
<button
mat-button
mat-flat-button
@@ -65,7 +65,7 @@
{{ 'Delete pipeline' | translate }}
</button>
}
- @if (pipeline.running) {
+ @if (running) {
<button
mat-button
mat-flat-button
diff --git
a/ui/src/app/pipelines/dialog/delete-pipeline/delete-pipeline-dialog.component.ts
b/ui/src/app/pipelines/dialog/delete-pipeline/delete-pipeline-dialog.component.ts
index 98d42f58bb..b9745659a6 100644
---
a/ui/src/app/pipelines/dialog/delete-pipeline/delete-pipeline-dialog.component.ts
+++
b/ui/src/app/pipelines/dialog/delete-pipeline/delete-pipeline-dialog.component.ts
@@ -17,7 +17,7 @@
*/
import { Component, inject, Input } from '@angular/core';
-import { Pipeline, PipelineService } from '@streampipes/platform-services';
+import { PipelineService } from '@streampipes/platform-services';
import { DialogRef } from '@streampipes/shared-ui';
import { TranslatePipe, TranslateService } from '@ngx-translate/core';
import {
@@ -43,8 +43,17 @@ import { MatDivider } from '@angular/material/divider';
],
})
export class DeletePipelineDialogComponent {
+ // @Input()
+ // pipeline: Pipeline;
+
+ @Input()
+ name: string;
+
+ @Input()
+ elementId: string;
+
@Input()
- pipeline: Pipeline;
+ running: boolean;
isInProgress = false;
currentStatus: any;
@@ -65,7 +74,7 @@ export class DeletePipelineDialogComponent {
'Deleting pipeline...',
);
this.pipelineService
- .deleteOwnPipeline(this.pipeline._id)
+ .deleteOwnPipeline(this.elementId)
.subscribe(_data => {
this.close(true);
});
@@ -76,7 +85,7 @@ export class DeletePipelineDialogComponent {
this.currentStatus = this.translateService.instant(
'Stopping pipeline...',
);
- this.pipelineService.stopPipeline(this.pipeline._id).subscribe(
+ this.pipelineService.stopPipeline(this.elementId).subscribe(
_data => {
this.deletePipeline();
},
diff --git
a/ui/src/app/pipelines/dialog/pipeline-notifications/pipeline-notifications.component.html
b/ui/src/app/pipelines/dialog/pipeline-notifications/pipeline-notifications.component.html
index 98d1f27723..ed50403646 100644
---
a/ui/src/app/pipelines/dialog/pipeline-notifications/pipeline-notifications.component.html
+++
b/ui/src/app/pipelines/dialog/pipeline-notifications/pipeline-notifications.component.html
@@ -18,27 +18,34 @@
<div class="sp-dialog-container" fxLayout="column">
<div class="sp-dialog-content p-15" fxFlex="100" fxLayout="column">
- <div class="info-message">
- {{
- 'Pipeline health monitoring discovered the following issues:'
- | translate
- }}
- </div>
- <div class="log-message" fxFlex="100" fxLayout="column">
- @for (
- notification of pipeline.pipelineNotifications;
- track notification
- ) {
- <span class="text-xs" data-cy="pipeline-notification">
- {{ notification }}
- </span>
- <br />
- }
- </div>
+ @if (pipeline) {
+ <div class="info-message">
+ {{
+ 'Pipeline health monitoring discovered the following
issues:'
+ | translate
+ }}
+ </div>
+ <div class="log-message" fxFlex="100" fxLayout="column">
+ @for (
+ notification of pipeline.pipelineNotifications;
+ track notification
+ ) {
+ <span class="text-xs" data-cy="pipeline-notification">
+ {{ notification }}
+ </span>
+ <br />
+ }
+ </div>
+ } @else {
+ <div fxFlex="100" fxLayout="column" fxLayoutAlign="start center">
+ <mat-spinner [diameter]="20"></mat-spinner>
+ </div>
+ }
</div>
<mat-divider></mat-divider>
<div class="sp-dialog-actions actions-align-right">
<button
+ [disabled]="!pipeline"
mat-button
mat-flat-button
color="accent"
diff --git
a/ui/src/app/pipelines/dialog/pipeline-notifications/pipeline-notifications.component.ts
b/ui/src/app/pipelines/dialog/pipeline-notifications/pipeline-notifications.component.ts
index b950427485..e0f3f41932 100644
---
a/ui/src/app/pipelines/dialog/pipeline-notifications/pipeline-notifications.component.ts
+++
b/ui/src/app/pipelines/dialog/pipeline-notifications/pipeline-notifications.component.ts
@@ -17,12 +17,18 @@
*/
import { DialogRef } from '@streampipes/shared-ui';
-import { Pipeline, PipelineService } from '@streampipes/platform-services';
-import { Component, Input, inject } from '@angular/core';
+import {
+ Pipeline,
+ PipelineService,
+ PipelineSummaryDto,
+} from '@streampipes/platform-services';
+import { Component, inject, Input, OnInit } from '@angular/core';
import { FlexDirective, LayoutDirective } from '@ngbracket/ngx-layout/flex';
import { MatDivider } from '@angular/material/divider';
import { MatButton } from '@angular/material/button';
import { TranslatePipe } from '@ngx-translate/core';
+import { MatProgressSpinner } from '@angular/material/progress-spinner';
+import { LayoutAlignDirective } from '@ngbracket/ngx-layout';
@Component({
selector: 'sp-pipeline-notifications',
@@ -34,16 +40,28 @@ import { TranslatePipe } from '@ngx-translate/core';
MatDivider,
MatButton,
TranslatePipe,
+ MatProgressSpinner,
+ LayoutAlignDirective,
],
})
-export class PipelineNotificationsComponent {
+export class PipelineNotificationsComponent implements OnInit {
private dialogRef =
inject<DialogRef<PipelineNotificationsComponent>>(DialogRef);
private pipelineService = inject(PipelineService);
@Input()
+ pipelineSummary: PipelineSummaryDto;
+
pipeline: Pipeline;
+ ngOnInit() {
+ this.pipelineService
+ .getPipelineById(this.pipelineSummary.elementId)
+ .subscribe(p => {
+ this.pipeline = p;
+ });
+ }
+
acknowledgeAndClose() {
this.pipeline.pipelineNotifications = [];
if (this.pipeline.healthStatus === 'REQUIRES_ATTENTION') {
diff --git a/ui/src/app/pipelines/pipelines.component.ts
b/ui/src/app/pipelines/pipelines.component.ts
index c0fc480d2a..5f94bcc0e6 100644
--- a/ui/src/app/pipelines/pipelines.component.ts
+++ b/ui/src/app/pipelines/pipelines.component.ts
@@ -22,6 +22,7 @@ import {
FunctionsService,
Pipeline,
PipelineService,
+ PipelineSummaryDto,
} from '@streampipes/platform-services';
import {
CurrentUserService,
@@ -74,8 +75,8 @@ import { TranslatePipe } from '@ngx-translate/core';
})
export class PipelinesComponent implements OnInit, OnDestroy {
pipeline: Pipeline;
- pipelines: Pipeline[] = [];
- filteredPipelines: Pipeline[] = [];
+ pipelines: PipelineSummaryDto[] = [];
+ filteredPipelines: PipelineSummaryDto[] = [];
starting = false;
stopping = false;
@@ -139,8 +140,8 @@ export class PipelinesComponent implements OnInit,
OnDestroy {
getPipelines() {
this.pipelines = [];
- this.pipelineService.getPipelines().subscribe(pipelines => {
- this.pipelines = pipelines.sort((a, b) =>
+ this.pipelineService.getPipelineSummary().subscribe(resourceSummary =>
{
+ this.pipelines = resourceSummary.resources.sort((a, b) =>
a.name.localeCompare(b.name),
);
this.applyPipelineFilters(this.currentFilters);
diff --git a/ui/src/app/pipelines/services/pipeline-operations.service.ts
b/ui/src/app/pipelines/services/pipeline-operations.service.ts
index 1fab25370e..1a2e0fa37b 100644
--- a/ui/src/app/pipelines/services/pipeline-operations.service.ts
+++ b/ui/src/app/pipelines/services/pipeline-operations.service.ts
@@ -16,13 +16,13 @@
*
*/
-import { EventEmitter, Injectable, inject } from '@angular/core';
-import { Pipeline } from '@streampipes/platform-services';
+import { EventEmitter, inject, Injectable } from '@angular/core';
+import { PipelineSummaryDto } from '@streampipes/platform-services';
import {
- PanelType,
- DialogService,
DialogRef,
+ DialogService,
ObjectPermissionDialogComponent,
+ PanelType,
} from '@streampipes/shared-ui';
import { PipelineStatusDialogComponent } from
'../dialog/pipeline-status/pipeline-status-dialog.component';
import { DeletePipelineDialogComponent } from
'../dialog/delete-pipeline/delete-pipeline-dialog.component';
@@ -93,7 +93,9 @@ export class PipelineOperationsService {
}
showDeleteDialog(
- pipeline: Pipeline,
+ elementId: string,
+ name: string,
+ running: boolean,
refreshPipelinesEmitter: EventEmitter<boolean>,
switchToPipelineView?: any,
) {
@@ -103,7 +105,9 @@ export class PipelineOperationsService {
title: 'Delete Pipeline',
width: '70vw',
data: {
- pipeline: pipeline,
+ elementId,
+ name,
+ running,
},
});
@@ -134,7 +138,7 @@ export class PipelineOperationsService {
}
showPipelineNotificationsDialog(
- pipeline: Pipeline,
+ pipelineSummary: PipelineSummaryDto,
refreshPipelinesEmitter: EventEmitter<boolean>,
) {
const dialogRef: DialogRef<PipelineNotificationsComponent> =
@@ -143,7 +147,7 @@ export class PipelineOperationsService {
title: 'Pipeline Notifications',
width: '70vw',
data: {
- pipeline: pipeline,
+ pipelineSummary: pipelineSummary,
},
});
@@ -153,7 +157,7 @@ export class PipelineOperationsService {
}
showPermissionsDialog(
- pipeline: Pipeline,
+ pipelineSummary: PipelineSummaryDto,
refreshPipelinesEmitter: EventEmitter<boolean>,
) {
const dialogRef = this.dialogService.open(
@@ -163,9 +167,10 @@ export class PipelineOperationsService {
title: 'Manage permissions',
width: '70vw',
data: {
- objectInstanceId: pipeline._id,
+ objectInstanceId: pipelineSummary.elementId,
headerTitle:
- 'Manage permissions for pipeline ' + pipeline.name,
+ 'Manage permissions for pipeline ' +
+ pipelineSummary.name,
},
},
);