mirror of
https://github.com/cuigh/swirl
synced 2024-12-28 14:51:57 +00:00
Fix bug
This commit is contained in:
parent
6705bd6d64
commit
94127504ff
@ -31,7 +31,7 @@
|
|||||||
<n-form-item-gi
|
<n-form-item-gi
|
||||||
:label="t('fields.replicas')"
|
:label="t('fields.replicas')"
|
||||||
path="replicas"
|
path="replicas"
|
||||||
v-show="['replicated', 'replicated-job'].includes(model.mode)"
|
v-if="['replicated', 'replicated-job'].includes(model.mode)"
|
||||||
>
|
>
|
||||||
<n-input-number
|
<n-input-number
|
||||||
:placeholder="t('fields.replicas')"
|
:placeholder="t('fields.replicas')"
|
||||||
@ -564,13 +564,13 @@ const showMore = ref(false);
|
|||||||
const rules: any = {
|
const rules: any = {
|
||||||
name: requiredRule(),
|
name: requiredRule(),
|
||||||
mounts: customRule((rule: any, value: any[]) => {
|
mounts: customRule((rule: any, value: any[]) => {
|
||||||
return value.every(v => v.source && v.target)
|
return value?.every(v => v.source && v.target)
|
||||||
}, t('tips.mounts_rule')),
|
}, t('tips.mounts_rule')),
|
||||||
configs: customRule((rule: any, value: any[]) => {
|
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')),
|
}, t('tips.files_rule')),
|
||||||
secrets: customRule((rule: any, value: any[]) => {
|
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')),
|
}, t('tips.files_rule')),
|
||||||
};
|
};
|
||||||
const mountTypeOptions = [
|
const mountTypeOptions = [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { isRef, onMounted, reactive } from "vue"
|
import { isRef, onMounted, reactive } from "vue"
|
||||||
import { t } from "@/locales";
|
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({
|
const state = reactive({
|
||||||
loading: false,
|
loading: false,
|
||||||
data: [],
|
data: [],
|
||||||
@ -42,7 +42,9 @@ export function useDataTable(loader: Function, filter: Object | Function) {
|
|||||||
fetchData()
|
fetchData()
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(fetchData)
|
if (autoFetch) {
|
||||||
|
onMounted(fetchData)
|
||||||
|
}
|
||||||
|
|
||||||
return { state, pagination, fetchData, changePageSize }
|
return { state, pagination, fetchData, changePageSize }
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user