feat(资源池): 资源池增加k8s配置
This commit is contained in:
parent
60a7acd9d2
commit
6a75f21754
|
@ -149,30 +149,19 @@
|
|||
</a-form-item>
|
||||
</template> -->
|
||||
|
||||
<!-- <a-form-item v-if="isShowTypeItem" :label="t('system.resourcePool.type')" field="type" class="form-item">
|
||||
<a-form-item v-if="isShowTypeItem" :label="t('system.resourcePool.type')" field="type" class="form-item">
|
||||
<a-radio-group v-model:model-value="form.type" type="button" @change="changeResourceType">
|
||||
<a-radio value="Node">Node</a-radio>
|
||||
<a-radio v-xpack value="Kubernetes">Kubernetes</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item> -->
|
||||
</a-form-item>
|
||||
<template v-if="isShowNodeResources">
|
||||
<div
|
||||
class="mb-[8px] flex w-full items-center justify-between"
|
||||
:class="`${licenseStore.hasLicense() ? '' : 'has-license-class'} form-item !w-full`"
|
||||
>
|
||||
{{ t('system.resourcePool.addResource') }}
|
||||
<MsButton
|
||||
type="text"
|
||||
@click="
|
||||
() => {
|
||||
form.addType = form.addType === 'single' ? 'multiple' : 'single';
|
||||
handleTypeChange(form.addType);
|
||||
}
|
||||
"
|
||||
>
|
||||
{{ form.addType === 'single' ? t('system.resourcePool.batchAdd') : t('system.resourcePool.singleAdd') }}
|
||||
</MsButton>
|
||||
<!-- <a-popconfirm
|
||||
<a-popconfirm
|
||||
v-if="!getIsVisited()"
|
||||
v-xpack
|
||||
class="ms-pop-confirm--hidden-cancel"
|
||||
|
@ -212,7 +201,7 @@
|
|||
</span>
|
||||
</a-tooltip>
|
||||
</a-radio>
|
||||
</a-radio-group> -->
|
||||
</a-radio-group>
|
||||
</div>
|
||||
<MsBatchForm
|
||||
v-show="form.addType === 'single'"
|
||||
|
@ -333,11 +322,15 @@
|
|||
</span>
|
||||
</a-tooltip>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
:label="t('system.resourcePool.testResourceDTO.concurrentNumber')"
|
||||
field="testResourceDTO.concurrentNumber"
|
||||
class="form-item"
|
||||
>
|
||||
<a-form-item field="testResourceDTO.concurrentNumber" class="form-item">
|
||||
<template #label>
|
||||
<div class="flex items-center gap-[4px]">
|
||||
<div>{{ t('system.resourcePool.testResourceDTO.concurrentNumber') }}</div>
|
||||
<a-tooltip :content="t('system.resourcePool.concurrentNumberTip')" position="tl" mini>
|
||||
<icon-question-circle class="ml-[4px] text-[var(--color-text-4)] hover:text-[rgb(var(--primary-6))]" />
|
||||
</a-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
<a-input-number
|
||||
v-model:model-value="form.testResourceDTO.concurrentNumber"
|
||||
:min="1"
|
||||
|
@ -349,11 +342,15 @@
|
|||
@change="() => setIsSave(false)"
|
||||
></a-input-number>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
:label="t('system.resourcePool.testResourceDTO.podThreads')"
|
||||
field="testResourceDTO.podThreads"
|
||||
class="form-item"
|
||||
>
|
||||
<a-form-item field="testResourceDTO.podThreads" class="form-item">
|
||||
<template #label>
|
||||
<div class="flex items-center gap-[4px]">
|
||||
<div>{{ t('system.resourcePool.testResourceDTO.podThreads') }}</div>
|
||||
<a-tooltip :content="t('system.resourcePool.testResourceDTO.podThreadsTip')" position="tl" mini>
|
||||
<icon-question-circle class="ml-[4px] text-[var(--color-text-4)] hover:text-[rgb(var(--primary-6))]" />
|
||||
</a-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
<a-input-number
|
||||
v-model:model-value="form.testResourceDTO.podThreads"
|
||||
:min="1"
|
||||
|
@ -398,6 +395,7 @@
|
|||
import { addPool, getPoolInfo, updatePoolInfo } from '@/api/modules/setting/resourcePool';
|
||||
import { useI18n } from '@/hooks/useI18n';
|
||||
import useLeaveUnSaveTip from '@/hooks/useLeaveUnSaveTip';
|
||||
import useVisit from '@/hooks/useVisit';
|
||||
import useAppStore from '@/store/modules/app';
|
||||
import useLicenseStore from '@/store/modules/setting/license';
|
||||
import { downloadStringFile, sleep } from '@/utils';
|
||||
|
@ -544,18 +542,18 @@
|
|||
// form.value.testResourceDTO.loadTestHeap = defaultHeap;
|
||||
// }
|
||||
|
||||
// const visitedKey = 'changeAddResourceType';
|
||||
// const { addVisited, getIsVisited } = useVisit(visitedKey);
|
||||
const visitedKey = 'changeAddResourceType';
|
||||
const { addVisited, getIsVisited } = useVisit(visitedKey);
|
||||
|
||||
// /**
|
||||
// * 切换类型提示确认框隐藏时,设置已访问标志
|
||||
// * @param visible 显示/隐藏
|
||||
// */
|
||||
// function handlePopChange(visible: boolean) {
|
||||
// if (!visible) {
|
||||
// addVisited();
|
||||
// }
|
||||
// }
|
||||
/**
|
||||
* 切换类型提示确认框隐藏时,设置已访问标志
|
||||
* @param visible 显示/隐藏
|
||||
*/
|
||||
function handlePopChange(visible: boolean) {
|
||||
if (!visible) {
|
||||
addVisited();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 控制表单项显示隐藏逻辑计算器
|
||||
|
@ -725,12 +723,12 @@
|
|||
setIsSave(false);
|
||||
}
|
||||
|
||||
// function changeResourceType(val: string | number | boolean) {
|
||||
// if (val === 'Kubernetes') {
|
||||
// setBatchFormRes();
|
||||
// }
|
||||
// setIsSave(false);
|
||||
// }
|
||||
function changeResourceType(val: string | number | boolean) {
|
||||
if (val === 'Kubernetes') {
|
||||
setBatchFormRes();
|
||||
}
|
||||
setIsSave(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载 yaml 文件
|
||||
|
|
|
@ -86,6 +86,8 @@ export default {
|
|||
'system.resourcePool.concurrentNumberRequired': 'Please enter the maximum number of concurrency',
|
||||
'system.resourcePool.concurrentNumberMin': 'The maximum concurrent number must be greater than or equal to 1',
|
||||
'system.resourcePool.concurrentNumberPlaceholder': 'Please enter the maximum number of concurrency',
|
||||
'system.resourcePool.concurrentNumberTip':
|
||||
'The maximum number of concurrent users for a single node in the community version is 10. If you need a higher number of concurrent users, you can apply for a trial of the enterprise version.',
|
||||
'system.resourcePool.nodeResourceRequired': 'Please fill in the Node resources added in batches correctly',
|
||||
'system.resourcePool.nodeConfigEditorTip':
|
||||
'Writing format: IP, Port, maximum concurrent number; such as 192.168.1.52,8082,10,3',
|
||||
|
@ -109,6 +111,8 @@ export default {
|
|||
'system.resourcePool.testResourceDTO.apiTestImagePlaceholder': 'Please fill in the API image',
|
||||
'system.resourcePool.testResourceDTO.concurrentNumber': 'Maximum concurrency',
|
||||
'system.resourcePool.testResourceDTO.podThreads': 'Maximum number of threads per Pod',
|
||||
'system.resourcePool.testResourceDTO.podThreadsTip':
|
||||
'The maximum number of concurrent tasks for the community version is 3. If you need a higher number of concurrent tasks, you can apply for a trial of the enterprise version.',
|
||||
'system.resourcePool.testResourceDTO.downloadRoleYaml': 'Download YAML files',
|
||||
'system.resourcePool.testResourceDTO.downloadRoleYamlTip':
|
||||
'Please fill in the namespace before downloading the YAML file',
|
||||
|
|
|
@ -83,6 +83,7 @@ export default {
|
|||
'system.resourcePool.concurrentNumberRequired': '最大并发数不能为空',
|
||||
'system.resourcePool.concurrentNumberMin': '最大并发数须大于等于 1',
|
||||
'system.resourcePool.concurrentNumberPlaceholder': '请输入最大并发数',
|
||||
'system.resourcePool.concurrentNumberTip': '社区版单个节点最大并发数为 10,如需更大并发数 可申请企业版试用',
|
||||
'system.resourcePool.nodeResourceRequired': '请正确填写批量添加的 Node 资源',
|
||||
'system.resourcePool.nodeConfigEditorTip': '书写格式:IP,Port,最大并发数;如 192.168.1.52,8082,10,3',
|
||||
'system.resourcePool.testResourceDTO.ip': 'IP 地址/域名',
|
||||
|
@ -104,6 +105,7 @@ export default {
|
|||
'system.resourcePool.testResourceDTO.apiTestImagePlaceholder': '请输入 API 镜像',
|
||||
'system.resourcePool.testResourceDTO.concurrentNumber': '最大并发数',
|
||||
'system.resourcePool.testResourceDTO.podThreads': '单 Pod 最大线程数',
|
||||
'system.resourcePool.testResourceDTO.podThreadsTip': '社区版单个任务最大并发数为 3,如需更大并发数 可申请企业版试用',
|
||||
'system.resourcePool.testResourceDTO.downloadRoleYaml': '下载 YAML 文件',
|
||||
'system.resourcePool.testResourceDTO.downloadRoleYamlTip': '请先填写命名空间再下载YAML文件',
|
||||
'system.resourcePool.testResourceDTO.downloadDeployYamlTip': '请先填写命名空间 和 Deploy Name 再下载YAML文件',
|
||||
|
|
Loading…
Reference in New Issue