This is an automated email from the ASF dual-hosted git repository. riemer pushed a commit to branch rel/0.67.0 in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git
commit 647d49bea54a105fd7cf2ff0a8272d53e6efc26f Author: Dominik Riemer <[email protected]> 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; + } }); }
