You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ri...@apache.org on 2020/09/12 11:31:13 UTC
[incubator-streampipes] 01/02: [hotfix] Show error if runtime info
is not available
This is an automated email from the ASF dual-hosted git repository.
riemer pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git
commit 95340c86eac15d575c7ec18253ba7a0d16c72f44
Author: Dominik Riemer <ri...@fzi.de>
AuthorDate: Sat Sep 12 00:32:32 2020 +0200
[hotfix] Show error if runtime info is not available
---
.../pipeline-element-runtime-info.component.html | 5 ++++-
.../pipeline-element-runtime-info.component.ts | 24 ++++++++++++++--------
2 files changed, 19 insertions(+), 10 deletions(-)
diff --git a/ui/src/app/connect/components/runtime-info/pipeline-element-runtime-info.component.html b/ui/src/app/connect/components/runtime-info/pipeline-element-runtime-info.component.html
index 4537a96..af1bd91 100644
--- a/ui/src/app/connect/components/runtime-info/pipeline-element-runtime-info.component.html
+++ b/ui/src/app/connect/components/runtime-info/pipeline-element-runtime-info.component.html
@@ -16,7 +16,7 @@
~
-->
-<div *ngIf="!runtimeData">
+<div *ngIf="!runtimeData && !runtimeDataError">
<div fxLayout="column">
<div fxLayoutAlign="center" >
<mat-spinner [diameter]="40" fxLayoutAlign="center" style="margin: 10px 0 5px 0" >Loading</mat-spinner>
@@ -44,4 +44,7 @@
</tr>
</tbody>
</table>
+</div>
+<div *ngIf="runtimeDataError">
+ <p>Preview is currently unavailable.</p>
</div>
\ No newline at end of file
diff --git a/ui/src/app/connect/components/runtime-info/pipeline-element-runtime-info.component.ts b/ui/src/app/connect/components/runtime-info/pipeline-element-runtime-info.component.ts
index 2481972..8be823b 100644
--- a/ui/src/app/connect/components/runtime-info/pipeline-element-runtime-info.component.ts
+++ b/ui/src/app/connect/components/runtime-info/pipeline-element-runtime-info.component.ts
@@ -34,6 +34,7 @@ export class PipelineElementRuntimeInfoComponent implements OnInit, OnDestroy {
runtimeData: any;
timer: any;
+ runtimeDataError: boolean = false;
constructor(private RestService: RestService) {
@@ -51,15 +52,20 @@ export class PipelineElementRuntimeInfoComponent implements OnInit, OnDestroy {
getLatestRuntimeInfo() {
this.RestService.getRuntimeInfo(this.streamDescription).subscribe(data => {
- if (!(Object.keys(data).length === 0 && data.constructor === Object)) {
- this.runtimeData = data;
- }
-
- if (this._pollingActive) {
- this.timer = setTimeout(() => {
- this.getLatestRuntimeInfo();
- }, 1000);
- }
+ if (data) {
+ this.runtimeDataError = false;
+ if (!(Object.keys(data).length === 0 && data.constructor === Object)) {
+ this.runtimeData = data;
+ }
+
+ if (this._pollingActive) {
+ this.timer = setTimeout(() => {
+ this.getLatestRuntimeInfo();
+ }, 1000);
+ }
+ } else {
+ this.runtimeDataError = true;
+ }
});
}