Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix public certificates page #459

Merged
merged 1 commit into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/lib/CertificateCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export let certificate: Certificate;
</td>
<td>{state.timestamp}</td>
<!-- When it is a new certificate, there is no tree yet -->
<!-- svelte-ignore empty-block -->
{#if state.state == 'new'}
{:else}
<td><a href="https://cce-test.k8s.medina.esilab.org/#/?treeStateId={state.treeId}">{state.treeId}</a></td>
Expand Down
5 changes: 5 additions & 0 deletions src/lib/Navigation.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ console.log($page.url);
</NavLink>
</NavItem>
{/each} -->
<!--TODO: if not logged in, don't show-->
{#if loggedIn}
<NavItem>
<NavLink active={$page.url.pathname.startsWith("/cloud")} href="{base}{"/cloud"}">
<Fa icon={faCloud} /> Cloud Services
Expand All @@ -87,12 +89,14 @@ console.log($page.url);
<Fa icon={faCertificate} /> Certificates
</NavLink>
</NavItem>
{/if}
<!--TODO: if logged in, don't show-->
{#if !loggedIn}
<NavItem>
<NavLink href="{base}/login">Login</NavLink>
</NavItem>
{/if}

<NavItem>
<NavLink href="https://medina-project.eu/wp-content/uploads/MEDINA_User_Manuals/MEDINA_Orchestrator_UserManual.pdf" target="_blank">
<Fa icon={faQuestion} /> Help
Expand All @@ -110,6 +114,7 @@ console.log($page.url);
</Nav>
</Collapse>
</Navbar>

<div style="clear: both;"></div>

<style>
Expand Down
8 changes: 7 additions & 1 deletion src/routes/+layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@ export const load: LayoutLoad = async ({ fetch }) => {
})
.catch(() => {
// ignore, we will catch it later
console.error("error getting metrics")
return
});

listControls(null, null, fetch).then((list) => {
controls.set(list);
})
.catch(() => {
// ignore, we will catch it later
console.error("error getting controls")
return
});

try {
Expand All @@ -34,7 +38,9 @@ export const load: LayoutLoad = async ({ fetch }) => {
redirect: '/cloud'
}
} catch (error) {
return redirectLogin('/cloud');
console.warn("error start page load function")
return
// return redirectLogin('/cloud');
}
}

Expand Down
1 change: 0 additions & 1 deletion src/routes/catalogs/[id]/categories/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
<script lang="ts">
export let data: import('./$types').PageData;
</script>
2 changes: 1 addition & 1 deletion src/routes/public/certificates/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { redirectLogin } from '$lib/oauth';
/**
* @type {import('@sveltejs/kit').PageLoad}
*/
export async function load({ params, fetch, context }) {
export async function load({ params, fetch }) {
return listPublicCertificates()
.then((certificates) => {
return {
Expand Down
Loading