fix(系统设置): 资源池k8s无 job

This commit is contained in:
baiqi 2024-10-25 14:42:20 +08:00 committed by 刘瑞斌
parent d639a12efc
commit 8b44a4ecca
2 changed files with 37 additions and 37 deletions

View File

@ -379,16 +379,16 @@
</a-form-item>
</template>
</a-form>
<template #footerLeft>
<!-- <template #footerLeft>
<MsButton v-if="isShowK8SResources" @click="showJobDrawer = true">
{{ t('system.resourcePool.customJobTemplate') }}
<a-tooltip :content="t('system.resourcePool.jobTemplateTip')" position="tl" mini>
<icon-question-circle class="ml-[4px] text-[var(--color-text-4)] hover:text-[rgb(var(--primary-6))]" />
</a-tooltip>
</MsButton>
</template>
</template> -->
</MsCard>
<JobTemplateDrawer v-model:visible="showJobDrawer" v-model:value="form.testResourceDTO.jobDefinition" />
<!-- <JobTemplateDrawer v-model:visible="showJobDrawer" v-model:value="form.testResourceDTO.jobDefinition" /> -->
</template>
<script setup lang="ts">
@ -399,13 +399,13 @@
import { FormInstance, Message, SelectOptionData } from '@arco-design/web-vue';
import { cloneDeep, isEmpty } from 'lodash-es';
import MsButton from '@/components/pure/ms-button/index.vue';
// import MsButton from '@/components/pure/ms-button/index.vue';
import MsCard from '@/components/pure/ms-card/index.vue';
import MsCodeEditor from '@/components/pure/ms-code-editor/index.vue';
import MsBatchForm from '@/components/business/ms-batch-form/index.vue';
import type { FormItemModel } from '@/components/business/ms-batch-form/types';
import JobTemplateDrawer from './components/jobTemplateDrawer.vue';
// import JobTemplateDrawer from './components/jobTemplateDrawer.vue';
import { getSystemOrgOption } from '@/api/modules/setting/organizationAndProject';
import { addPool, getPoolInfo, updatePoolInfo } from '@/api/modules/setting/resourcePool';
import { useI18n } from '@/hooks/useI18n';
@ -419,7 +419,7 @@
import type { NodesListItem, UpdateResourcePoolParams } from '@/models/setting/resourcePool';
import { SettingRouteEnum } from '@/enums/routeEnum';
import { getYaml, job, YamlType } from './template';
import { getYaml, YamlType } from './template';
const licenseStore = useLicenseStore();
const isXpack = computed(() => licenseStore.hasLicense());
@ -458,7 +458,7 @@
ip: '',
token: '',
namespace: '',
jobDefinition: job,
// jobDefinition: job,
deployName: '',
orgIds: [] as string[],
},
@ -591,15 +591,15 @@
() => isFillNameSpaces.value && form.value.testResourceDTO.deployName?.trim() !== ''
);
watch(
() => isShowK8SResources.value,
(val) => {
if (val && !form.value.testResourceDTO.jobDefinition) {
// k8s jobDefinition null k8s
form.value.testResourceDTO.jobDefinition = job;
}
}
);
// watch(
// () => isShowK8SResources.value,
// (val) => {
// if (val && !form.value.testResourceDTO.jobDefinition) {
// // k8s jobDefinition null k8s
// form.value.testResourceDTO.jobDefinition = job;
// }
// }
// );
const batchFormRef = ref<InstanceType<typeof MsBatchForm>>();
const batchFormModels: Ref<FormItemModel[]> = ref([
@ -799,7 +799,7 @@
namespace, // k8s
concurrentNumber, // k8s
podThreads, // k8s pod线
jobDefinition, // k8s job
// jobDefinition, // k8s job
deployName, // k8s api
nodesList,
uiGrid,
@ -836,14 +836,14 @@
}
: {};
const jobDTO = isShowK8SResources.value ? { jobDefinition } : {};
// const jobDTO = isShowK8SResources.value ? { jobDefinition } : {};
return {
...form.value,
type: isShowTypeItem.value ? form.value.type : 'Node', // Node
allOrg: form.value.orgType === 'allOrg',
apiTest: form.value.use.includes('API'), // api
uiTest: form.value.use.includes('UI'), // ui
testResourceDTO: { ...apiDTO, ...uiDTO, ...jobDTO, orgIds: form.value.testResourceDTO.orgIds },
testResourceDTO: { ...apiDTO, ...uiDTO, orgIds: form.value.testResourceDTO.orgIds },
};
}

View File

@ -112,11 +112,11 @@
</a-button>
</template>
</MsDrawer>
<JobTemplateDrawer
<!-- <JobTemplateDrawer
v-model:visible="showJobDrawer"
:default-val="activePool?.testResourceReturnDTO.jobDefinition || ''"
read-only
/>
/> -->
<CapacityDrawer v-model:visible="showCapacityDrawer" :active-record="activeRecord" />
</template>
@ -139,8 +139,8 @@
import MsTag, { TagType, Theme } from '@/components/pure/ms-tag/ms-tag.vue';
import MsTrialAlert from '@/components/business/ms-trial-alert/index.vue';
import CapacityDrawer from './components/capacityDrawer.vue';
import JobTemplateDrawer from './components/jobTemplateDrawer.vue';
// import JobTemplateDrawer from './components/jobTemplateDrawer.vue';
import { delPoolInfo, getPoolInfo, getPoolList, togglePoolStatus } from '@/api/modules/setting/resourcePool';
import { useI18n } from '@/hooks/useI18n';
import useModal from '@/hooks/useModal';
@ -367,7 +367,7 @@
const showDetailDrawer = ref(false);
const activePoolDesc = ref<Description[]>([]);
const activePool = ref<ResourcePoolDetail | null>(null);
const showJobDrawer = ref(false);
// const showJobDrawer = ref(false);
const drawerLoading = ref(false);
/**
* 查看资源池详情
@ -450,19 +450,19 @@
},
]
: [];
const jobTemplate =
type === 'Kubernetes'
? [
{
label: t('system.resourcePool.jobTemplate'),
value: t('system.resourcePool.customJobTemplate'),
isButton: true,
onClick: () => {
showJobDrawer.value = true;
},
},
]
: [];
// const jobTemplate =
// type === 'Kubernetes'
// ? [
// {
// label: t('system.resourcePool.jobTemplate'),
// value: t('system.resourcePool.customJobTemplate'),
// isButton: true,
// onClick: () => {
// showJobDrawer.value = true;
// },
// },
// ]
// : [];
//
const resourceDesc = apiTest ? [...nodeResourceDesc, ...k8sResourceDesc] : [];
// ui
@ -515,7 +515,7 @@
...uiDesc,
...detailType,
...resourceDesc,
...jobTemplate,
// ...jobTemplate,
];
}
} catch (error) {