diff --git a/ui/src/routes/+layout.svelte b/ui/src/routes/+layout.svelte index 90a93f0..366e641 100644 --- a/ui/src/routes/+layout.svelte +++ b/ui/src/routes/+layout.svelte @@ -38,8 +38,8 @@ } let title = 'happyDomain'; - $: if ($page.data.selectedDomain) { - title = $page.data.selectedDomain.domain.substring(0, $page.data.selectedDomain.domain.length - 1) + ' - happyDomain'; + $: if ($page.data.domain) { + title = $page.data.domain.domain.substring(0, $page.data.domain.domain.length - 1) + ' - happyDomain'; } else { title = 'happyDomain'; } diff --git a/ui/src/routes/domains/[dn]/+layout.svelte b/ui/src/routes/domains/[dn]/+layout.svelte new file mode 100644 index 0000000..519450a --- /dev/null +++ b/ui/src/routes/domains/[dn]/+layout.svelte @@ -0,0 +1,304 @@ + + + + + + {#if $domains_idx[selectedDomain]} +
+ + + {#each Object.keys($domains_by_groups) as gname} + {@const group = $domains_by_groups[gname]} + + {#each group as domain} + + {/each} + + {/each} + +
+ + {#if $page.data.isHistoryPage || $page.data.isAuditPage} + + {:else if $page.data.streamed && $sortedDomains} +
+ + + + {#if retrievalInProgress} + + {:else} + + + + {data.domain.domain} + + + {$t('domains.actions.history')} + + + {$t('domains.actions.audit')} + + + + {$t('domains.actions.view')} + + + {$t('domains.actions.reimport')} + + + {$t('domains.actions.upload')} + + + + {$t('domains.actions.share')} + + ctrlDomainDelete.Open()} + > + {$t('domains.stop')} + + + + {$t('provider.update')} + + + +
+ {#await $page.data.streamed.zone then z} +
+ {#each $sortedDomains as dn} + + {fqdn(dn, data.domain.domain)} + + {/each} +
+ {/await} + {/if} + +
+ + {#if $page.data.isZonePage && data.domain.zone_history && $domains_idx[selectedDomain] && data.domain.id === $domains_idx[selectedDomain].id} + + {#if $domains_idx[selectedDomain].zone_history && selectedHistory === $domains_idx[selectedDomain].zone_history[0]} + + {:else} + + {/if} + +

+ X changes +

+ {/if} + {:else} +
+ +
+ {/if} + + + + + + + + + + + + + + + + diff --git a/ui/src/routes/domains/[dn]/+layout.ts b/ui/src/routes/domains/[dn]/+layout.ts index 56f4046..0e2c01e 100644 --- a/ui/src/routes/domains/[dn]/+layout.ts +++ b/ui/src/routes/domains/[dn]/+layout.ts @@ -17,8 +17,14 @@ export const load: Load = async({ parent, params }) => { }); } + let historyid = undefined; + if (domain.zone_history && domain.zone_history.length > 0) { + historyid = domain.zone_history[0]; + } + return { domain, + history: historyid, ...data, } } diff --git a/ui/src/routes/domains/[dn]/[[historyid]]/+layout.svelte b/ui/src/routes/domains/[dn]/[[historyid]]/+layout.svelte index 9d73054..d25f9d0 100644 --- a/ui/src/routes/domains/[dn]/[[historyid]]/+layout.svelte +++ b/ui/src/routes/domains/[dn]/[[historyid]]/+layout.svelte @@ -1,51 +1,19 @@ - - - - {#if $domains_idx[selectedDomain]} -
- - - {#each Object.keys($domains_by_groups) as gname} - {@const group = $domains_by_groups[gname]} - - {#each group as domain} - - {/each} - - {/each} - -
+{#if data.history == selectedHistory} + +{:else} +
+ +

{$t('wait.loading')}

+
+{/if} - {#if data && data.streamed && $sortedDomains} -
- - - - {#if retrievalInProgress} - - {:else} - - - - {data.domain.domain} - - - {$t('domains.actions.history')} - - - {$t('domains.actions.audit')} - - - - {$t('domains.actions.view')} - - - {$t('domains.actions.reimport')} - - - {$t('domains.actions.upload')} - - - - {$t('domains.actions.share')} - - ctrlDomainDelete.Open()} - > - {$t('domains.stop')} - - - - {$t('provider.update')} - - - -
- {#await data.streamed.zone then z} -
- {#each $sortedDomains as dn} - - {fqdn(dn, data.domain.domain)} - - {/each} -
- {/await} - {/if} - -
- - {#if data.domain.zone_history && $domains_idx[selectedDomain] && data.domain.id === $domains_idx[selectedDomain].id} - - {#if $domains_idx[selectedDomain].zone_history && selectedHistory === $domains_idx[selectedDomain].zone_history[0]} - - {:else} - - {/if} - - {/if} -

- X changes -

- {:else} -
- -
- {/if} - - - {#if data.history == selectedHistory} - - {:else} -
- -

{$t('wait.loading')}

-
- {/if} - - - - - {#await data.streamed.zone then zone} thisZone.set(event.detail)} /> {/await} - - - - - - - - diff --git a/ui/src/routes/domains/[dn]/[[historyid]]/+layout.ts b/ui/src/routes/domains/[dn]/[[historyid]]/+layout.ts index 93ca344..1c707c2 100644 --- a/ui/src/routes/domains/[dn]/[[historyid]]/+layout.ts +++ b/ui/src/routes/domains/[dn]/[[historyid]]/+layout.ts @@ -31,11 +31,11 @@ export const load: Load = async({ parent, params }) => { const zone = getZone(domain, zoneId); return { + ...data, history: params.historyid, zoneId, streamed: { zone, }, - ...data, } } diff --git a/ui/src/routes/domains/[dn]/[[historyid]]/+page.ts b/ui/src/routes/domains/[dn]/[[historyid]]/+page.ts new file mode 100644 index 0000000..36184be --- /dev/null +++ b/ui/src/routes/domains/[dn]/[[historyid]]/+page.ts @@ -0,0 +1,10 @@ +import type { Load } from '@sveltejs/kit'; + +export const load: Load = async({ parent }) => { + const data = await parent(); + + return { + ...data, + isZonePage: true, + } +}