ServerAudit: add post message status checker

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ic455e3fe3cd731d73056693f8523342bed70027d
This commit is contained in:
Szymon Kłos 2024-07-16 13:21:07 +02:00 committed by Szymon Kłos
parent 595fb45132
commit 321c41cd51

View file

@ -17,6 +17,21 @@ interface AuditEntry {
code: string;
status: string;
}
class ClientAuditor {
private static checkPostMessages(entries: Array<AuditEntry>) {
if ((window as any).WOPIPostmessageReady)
entries.push({ code: 'postmessage', status: 'ok' });
else entries.push({ code: 'postmessage', status: 'hostnotready' });
}
public static performClientAudit(): Array<AuditEntry> {
const entries = new Array<AuditEntry>();
ClientAuditor.checkPostMessages(entries);
return entries;
}
}
class ServerAuditDialog {
map: any;
id: string = 'ServerAuditDialog';
@ -61,14 +76,9 @@ class ServerAuditDialog {
};
}
private performClientAudit(): Array<AuditEntry> {
const entries = new Array<AuditEntry>();
return entries;
}
public open() {
const serverEntries = this.getEntries(app.serverAudit);
const clientEntries = this.getEntries(this.performClientAudit());
const clientEntries = this.getEntries(ClientAuditor.performClientAudit());
const dialogBuildEvent = {
data: this.getJSON(serverEntries.concat(clientEntries)),