ui now showing "not connected"

This commit is contained in:
Patrick Haßel 2025-07-31 11:39:07 +02:00
parent f6d5c4ccda
commit f6406d0dec
3 changed files with 27 additions and 5 deletions

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50">
<circle style="fill:#D75A4A;" cx="25" cy="25" r="25"/>
<polyline style="fill:none;stroke:#FFFFFF;stroke-width:2;stroke-linecap:round;stroke-miterlimit:10;" points="16,34 25,25 34,16"/>
<polyline style="fill:none;stroke:#FFFFFF;stroke-width:2;stroke-linecap:round;stroke-miterlimit:10;" points="16,16 25,25 34,34"/>
</svg>

After

Width:  |  Height:  |  Size: 433 B

View File

@ -10,13 +10,21 @@ import {RxStompState} from '@stomp/rx-stomp';
}) })
export class ApiService { export class ApiService {
private _connected: boolean = false;
get connected(): boolean {
return this._connected;
}
constructor( constructor(
readonly http: HttpClient, readonly http: HttpClient,
readonly stomp: RxStompService, readonly stomp: RxStompService,
) { ) {
this.onConnect(() => this._connected = true);
this.onDisconnect(() => this._connected = false);
} }
getNone<T>(path: any[], next?: Next<void>): void { getNone(path: any[], next?: Next<void>): void {
this.http.get<void>(url('http', path)).subscribe(next); this.http.get<void>(url('http', path)).subscribe(next);
} }
@ -28,7 +36,7 @@ export class ApiService {
this.http.get<any[]>(url('http', path)).pipe(map(list => list.map(fromJson))).subscribe(next); this.http.get<any[]>(url('http', path)).pipe(map(list => list.map(fromJson))).subscribe(next);
} }
postNone<T>(path: any[], data: any, next?: Next<void>): void { postNone(path: any[], data: any, next?: Next<void>): void {
this.http.post<void>(url('http', path), data).subscribe(next); this.http.post<void>(url('http', path), data).subscribe(next);
} }

View File

@ -12,9 +12,7 @@ body {
text-decoration: underline; text-decoration: underline;
} }
.hint { .message {
background-color: lightyellow;
border: 0.1em solid yellow;
margin: 0.5em; margin: 0.5em;
padding: 0.25em; padding: 0.25em;
font-size: 60%; font-size: 60%;
@ -25,3 +23,13 @@ body {
vertical-align: bottom; vertical-align: bottom;
} }
} }
.messageInfo {
background-color: lightyellow;
border: 0.1em solid yellow;
}
.messageError {
background-color: #fdaaaa;
border: 0.1em solid red;
}