File tree 5 files changed +71
-21
lines changed
lib/components/persistence
routes/team/[team]/buckets
5 files changed +71
-21
lines changed Original file line number Diff line number Diff line change
1
+ <script lang =" ts" >
2
+ import { Heading } from ' @nais/ds-svelte-community' ;
3
+
4
+ interface Props {
5
+ cdnBucket: string ;
6
+ }
7
+
8
+ let { cdnBucket }: Props = $props ();
9
+ </script >
10
+
11
+ <div >
12
+ <Heading size =" small" level =" 3" >Team CDN Bucket</Heading >
13
+
14
+ <a href ="https://console.cloud.google.com/storage/browser/ {cdnBucket }" >
15
+ {cdnBucket }
16
+ </a >
17
+ </div >
Original file line number Diff line number Diff line change 27
27
height: ' 230px' ,
28
28
width: ' 300px' ,
29
29
tooltip: {
30
- // axisPointer: {
31
- // type: 'shadow'
32
- // },
33
30
trigger: ' axis' ,
34
31
formatter : (params : CallbackDataParams []) =>
35
32
` ${params [0 ].name }: <b>${euroValueFormatter (params [0 ].value as number )}</b> `
36
33
},
37
34
grid: {
38
- top: ' 50 ' ,
35
+ top: ' 20 ' ,
39
36
left: ' 0' ,
40
37
containLabel: true
41
38
},
170
167
</Detail >
171
168
</div >
172
169
</div >
173
-
174
- <EChart options ={costTransform (costData .daily .series )} />
170
+ <div style =" height: 270px;" >
171
+ <EChart options ={costTransform (costData .daily .series )} />
172
+ </div >
175
173
176
174
<a href ="/team/ {teamSlug }/cost" >See cost details</a >
177
175
</div >
Original file line number Diff line number Diff line change 13
13
import { Tag } from ' @nais/ds-svelte-community' ;
14
14
import { endOfYesterday , startOfMonth , subMonths } from ' date-fns' ;
15
15
import type { Snippet } from ' svelte' ;
16
+ import CdnBucket from ' ./CDNBucket.svelte' ;
16
17
17
18
let {
18
19
description,
19
20
notFound,
21
+ cdnBucket,
20
22
cost,
21
23
list,
22
24
pageInfo,
25
27
}: {
26
28
description: Snippet ;
27
29
notFound: Snippet ;
30
+ cdnBucket? : string ;
28
31
cost? : {
29
32
costData: CostData ;
30
33
teamSlug: string ;
101
104
}}
102
105
/>
103
106
</div >
104
- {#if cost }
105
- <PersistenceCost
106
- {...cost }
107
- from ={startOfMonth (subMonths (new Date (), 1 ))}
108
- to ={endOfYesterday ()}
109
- />
110
- {/if }
107
+ <div class =" right-column" >
108
+ {#if cost }
109
+ <div >
110
+ <PersistenceCost
111
+ {...cost }
112
+ from ={startOfMonth (subMonths (new Date (), 1 ))}
113
+ to ={endOfYesterday ()}
114
+ />
115
+ </div >
116
+ {/if }
117
+ {#if cdnBucket }
118
+ <div >
119
+ <CdnBucket {cdnBucket } />
120
+ </div >
121
+ {/if }
122
+ </div >
111
123
</div >
112
124
{:else }
113
- {@render notFound ()}
125
+ <div class =" content-wrapper" >
126
+ {@render notFound ()}
127
+ <div class =" right-column" >
128
+ {#if cdnBucket }
129
+ <div >
130
+ <CdnBucket {cdnBucket } />
131
+ </div >
132
+ {/if }
133
+ </div >
134
+ </div >
114
135
{/if }
115
136
116
137
<style >
124
145
gap : var (--a-spacing-1-alt );
125
146
align-items : center ;
126
147
}
148
+
149
+ .right-column {
150
+ display : grid ;
151
+ gap : var (--a-spacing-6 );
152
+ }
127
153
</style >
Original file line number Diff line number Diff line change @@ -56,5 +56,11 @@ query Buckets(
56
56
}
57
57
}
58
58
}
59
+
60
+ externalResources {
61
+ cdn {
62
+ bucket
63
+ }
64
+ }
59
65
}
60
66
}
Original file line number Diff line number Diff line change 13
13
14
14
{#if $Buckets .data }
15
15
<PersistencePage
16
+ cdnBucket ={$Buckets .data .team .externalResources .cdn ?.bucket }
16
17
cost ={{
17
18
costData : $Buckets .data .team .cost ,
18
19
teamSlug : $Buckets .data .team .slug ,
32
33
</BodyLong >
33
34
{/ snippet }
34
35
{#snippet notFound ()}
35
- <BodyLong >
36
- <strong >No Buckets found.</strong > Storage buckets are containers for storing and managing
37
- data in the cloud.
38
- <a href =" https://docs.nais.io/persistence/buckets" >
39
- Learn more about Buckets and how to get started.
40
- </a >
41
- </BodyLong >
36
+ <div >
37
+ <BodyLong >
38
+ <strong >No Buckets found.</strong > Storage buckets are containers for storing and managing
39
+ data in the cloud.
40
+ <a href =" https://docs.nais.io/persistence/buckets" >
41
+ Learn more about Buckets and how to get started.
42
+ </a >
43
+ </BodyLong >
44
+ </div >
42
45
{/ snippet }
43
46
</PersistencePage >
44
47
{/if }
You can’t perform that action at this time.
0 commit comments