")
+ .append($("")
+ .addClass("date")
+ .text(timestamp.toLocaleDateString()))
+ .append($(" | ")
+ .addClass("time")
+ .text(timestamp.toLocaleTimeString()))
+ .append($(" | ")
+ .addClass(`type-${entry.eventType.toLowerCase()}`)
+ .text($.i18n(`audit/type/${entry.eventType}`)))
+ .append($(" | ")
+ .addClass(`source-${entry.eventSource.toLowerCase()}`)
+ .text($.i18n(`audit/source/${entry.eventSource}`)))
+ .append($(" | ")
+ .addClass("message")
+ .text(entry.message))
+ );
+ });
+ }
+
+ showLogJSON(entries) {
+ this.elements.auditTextArea.text(
+ JSON.stringify(entries, null, " ")
+ );
+ }
+
+ showLogPlain(entries) {
+ let str = "";
+ entries.forEach((entry) => {
+ str += `${entry.timestamp} ${entry.eventType} ${entry.eventSource} | ${entry.message}\n`;
+ });
+ this.elements.auditTextArea.text(str);
+ }
+
+ filterEntries(entries) {
+ const type = this.elements.typeSelect.val();
+ const typeVal = this.eventTypes.get(type);
+ const typeFiltered = entries.filter(e => this.eventTypes.get(e.eventType) <= typeVal);
+ const source = this.elements.sourceSelect.val();
+ if (source !== "ANY") {
+ return typeFiltered.filter(e => e.eventSource === source);
+ }
+ return typeFiltered;
+ }
+
+ showLog() {
+ this.elements.auditTextArea.empty();
+ this.elements.auditRaw.addClass("hidden");
+ this.elements.auditTableBody.empty();
+ this.elements.auditTable.addClass("hidden");
+ const entries = this.filterEntries(this.auditLog.entries);
+
+ const format = this.elements.formatSelect.val();
+ if (format === "TABLE") {
+ this.elements.auditTable.removeClass("hidden");
+ this.showLogTable(entries);
+ } else {
+ this.elements.auditRaw.removeClass("hidden");
+
+ if (format === "JSON") {
+ this.showLogJSON(entries);
+ } else if (format === "PLAIN") {
+ this.showLogPlain(entries);
+ }
+ }
+
+ this.elements.auditItems.empty();
+ this.elements.auditItems.text(entries.length);
+ }
+
+ launch() {
+ this.level = DialogSystem.showDialog(this.frame);
+ }
+
+ dismiss() {
+ DialogSystem.dismissUntil(this.level - 1);
+ this.level = null;
+ }
+
+ bindActions() {
+ this.elements.closeButton.click(() => {
+ this.dismiss();
+ });
+ this.elements.typeSelect.on("change", () => {
+ this.showLog();
+ });
+ this.elements.sourceSelect.on("change", () => {
+ this.showLog();
+ });
+ this.elements.formatSelect.on("change", () => {
+ this.showLog();
+ });
+ this.elements.refreshButton.click(() => {
+ this.refreshLog();
+ });
+ this.elements.clearButton.click(() => {
+ this.clearLog();
+ });
+ }
+
+ // launcher
+ static createAndLaunch() {
+ const dialog = new MetadataAuditDialog();
+ dialog.launch();
+ }
+}
diff --git a/src/main/resources/module/scripts/dialogs/fdp-info-dialog.html b/src/main/resources/module/scripts/dialogs/fdp-info-dialog.html
index 7852dec..b8222a2 100644
--- a/src/main/resources/module/scripts/dialogs/fdp-info-dialog.html
+++ b/src/main/resources/module/scripts/dialogs/fdp-info-dialog.html
@@ -1,7 +1,7 @@
diff --git a/src/main/resources/module/scripts/dialogs/fdp-info-dialog.js b/src/main/resources/module/scripts/dialogs/fdp-info-dialog.js
index a7a60c3..5e3c84e 100644
--- a/src/main/resources/module/scripts/dialogs/fdp-info-dialog.js
+++ b/src/main/resources/module/scripts/dialogs/fdp-info-dialog.js
@@ -13,14 +13,14 @@ class FDPInfoDialog {
let fdpName = null;
let fdpVersion = null;
let fdpBuiltAt = null;
- let fdpInstanceUrl = null;
+ let fdpPersistentUrl = null;
if (apiClient.fdpInfo !== null) {
fdpName = apiClient.fdpInfo.name;
fdpVersion = apiClient.fdpInfo.version;
fdpBuiltAt = apiClient.fdpInfo.builtAt;
}
if (apiClient.fdpConfig !== null) {
- fdpInstanceUrl = apiClient.fdpConfig.instanceUrl;
+ fdpPersistentUrl = apiClient.fdpConfig.persistentUrl;
}
const handleNull = (text) => {
@@ -32,7 +32,7 @@ class FDPInfoDialog {
this.elements.fdpInfoVersion.text(handleNull(fdpVersion));
this.elements.fdpInfoBuiltAt.text(handleNull(fdpBuiltAt));
this.elements.fdpInfoBaseUri.text(handleNull(fdpUri));
- this.elements.fdpInfoInstanceUrl.text(handleNull(fdpInstanceUrl));
+ this.elements.fdpInfoPersistentUrl.text(handleNull(fdpPersistentUrl));
}
launch() {
diff --git a/src/main/resources/module/scripts/dialogs/metadata-form-dialog.html b/src/main/resources/module/scripts/dialogs/metadata-form-dialog.html
index 7b4ac0a..eb4fb72 100644
--- a/src/main/resources/module/scripts/dialogs/metadata-form-dialog.html
+++ b/src/main/resources/module/scripts/dialogs/metadata-form-dialog.html
@@ -1,7 +1,7 @@
|