diff --git a/ui/src/pages/service/Edit.vue b/ui/src/pages/service/Edit.vue index c250ebe..b969c46 100644 --- a/ui/src/pages/service/Edit.vue +++ b/ui/src/pages/service/Edit.vue @@ -31,7 +31,7 @@ { - return value.every(v => v.source && v.target) + return value?.every(v => v.source && v.target) }, t('tips.mounts_rule')), configs: customRule((rule: any, value: any[]) => { - return value.every(v => v.key && v.path) + return value?.every(v => v.key && v.path) }, t('tips.files_rule')), secrets: customRule((rule: any, value: any[]) => { - return value.every(v => v.key && v.path) + return value?.every(v => v.key && v.path) }, t('tips.files_rule')), }; const mountTypeOptions = [ diff --git a/ui/src/utils/data-table.ts b/ui/src/utils/data-table.ts index c8b5051..6f9041a 100644 --- a/ui/src/utils/data-table.ts +++ b/ui/src/utils/data-table.ts @@ -1,7 +1,7 @@ import { isRef, onMounted, reactive } from "vue" import { t } from "@/locales"; -export function useDataTable(loader: Function, filter: Object | Function) { +export function useDataTable(loader: Function, filter: Object | Function, autoFetch: boolean = true) { const state = reactive({ loading: false, data: [], @@ -42,7 +42,9 @@ export function useDataTable(loader: Function, filter: Object | Function) { fetchData() } - onMounted(fetchData) + if (autoFetch) { + onMounted(fetchData) + } return { state, pagination, fetchData, changePageSize } }