diff --git a/web_src/vuepages/apis/modules/resources.js b/web_src/vuepages/apis/modules/resources.js index 981df8b2c..32a87c53f 100644 --- a/web_src/vuepages/apis/modules/resources.js +++ b/web_src/vuepages/apis/modules/resources.js @@ -127,7 +127,6 @@ export const syncResSpecification = () => { "JobType":"TRAIN", //任务类型 DEBUG调试任务 BENCHMARK 评测任务 TRAIN 训练 INFERENCE 推理 "IsExclusive":true, //是否专属 "ExclusiveOrg":"123,456", //专属组织 - "QueueId":2, //队列id "SpecIds":[2,3] // 资源规格id } */ diff --git a/web_src/vuepages/pages/resources/components/SceneDialog.vue b/web_src/vuepages/pages/resources/components/SceneDialog.vue index 0bc8068ef..6d3190a25 100644 --- a/web_src/vuepages/pages/resources/components/SceneDialog.vue +++ b/web_src/vuepages/pages/resources/components/SceneDialog.vue @@ -130,10 +130,10 @@ export default { QueueId: '', SpecIds: [], } - this.queueList = []; - this.specsList = []; + this.queueList.splice(0, Infinity); + this.specsList.splice(0, Infinity); }, - getQueueList() { + getQueueList(next) { return getResQueueCode({ cluster: this.dataInfo.Cluster }).then(res => { res = res.data; if (res.Code === 0) { @@ -146,9 +146,15 @@ export default { v: `${item.QueueCode}(${getListValueWithKey(this.clusterList, item.Cluster)} - ${item.AiCenterName})`, }); } + if (this.dataInfo.Cluster === 'C2Net') { + list.unshift({ + k: '-1', + v: this.$t('resourcesManagement.allResQueue'), + }); + } this.queueList.splice(0, Infinity, ...list); - if (this.queueList.length === 0) { - this.changeQueue(); + if (next) { + this.getResSpecificationList(); } } }).catch(err => { @@ -158,11 +164,11 @@ export default { getResSpecificationList() { const params = { cluster: this.dataInfo.Cluster, - queue: this.dataInfo.QueueId, + queue: this.dataInfo.QueueId === '-1' ? '' : this.dataInfo.QueueId, status: 2, page: 1, }; - getResSpecificationList(params).then(res => { + return getResSpecificationList(params).then(res => { res = res.data; if (res.Code === 0) { const list = res.Data.List; @@ -201,12 +207,10 @@ export default { if (this.type === 'add') { // } else if (this.type === 'edit') { - this.dataInfo = Object.assign(this.dataInfo, { ...this.data }); + Object.assign(this.dataInfo, { ...this.data, QueueId: this.data.QueueIds.length === 1 ? this.data.QueueIds[0] : '-1' }); this.queueList.splice(0, Infinity); this.specsList.splice(0, Infinity); - this.getQueueList().then(() => { - this.getResSpecificationList(); - }); + this.getQueueList(true); } this.$emit("open"); }, diff --git a/web_src/vuepages/pages/resources/scene/index.vue b/web_src/vuepages/pages/resources/scene/index.vue index d882c23cc..5bad15a4e 100644 --- a/web_src/vuepages/pages/resources/scene/index.vue +++ b/web_src/vuepages/pages/resources/scene/index.vue @@ -43,9 +43,23 @@ + header-align="center"> + + -- + + {{ item.AiCenterName }} + + + + header-align="center"> + + -- + + {{ item.QueueStr }} + + + @@ -172,13 +186,26 @@ export default { const data = list.map((item) => { const Specs = item.Specs; const specsList = []; + const queues = [], queueIds = []; + let cluster = ''; for (let i = 0, iLen = Specs.length; i < iLen; i++) { const Spec = Specs[i]; - const NGPU = `${item.ComputeResource}:${Spec.AccCardsNum === 0 ? '0' : Spec.AccCardsNum + '*' + getListValueWithKey(this.accCardTypeList, item.AccCardType)}`; + const NGPU = `${Spec.ComputeResource}:${Spec.AccCardsNum === 0 ? '0' : Spec.AccCardsNum + '*' + getListValueWithKey(this.accCardTypeList, Spec.AccCardType)}`; specsList.push({ k: Spec.ID, v: `${NGPU}, CPU:${Spec.CpuCores}, ${this.$t('resourcesManagement.gpuMem')}:${Spec.GPUMemGiB}GB, ${this.$t('resourcesManagement.mem')}:${Spec.MemGiB}GB, ${this.$t('resourcesManagement.shareMem')}:${Spec.ShareMemGiB}GB, ${this.$t('resourcesManagement.unitPrice')}:${Spec.UnitPrice}${this.$t('resourcesManagement.point_hr')}`, - }) + }); + cluster = Spec.Cluster; + if (queueIds.indexOf(Spec.QueueId) < 0) { + queues.push({ + QueueId: Spec.QueueId, + QueueCode: Spec.QueueCode, + AiCenterCode: Spec.AiCenterCode, + AiCenterName: getListValueWithKey(this.aiCenterList, Spec.AiCenterCode), + QueueStr: `${Spec.QueueCode}(${getListValueWithKey(this.clusterList, Spec.Cluster)} - ${getListValueWithKey(this.aiCenterList, Spec.AiCenterCode)})`, + }); + queueIds.push(Spec.QueueId); + } } return { ID: item.ID, @@ -188,11 +215,9 @@ export default { IsExclusive: item.IsExclusive, IsExclusiveStr: getListValueWithKey(this.isExclusiveList, item.IsExclusive ? '1' : '2'), ExclusiveOrg: item.ExclusiveOrg, - AiCenterCode: item.AiCenterCode, - AiCenterStr: getListValueWithKey(this.aiCenterList, item.AiCenterCode), - Cluster: item.Cluster, - QueueId: item.QueueId, - QueueStr: item.QueueCode ? `${item.QueueCode}(${getListValueWithKey(this.clusterList, item.Cluster)} - ${getListValueWithKey(this.aiCenterList, item.AiCenterCode)})` : '--', + Cluster: cluster, + QueueIds: queueIds, + Queues: queues, SpecsList: specsList, } }); @@ -253,7 +278,7 @@ export default { IsExclusive: data.IsExclusive ? '1' : '2', ExclusiveOrg: data.ExclusiveOrg, Cluster: data.Cluster, - QueueId: data.QueueId, + QueueIds: data.QueueIds, SpecIds: data.SpecsList.map((item) => item.k), } : {}; this.sceneDialogShow = true;