-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add public certificates route (#458)
* add public certificates route * Update redirect to /cloud --------- Co-authored-by: Angelika Schneider <[email protected]>
- Loading branch information
Showing
4 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<script lang="ts"> | ||
import { Card, CardBody, CardHeader, CardText } from 'sveltestrap'; | ||
import type { Certificate } from '$lib/orchestrator'; | ||
export let certificate: Certificate; | ||
</script> | ||
|
||
<Card class="mb-3 me-3"> | ||
<CardHeader><b>"{certificate.name}"</b></CardHeader> | ||
<CardBody> | ||
<CardText> | ||
<p> | ||
<b>ID:</b> | ||
{certificate.id} <br /> | ||
<b>Name:</b> | ||
{certificate.name} <br /> | ||
<b>Service ID:</b> | ||
{certificate.cloudServiceId} <br /> | ||
<b>Issue Date:</b> | ||
{certificate.issueDate} <br /> | ||
<b>Expiration Date:</b> | ||
{certificate.expirationDate} <br /> | ||
<b>Schema:</b> | ||
{certificate.standard} <br /> | ||
<b>Assurance Level:</b> | ||
{certificate.assuranceLevel} <br /> | ||
<b>CAB:</b> | ||
{certificate.cab} <br /> | ||
<b>Description:</b> | ||
{certificate.description} <br /> | ||
</p> | ||
<hr /> | ||
</CardText> | ||
</CardBody> | ||
</Card> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<script lang="ts"> | ||
import { Col, Container, Row } from 'sveltestrap'; | ||
import PublicCertificateCard from '$lib/PublicCertificateCard.svelte'; | ||
import type { PageData } from './$types'; | ||
export let data: PageData; | ||
let { certificates } = data; | ||
</script> | ||
|
||
<h3>Certificates</h3> | ||
|
||
{#if certificates} | ||
<Container class="mt-4 ms-0 me-0"> | ||
<Row cols={2} noGutters> | ||
{#each certificates as certificate, i} | ||
<Col> | ||
<PublicCertificateCard {certificate} /> | ||
</Col> | ||
{/each} | ||
</Row> | ||
</Container> | ||
{:else} | ||
No certificates issued yet. | ||
{/if} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { listPublicCertificates } from '$lib/orchestrator'; | ||
import { redirectLogin } from '$lib/oauth'; | ||
|
||
/** | ||
* @type {import('@sveltejs/kit').PageLoad} | ||
*/ | ||
export async function load({ params, fetch, context }) { | ||
return listPublicCertificates() | ||
.then((certificates) => { | ||
return { | ||
certificates: certificates | ||
}; | ||
}) | ||
.catch(() => { | ||
redirectLogin('/cloud'); | ||
}); | ||
} |