Skip to content

Commit 2e1c066

Browse files
fixed generate error
1 parent 9bc4ac9 commit 2e1c066

File tree

27 files changed

+39
-34
lines changed

27 files changed

+39
-34
lines changed

frontend/kubecloud-v2/components/deploy-cluster/define/DefineVMsForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ const api = useApi()
3535
const { state: sshKeys } = useAsyncState(async () => {
3636
const { data } = await api.users.listSshKeys()
3737
return data.data ?? []
38-
}, [])
38+
}, [], { immediate: $meta.client })
3939
</script>

frontend/kubecloud-v2/components/deploy-cluster/place/PlaceVMsNodes.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ const { state: _nodes } = useAsyncState(async () => {
9595
const { data } = await api.nodes.listNodes()
9696
const nodes = (data as ListRentableNodes200Response).data?.nodes ?? []
9797
return sortNodes(nodes)
98-
}, [], { resetOnExecute: false })
98+
}, [], { immediate: $meta.client, resetOnExecute: false })
9999
100100
function onReserveNode(nodeId: number): void {
101101
// const __nodes = _nodes.value.map(n => n.nodeId === nodeId ? { ...n, rented: true } : n)

frontend/kubecloud-v2/components/rows/DeploymentRow.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ const api = useApi()
7575
const { state: kubeconfig, isLoading: downloading } = useAsyncState(
7676
() => api.helpers.getKubeconfig(props.deployment.cluster?.name ?? ""),
7777
"",
78+
{ immediate: $meta.client },
7879
)
7980
8081
const binary = computed(() => {

frontend/kubecloud-v2/composables/docs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,5 +172,5 @@ export const useDocs = createGlobalState(() => {
172172
},
173173
}
174174
})
175-
}, [])
175+
}, [], { immediate: $meta.client })
176176
})

frontend/kubecloud-v2/composables/stats.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function useStats(options?: UseStatsOptions) {
2626
const { state, isLoading, error } = useAsyncState(async () => {
2727
const { data } = await api.admin.getStats({ unauthenticated: true })
2828
return data.data
29-
}, null)
29+
}, null, { immediate: $meta.client })
3030

3131
const stats = computed(() => {
3232
const s = state.value

frontend/kubecloud-v2/composables/three.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ export function useVanta(type: "dots" | "globe", el: () => HTMLElement) {
1212
],
1313
})
1414

15-
const script = document.querySelector(`script[src="/scripts/vanta.${type}.min.js"]`)
16-
if (script) {
17-
nextTick(() => {
18-
applyVanta(type, el())
19-
})
15+
if ($meta.client) {
16+
const script = document.querySelector(`script[src="/scripts/vanta.${type}.min.js"]`)
17+
if (script) {
18+
nextTick(() => {
19+
applyVanta(type, el())
20+
})
21+
}
2022
}
2123
}

frontend/kubecloud-v2/pages/admin/invoices.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const page = ref(1)
5151
const { state, isLoading } = useAsyncState(async () => {
5252
const { data } = await api.admin.getAllInvoices()
5353
return (data.data as unknown as { invoices: ModelsInvoice[] }).invoices ?? []
54-
}, [])
54+
}, [], { immediate: $meta.client })
5555
5656
const invoices = computed(() => {
5757
const v = (page.value - 1) * limit.value

frontend/kubecloud-v2/pages/admin/payments.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ const api = useApi()
88
const { state } = useAsyncState(async () => {
99
const { data } = await api.admin.listPendingRecords()
1010
return data.data
11-
}, null)
11+
}, null, { immediate: $meta.client })
1212
</script>

frontend/kubecloud-v2/pages/admin/system.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ const api = useApi()
104104
const { state: isEnabled, isLoading: isLoadingEnabled } = useAsyncState(async () => {
105105
const { data } = await api.admin.getMaintenanceMode()
106106
return data.data?.enabled
107-
}, false)
107+
}, false, { immediate: $meta.client })
108108
109109
const { execute: toggleMaintenanceMode, isLoading } = useAsyncState(
110110
async () => {

frontend/kubecloud-v2/pages/admin/users.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const { state: users, isLoading } = useAsyncState(
8484
return data.data?.users ?? []
8585
},
8686
[],
87-
{ resetOnExecute: false },
87+
{ immediate: $meta.client, resetOnExecute: false },
8888
)
8989
9090
const credit = useDialog<ServicesUserWithUSDBalance, { amount: number, memo: string }>()

0 commit comments

Comments
 (0)