-
Notifications
You must be signed in to change notification settings - Fork 153
/
runtime-configs.vue
54 lines (48 loc) · 1.22 KB
/
runtime-configs.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<script setup lang="ts">
definePageMeta({
icon: 'carbon-settings-services',
title: 'Runtime Configs',
category: 'analyze',
show: () => !!useClient().value,
order: 6,
})
const client = useClient()
const serverConfig = useServerConfig()
const payload = computed(() => client.value?.nuxt.payload)
const privateConfig = computed(() => {
const clone = {
...serverConfig.value?.runtimeConfig,
}
delete clone.public
delete clone.app
return clone
})
</script>
<template>
<div v-if="client">
<NSectionBlock
icon="carbon-settings-services"
text="App Config"
:padding="false"
>
<StateEditor :state="client.appConfig" />
</NSectionBlock>
<NSectionBlock
icon="carbon-settings"
text="Public Runtime Config"
:padding="false"
>
<StateEditor :state="payload.config?.public" />
</NSectionBlock>
<NSectionBlock
icon="i-carbon-code-signing-service"
text="Private Runtime Config"
:open="false"
:padding="false"
description="These values are not exposed to the client. Readonly in the DevTools."
>
<StateEditor :state="privateConfig" readonly />
</NSectionBlock>
</div>
<HelpFab path="/runtime-configs" />
</template>