web: add middleware that shows message for failed API requests

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-03-27 23:18:51 +01:00
parent 1a53bc3de5
commit 035771de81
3 changed files with 24 additions and 4 deletions

View File

@ -39,7 +39,7 @@ export class APIMiddleware implements Middleware {
}
export const MAX_REQUESTS = 50;
export const MIDDLEWARE = new APIMiddleware();
export const API_DRAWER_MIDDLEWARE = new APIMiddleware();
@customElement("ak-api-drawer")
export class APIDrawer extends LitElement {
@ -76,7 +76,7 @@ export class APIDrawer extends LitElement {
</div>
<div class="pf-c-notification-drawer__body">
<ul class="pf-c-notification-drawer__list">
${MIDDLEWARE.requests.map(n => this.renderItem(n))}
${API_DRAWER_MIDDLEWARE.requests.map(n => this.renderItem(n))}
</ul>
</div>
</div>