Skip to content

Commit 47b5345

Browse files
frodesundbyrbjornstadjhrv
committed
fix(div): minor adjustments and fixes to links
Co-authored-by: Roger Bjørnstad <[email protected]> Co-authored-by: Johnny Horvi <[email protected]>
1 parent 69248ea commit 47b5345

File tree

5 files changed

+23
-24
lines changed

5 files changed

+23
-24
lines changed

src/hooks.server.ts

+1-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type { HandleFetch, Handle } from '@sveltejs/kit';
22
import { env } from '$env/dynamic/private';
3-
const graphqlEndpoint = import.meta.env.VITE_GRAPHQL_ENDPOINT;
43

54
export const handleFetch: HandleFetch = async ({ event, request, fetch }) => {
65
request.headers.set(
@@ -12,16 +11,7 @@ export const handleFetch: HandleFetch = async ({ event, request, fetch }) => {
1211
'X-Goog-IAP-JWT-Assertion',
1312
event.request.headers.get('X-Goog-IAP-JWT-Assertion') || ''
1413
);
15-
16-
if (graphqlEndpoint && env.PUBLIC_GRAPHQL_ENDPOINT) {
17-
if (request.url.startsWith(env.PUBLIC_GRAPHQL_ENDPOINT)) {
18-
// clone the original request, but change the URL
19-
request = new Request(
20-
request.url.replace(env.PUBLIC_GRAPHQL_ENDPOINT, graphqlEndpoint),
21-
request
22-
);
23-
}
24-
}
14+
console.log(request.url);
2515

2616
return fetch(request);
2717
};

src/routes/team/[team]/[env]/[app]/Authentications.svelte

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@
4040
<div>
4141
{#each authz as a}
4242
{#if a.__typename === 'AzureAD'}
43-
<a href="/">Azure</a>
43+
Azure
4444
{/if}
4545
{#if a.__typename === 'IDPorten'}
46-
<a href="/">IDPorten</a>
46+
IDPorten
4747
{/if}
4848
{#if a.__typename === 'Maskinporten'}
49-
<a href="/">Maskinporten</a>
49+
Maskinporten
5050
{/if}
5151
{#if a.__typename === 'TokenX'}
52-
<a href="/">TokenX</a>
52+
TokenX
5353
{/if}
5454
{:else}
5555
<p>No authz</p>

src/routes/team/[team]/[env]/[app]/AutoScaling.svelte

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import { fragment, graphql } from '$houdini';
2+
import { AutoScalingStore, fragment, graphql } from '$houdini';
33
import type { AutoScaling } from '$houdini';
44
import CpuIcon from '$lib/icons/CpuIcon.svelte';
55
import { Tooltip } from '@nais/ds-svelte';
@@ -33,12 +33,14 @@
3333
<Tooltip content="Maximum replicas">
3434
max: {autoscaling.max}
3535
</Tooltip>
36-
<Tooltip content="CPU threshold"
37-
><div class="cpu">
38-
<div style="margin-top: 4px;"><CpuIcon /></div>
39-
{autoscaling.cpuThreshold}%
40-
</div></Tooltip
41-
>
36+
{#if autoscaling.cpuThreshold > 0}
37+
<Tooltip content="CPU threshold"
38+
><div class="cpu">
39+
<div style="margin-top: 4px;"><CpuIcon /></div>
40+
{autoscaling.cpuThreshold}%
41+
</div>
42+
</Tooltip>
43+
{/if}
4244
{/if}
4345
</div>
4446

src/routes/team/[team]/[env]/[app]/Traffic.svelte

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import { fragment, graphql } from '$houdini';
55
import type { AccessPolicy } from '$houdini';
66
import { Tooltip } from '@nais/ds-svelte';
7+
import { page } from '$app/stores';
78
89
export let app: AccessPolicy;
910
@@ -36,6 +37,8 @@
3637
}
3738
`)
3839
);
40+
$: env = $page.params.env;
41+
$: team = $page.params.team;
3942
$: internalIngress = $data.ingresses.filter((ingress) => !ingress.includes('.external.'));
4043
$: externalIngress = $data.ingresses.filter((ingress) => ingress.includes('.external.'));
4144
</script>
@@ -64,7 +67,7 @@
6467
<ul>
6568
{#each $data.accessPolicy.inbound.rules as rule}
6669
<li>
67-
<a href="/"
70+
<a href="/team/{rule.namespace || team}/{env}/{rule.application}"
6871
>{rule.application}{#if rule.namespace}.{rule.namespace}{/if}</a
6972
>
7073
</li>
@@ -91,7 +94,7 @@
9194
<ul>
9295
{#each $data.accessPolicy.outbound.rules as rule}
9396
<li>
94-
<a href="/"
97+
<a href="/team/{rule.namespace || team}/{env}/{rule.application}"
9598
>{rule.application}{#if rule.namespace}.{rule.namespace}{/if}</a
9699
>
97100
</li>

src/routes/team/[team]/[env]/[app]/deploys/+page.svelte

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
{/each}
2222
{/if}
2323

24+
{#if $AppDeploys.fetching}
25+
<p>Loading...</p>
26+
{/if}
27+
2428
{#if $AppDeploys.data}
2529
<Card>
2630
<Table zebraStripes={true}>

0 commit comments

Comments
 (0)