added the log id in the query params

This commit is contained in:
Gani Georgiev
2023-12-03 11:39:40 +02:00
parent 6416328c3b
commit 559aad36a3
32 changed files with 213 additions and 143 deletions
+18 -1
View File
@@ -15,6 +15,7 @@
$pageTitle = "Logs";
const LOG_QUERY_KEY = "logId";
const ADMIN_REQUESTS_QUERY_KEY = "adminRequests";
const ADMIN_REQUESTS_STORAGE_KEY = "adminLogRequests";
@@ -29,6 +30,10 @@
window.localStorage?.getItem(ADMIN_REQUESTS_STORAGE_KEY)) << 0;
let initialWithAdminLogs = withAdminLogs;
$: if (initialQueryParams.get(LOG_QUERY_KEY) && logViewPanel) {
logViewPanel.show(initialQueryParams.get(LOG_QUERY_KEY));
}
$: presets = !withAdminLogs ? 'data.auth!="admin"' : "";
$: if (initialWithAdminLogs != withAdminLogs) {
@@ -100,6 +105,18 @@
{/key}
</PageWrapper>
<LogViewPanel bind:this={logViewPanel} />
<LogViewPanel
bind:this={logViewPanel}
on:show={(e) => {
let query = {};
query[LOG_QUERY_KEY] = e.detail?.id || null;
CommonHelper.replaceHashQueryParams(query);
}}
on:hide={() => {
let query = {};
query[LOG_QUERY_KEY] = null;
CommonHelper.replaceHashQueryParams(query);
}}
/>
<LogsSettingsPanel bind:this={logsSettingsPanel} on:save={refresh} />