Skip to content
Snippets Groups Projects
Commit 099321f9 authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

Add a loading spinner

parent 39a116a8
No related branches found
No related tags found
No related merge requests found
...@@ -4,6 +4,7 @@ import {html} from 'lit-element'; ...@@ -4,6 +4,7 @@ import {html} from 'lit-element';
import VPULitElement from 'vpu-common/vpu-lit-element' import VPULitElement from 'vpu-common/vpu-lit-element'
import {getAPiUrl} from "./utils"; import {getAPiUrl} from "./utils";
import commonUtils from "vpu-common/utils"; import commonUtils from "vpu-common/utils";
import "vpu-common/vpu-mini-spinner.js";
import {unsafeHTML} from 'lit-html/directives/unsafe-html.js'; import {unsafeHTML} from 'lit-html/directives/unsafe-html.js';
/** /**
...@@ -93,6 +94,7 @@ class VPUKnowledgeBaseWebPageElementView extends VPULitElement { ...@@ -93,6 +94,7 @@ class VPUKnowledgeBaseWebPageElementView extends VPULitElement {
} }
const error_head = i18n.t('error-head'); const error_head = i18n.t('error-head');
that.error = html`<p>${error_head} "<b>${that.value}</b>" ${status_msg} (${res.status}).</p>`; that.error = html`<p>${error_head} "<b>${that.value}</b>" ${status_msg} (${res.status}).</p>`;
that.html = "";
throw new Error('HTTP ' + error_head + ' ' + that.value + ' ' + status_msg + ', status = ' + res.status); throw new Error('HTTP ' + error_head + ' ' + that.value + ' ' + status_msg + ', status = ' + res.status);
} }
return res.json(); return res.json();
...@@ -147,6 +149,7 @@ class VPUKnowledgeBaseWebPageElementView extends VPULitElement { ...@@ -147,6 +149,7 @@ class VPUKnowledgeBaseWebPageElementView extends VPULitElement {
img.src = this.eyeOpen; img.src = this.eyeOpen;
} }
if (this.html === '' && div.style.display !== 'none') { if (this.html === '' && div.style.display !== 'none') {
this.html = "<vpu-mini-spinner></vpu-mini-spinner>";
this.loadWebPageElement(); this.loadWebPageElement();
} }
} }
......
common @ 8535e4d2
Subproject commit 378256b0ae92712fd5b8feed3a987cd014617c0b Subproject commit 8535e4d2813417d35e592fc82bd7cee552b2d1ed
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment