@dao-style/biz 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/gpu/style/assign-gpu-devices-list.js +1 -0
- package/dist/cjs/components/gpu/style/gpu-form.js +1 -0
- package/dist/components/form-block/FormBlock.d.ts +27 -1
- package/dist/components/form-block/props.d.ts +4 -0
- package/dist/components/form-block/props.js +4 -0
- package/dist/components/form-block/props.mjs +4 -0
- package/dist/components/form-block/src/FormBlock.vue.d.ts +11 -0
- package/dist/components/form-block/src/FormBlock.vue.js +4 -4
- package/dist/components/form-block/src/FormBlock.vue.mjs +4 -4
- package/dist/components/form-block/src/FormBlock.vue2.js +12 -1
- package/dist/components/form-block/src/FormBlock.vue2.mjs +12 -1
- package/dist/components/gpu/props.d.ts +121 -3
- package/dist/components/gpu/props.js +82 -9
- package/dist/components/gpu/props.mjs +82 -9
- package/dist/components/gpu/src/GpuForm.vue.d.ts +283 -50
- package/dist/components/gpu/src/GpuForm.vue.js +25 -24
- package/dist/components/gpu/src/GpuForm.vue.mjs +26 -25
- package/dist/components/gpu/src/GpuForm.vue2.js +115 -218
- package/dist/components/gpu/src/GpuForm.vue2.mjs +116 -219
- package/dist/components/gpu/src/components/AssignGpuDevicesList.vue.d.ts +77 -0
- package/dist/components/gpu/src/components/AssignGpuDevicesList.vue.js +40 -0
- package/dist/components/gpu/src/components/AssignGpuDevicesList.vue.mjs +41 -0
- package/dist/components/gpu/src/components/AssignGpuDevicesList.vue2.js +191 -0
- package/dist/components/gpu/src/components/AssignGpuDevicesList.vue2.mjs +192 -0
- package/dist/components/gpu/src/components/GpuAdvancedForm.vue.d.ts +180 -0
- package/dist/components/gpu/src/{GpuAdvancedForm.vue.js → components/GpuAdvancedForm.vue.js} +92 -37
- package/dist/components/gpu/src/{GpuAdvancedForm.vue.mjs → components/GpuAdvancedForm.vue.mjs} +93 -38
- package/dist/components/gpu/src/components/GpuAdvancedForm.vue2.js +169 -0
- package/dist/components/gpu/src/components/GpuAdvancedForm.vue2.mjs +153 -0
- package/dist/components/gpu/src/{GpuFormDynamicItem.vue.d.ts → components/GpuFormDynamicItem.vue.d.ts} +4 -4
- package/dist/components/gpu/src/{GpuFormDynamicItem.vue.js → components/GpuFormDynamicItem.vue.js} +1 -1
- package/dist/components/gpu/src/{GpuFormDynamicItem.vue.mjs → components/GpuFormDynamicItem.vue.mjs} +1 -1
- package/dist/components/gpu/src/{GpuFormDynamicItem.vue2.js → components/GpuFormDynamicItem.vue2.js} +1 -1
- package/dist/components/gpu/src/{GpuFormDynamicItem.vue2.mjs → components/GpuFormDynamicItem.vue2.mjs} +1 -1
- package/dist/components/gpu/src/components/GpuFormItem.vue.d.ts +310 -0
- package/dist/components/gpu/src/{GpuFormItem.vue.js → components/GpuFormItem.vue.js} +22 -26
- package/dist/components/gpu/src/{GpuFormItem.vue.mjs → components/GpuFormItem.vue.mjs} +23 -27
- package/dist/components/gpu/src/components/GpuFormItem.vue2.js +61 -0
- package/dist/components/gpu/src/components/GpuFormItem.vue2.mjs +45 -0
- package/dist/components/gpu/src/{GpuResources.vue.d.ts → components/GpuResources.vue.d.ts} +38 -18
- package/dist/components/gpu/src/components/GpuResources.vue.js +153 -0
- package/dist/components/gpu/src/components/GpuResources.vue.mjs +154 -0
- package/dist/components/gpu/src/components/GpuResources.vue2.js +278 -0
- package/dist/components/gpu/src/components/GpuResources.vue2.mjs +262 -0
- package/dist/components/gpu/src/gpuForm.constants.d.ts +3 -0
- package/dist/components/gpu/src/gpuForm.constants.js +10 -0
- package/dist/components/gpu/src/gpuForm.constants.mjs +10 -0
- package/dist/components/gpu/src/gpuForm.internal-types.d.ts +49 -0
- package/dist/components/gpu/src/gpuForm.mapper.d.ts +16 -0
- package/dist/components/gpu/src/gpuForm.mapper.js +199 -0
- package/dist/components/gpu/src/gpuForm.mapper.mjs +199 -0
- package/dist/components/gpu/src/gpuFormItem.mapper.d.ts +38 -0
- package/dist/components/gpu/src/gpuFormItem.mapper.js +153 -0
- package/dist/components/gpu/src/gpuFormItem.mapper.mjs +153 -0
- package/dist/components/gpu/src/useGPUOptions.d.ts +2 -2
- package/dist/components/gpu/src/useGPUOptions.js +15 -20
- package/dist/components/gpu/src/useGPUOptions.mjs +16 -21
- package/dist/components/gpu/src/useGpuFormItemState.d.ts +42 -0
- package/dist/components/gpu/src/useGpuFormItemState.js +178 -0
- package/dist/components/gpu/src/useGpuFormItemState.mjs +178 -0
- package/dist/components/gpu/src/useGpuFormSideState.d.ts +52 -0
- package/dist/components/gpu/src/useGpuFormSideState.js +71 -0
- package/dist/components/gpu/src/useGpuFormSideState.mjs +71 -0
- package/dist/components/gpu/src/useGpuFormState.d.ts +560 -0
- package/dist/components/gpu/src/useGpuFormState.js +52 -0
- package/dist/components/gpu/src/useGpuFormState.mjs +52 -0
- package/dist/components/gpu/src/validations/nvidiaVgpuMemoryDecimal.d.ts +5 -1
- package/dist/components/gpu/style/assign-gpu-devices-list.d.ts +1 -0
- package/dist/components/gpu/style/assign-gpu-devices-list.scss.js +3 -0
- package/dist/components/gpu/style/assign-gpu-devices-list.scss.mjs +4 -0
- package/dist/components/gpu/style/gpu-form.d.ts +1 -0
- package/dist/components/gpu/types.d.ts +6 -0
- package/dist/components/gpu/types.js +2 -0
- package/dist/components/gpu/types.mjs +2 -0
- package/dist/components/gpu/utils.d.ts +4 -0
- package/dist/components/gpu/utils.js +14 -0
- package/dist/components/gpu/utils.mjs +14 -0
- package/dist/components/instance-cluster/src/InstanceCluster.vue.d.ts +1 -1
- package/dist/components/instance-namespace/src/InstanceNamespace.vue.d.ts +1 -1
- package/dist/components/instance-storage-class/src/InstanceStorageClass.vue.d.ts +1 -1
- package/dist/components/network-config/src/NetworkConfig.vue.d.ts +1 -1
- package/dist/components/network-config/src/NetworkConfig.vue.js +13 -6
- package/dist/components/network-config/src/NetworkConfig.vue.mjs +14 -7
- package/dist/dialogs/create-network-config-dialog/src/CreateNetworkConfigDialog.vue.d.ts +1 -1
- package/dist/es/components/gpu/style/assign-gpu-devices-list.mjs +1 -0
- package/dist/es/components/gpu/style/gpu-form.mjs +1 -0
- package/dist/forms/import-parameter-template/props.d.ts +8 -8
- package/dist/forms/import-parameter-template/src/ImportParameterTemplate.vue.d.ts +24 -24
- package/dist/group-mapping.json +1 -1
- package/dist/index.js +34 -23
- package/dist/index.mjs +15 -4
- package/dist/locales/en-US/components/Gpu.json.js +36 -9
- package/dist/locales/en-US/components/Gpu.json.mjs +37 -10
- package/dist/locales/en-US/index.js +2 -0
- package/dist/locales/en-US/index.mjs +2 -0
- package/dist/locales/en-US/uses/UseCancelFormDialog.json.js +11 -0
- package/dist/locales/en-US/uses/UseCancelFormDialog.json.mjs +11 -0
- package/dist/locales/ja/components/Gpu.json.js +36 -9
- package/dist/locales/ja/components/Gpu.json.mjs +37 -10
- package/dist/locales/ja/components/InstancePassword.json.js +1 -1
- package/dist/locales/ja/components/InstancePassword.json.mjs +1 -1
- package/dist/locales/ja/components/MatchExpressionsEditor.json.js +1 -1
- package/dist/locales/ja/components/MatchExpressionsEditor.json.mjs +1 -1
- package/dist/locales/ja/components/NetworkConfig.json.js +1 -1
- package/dist/locales/ja/components/NetworkConfig.json.mjs +1 -1
- package/dist/locales/ja/index.js +2 -0
- package/dist/locales/ja/index.mjs +2 -0
- package/dist/locales/ja/uses/UseCancelFormDialog.json.js +11 -0
- package/dist/locales/ja/uses/UseCancelFormDialog.json.mjs +11 -0
- package/dist/locales/ja/workloads/DnsConfig.json.js +1 -1
- package/dist/locales/ja/workloads/DnsConfig.json.mjs +1 -1
- package/dist/locales/ja/workloads/workload-advanced/NetworkConfig.json.js +1 -1
- package/dist/locales/ja/workloads/workload-advanced/NetworkConfig.json.mjs +1 -1
- package/dist/locales/zh-CN/components/Gpu.json.js +36 -9
- package/dist/locales/zh-CN/components/Gpu.json.mjs +37 -10
- package/dist/locales/zh-CN/index.js +2 -0
- package/dist/locales/zh-CN/index.mjs +2 -0
- package/dist/locales/zh-CN/uses/UseCancelFormDialog.json.js +11 -0
- package/dist/locales/zh-CN/uses/UseCancelFormDialog.json.mjs +11 -0
- package/dist/style.css +692 -664
- package/dist/styles/components/gpu/assign-gpu-devices-list.css +10 -0
- package/dist/styles/components/gpu/gpu-form-item.css +16 -0
- package/dist/styles/components/gpu/gpu-form.css +4 -0
- package/dist/styles/components/network-config/network-config.css +3 -0
- package/dist/styles/components/resource-config/resource-config.css +0 -8
- package/dist/styles/styles/common.css +4 -0
- package/dist/uses/index.d.ts +1 -0
- package/dist/uses/useCancelFormDialog/index.d.ts +11 -0
- package/dist/uses/useCancelFormDialog/index.js +40 -0
- package/dist/uses/useCancelFormDialog/index.mjs +40 -0
- package/dist/uses/useCancelFormDialog/src/CancelFormDialog.vue.d.ts +8 -0
- package/dist/uses/useCancelFormDialog/src/CancelFormDialog.vue.js +25 -0
- package/dist/uses/useCancelFormDialog/src/CancelFormDialog.vue.mjs +26 -0
- package/dist/uses/useCancelFormDialog/src/CancelFormDialog.vue2.js +3 -0
- package/dist/uses/useCancelFormDialog/src/CancelFormDialog.vue2.mjs +4 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/injectWithSelf.d.ts +6 -0
- package/dist/utils/injectWithSelf.js +8 -0
- package/dist/utils/injectWithSelf.mjs +8 -0
- package/dist/utils/multiRowEditorValidate.d.ts +5 -5
- package/dist/utils/useResetFieldValue.d.ts +13 -0
- package/dist/utils/useResetFieldValue.js +28 -0
- package/dist/utils/useResetFieldValue.mjs +28 -0
- package/dist/utils/useSetFieldValue.d.ts +6 -0
- package/dist/utils/useSetFieldValue.js +2 -5
- package/dist/utils/useSetFieldValue.mjs +2 -5
- package/dist/workloads/container-basic-info/props.d.ts +13 -0
- package/dist/workloads/container-basic-info/props.js +4 -0
- package/dist/workloads/container-basic-info/props.mjs +4 -0
- package/dist/workloads/container-basic-info/src/ContainerBasicInfo.vue.d.ts +10 -0
- package/dist/workloads/container-basic-info/src/ContainerBasicInfo.vue.js +54 -29
- package/dist/workloads/container-basic-info/src/ContainerBasicInfo.vue.mjs +54 -29
- package/dist/workloads/container-basic-info/src/ContainerBasicInfo.vue2.js +18 -8
- package/dist/workloads/container-basic-info/src/ContainerBasicInfo.vue2.mjs +19 -9
- package/dist/workloads/container-image/src/dialogs/SelectImageDialog.vue.d.ts +1 -1
- package/dist/workloads/containers/demo/data.d.ts +8 -1
- package/dist/workloads/containers/src/ContainerItem.vue.d.ts +23 -0
- package/dist/workloads/containers/src/Containers.vue.d.ts +4 -0
- package/dist/workloads/containers/src/Containers.vue2.js +18 -1
- package/dist/workloads/containers/src/Containers.vue2.mjs +19 -2
- package/dist/workloads/health-check/props.d.ts +4 -0
- package/dist/workloads/health-check/props.js +4 -0
- package/dist/workloads/health-check/props.mjs +4 -0
- package/dist/workloads/health-check/src/HealthCheck.vue.d.ts +9 -0
- package/dist/workloads/health-check/src/HealthCheck.vue.js +6 -6
- package/dist/workloads/health-check/src/HealthCheck.vue.mjs +6 -6
- package/dist/workloads/health-check/src/HealthCheckHandler.vue.js +3 -1
- package/dist/workloads/health-check/src/HealthCheckHandler.vue.mjs +3 -1
- package/dist/workloads/http-get-action/src/HttpGetAction.vue.js +1 -1
- package/dist/workloads/http-get-action/src/HttpGetAction.vue.mjs +1 -1
- package/dist/workloads/workload-annotations/props.d.ts +1 -0
- package/dist/workloads/workload-annotations/props.js +1 -0
- package/dist/workloads/workload-annotations/props.mjs +2 -1
- package/package.json +12 -13
- package/dist/components/gpu/src/GpuAdvancedForm.vue.d.ts +0 -131
- package/dist/components/gpu/src/GpuAdvancedForm.vue2.js +0 -92
- package/dist/components/gpu/src/GpuAdvancedForm.vue2.mjs +0 -76
- package/dist/components/gpu/src/GpuFormItem.vue.d.ts +0 -232
- package/dist/components/gpu/src/GpuFormItem.vue2.js +0 -235
- package/dist/components/gpu/src/GpuFormItem.vue2.mjs +0 -219
- package/dist/components/gpu/src/GpuResources.vue.js +0 -125
- package/dist/components/gpu/src/GpuResources.vue.mjs +0 -126
- package/dist/components/gpu/src/GpuResources.vue2.js +0 -197
- package/dist/components/gpu/src/GpuResources.vue2.mjs +0 -181
- package/dist/components/gpu/src/validations/nvidiaVgpuMemoryDecimal.js +0 -19
- package/dist/components/gpu/src/validations/nvidiaVgpuMemoryDecimal.mjs +0 -20
package/dist/components/gpu/src/{GpuAdvancedForm.vue.js → components/GpuAdvancedForm.vue.js}
RENAMED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const GpuAdvancedForm_vue_vue_type_script_lang = require("./GpuAdvancedForm.vue2.js");
|
|
3
3
|
const vue = require("vue");
|
|
4
|
-
const _pluginVue_exportHelper = require("
|
|
4
|
+
const _pluginVue_exportHelper = require("../../../../_virtual/_plugin-vue_export-helper.js");
|
|
5
5
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
6
|
-
var _a
|
|
6
|
+
var _a;
|
|
7
7
|
const _component_dao_radio = vue.resolveComponent("dao-radio");
|
|
8
8
|
const _component_dao_radio_group = vue.resolveComponent("dao-radio-group");
|
|
9
9
|
const _component_dao_form_item = vue.resolveComponent("dao-form-item");
|
|
10
10
|
const _component_dao_switch = vue.resolveComponent("dao-switch");
|
|
11
11
|
const _component_dao_form_item_validate = vue.resolveComponent("dao-form-item-validate");
|
|
12
12
|
const _component_dao_option = vue.resolveComponent("dao-option");
|
|
13
|
+
const _component_dao_assign_gpu_devices_list = vue.resolveComponent("dao-assign-gpu-devices-list");
|
|
13
14
|
const _component_dao_form_group = vue.resolveComponent("dao-form-group");
|
|
14
15
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
15
16
|
_ctx.enableRemoteCall && _ctx.isNvidiaGpu((_a = _ctx.quota) == null ? void 0 : _a.type) ? (vue.openBlock(), vue.createBlock(_component_dao_form_item, {
|
|
@@ -38,7 +39,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
38
39
|
]),
|
|
39
40
|
_: 1
|
|
40
41
|
}, 8, ["label"])) : vue.createCommentVNode("", true),
|
|
41
|
-
_ctx.
|
|
42
|
+
_ctx.showAdvancedConfig ? (vue.openBlock(), vue.createBlock(_component_dao_form_group, {
|
|
42
43
|
key: 1,
|
|
43
44
|
title: _ctx.$t("biz.components.Gpu.advancedConfig"),
|
|
44
45
|
expandable: "",
|
|
@@ -54,14 +55,14 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
54
55
|
}, {
|
|
55
56
|
default: vue.withCtx(() => [
|
|
56
57
|
vue.createVNode(_component_dao_switch, {
|
|
57
|
-
modelValue: _ctx.
|
|
58
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.
|
|
59
|
-
onChange: _ctx.
|
|
58
|
+
modelValue: _ctx.openNvidiaVgpuSchedulePolicyRef,
|
|
59
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.openNvidiaVgpuSchedulePolicyRef = $event),
|
|
60
|
+
onChange: _ctx.handleNvidiaVgpuSchedulePolicyChange
|
|
60
61
|
}, null, 8, ["modelValue", "onChange"])
|
|
61
62
|
]),
|
|
62
63
|
_: 1
|
|
63
64
|
}, 8, ["label"]),
|
|
64
|
-
_ctx.
|
|
65
|
+
_ctx.openNvidiaVgpuSchedulePolicyRef ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
65
66
|
vue.createVNode(_component_dao_form_item_validate, {
|
|
66
67
|
label: _ctx.$t("biz.components.Gpu.baseGpuSchedule.label"),
|
|
67
68
|
name: _ctx.nvidiaVgpuGpuScheduleKey,
|
|
@@ -130,44 +131,98 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
130
131
|
]),
|
|
131
132
|
_: 1
|
|
132
133
|
}, 8, ["label", "name", "control-props", "yup-type", "icon-message"])) : vue.createCommentVNode("", true),
|
|
133
|
-
_ctx.enableNvidiaVgpuModel ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
|
134
|
+
_ctx.enableNvidiaVgpuModel || _ctx.enableNvidiaVgpuDevices ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
|
134
135
|
vue.createVNode(_component_dao_form_item, {
|
|
135
|
-
label: _ctx.$t("biz.components.Gpu.
|
|
136
|
+
label: _ctx.$t("biz.components.Gpu.assignGpu.label"),
|
|
136
137
|
"wrapper-type": "switch"
|
|
137
|
-
}, {
|
|
138
|
+
}, vue.createSlots({
|
|
138
139
|
default: vue.withCtx(() => [
|
|
139
140
|
vue.createVNode(_component_dao_switch, {
|
|
140
|
-
modelValue: _ctx.
|
|
141
|
-
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.
|
|
142
|
-
|
|
143
|
-
}, null, 8, ["modelValue", "
|
|
144
|
-
]),
|
|
145
|
-
_: 1
|
|
146
|
-
}, 8, ["label"]),
|
|
147
|
-
_ctx.openNvidiaVgpuModelRef ? (vue.openBlock(), vue.createBlock(_component_dao_form_item_validate, {
|
|
148
|
-
key: 0,
|
|
149
|
-
label: _ctx.$t("biz.components.Gpu.gpuModel"),
|
|
150
|
-
name: _ctx.nvidiaVgpuModelKey,
|
|
151
|
-
tag: "dao-select",
|
|
152
|
-
"control-props": {
|
|
153
|
-
loading: (_a2 = _ctx.nvidiaVgpuModelsAdaptor) == null ? void 0 : _a2.loading
|
|
154
|
-
},
|
|
155
|
-
required: !_ctx.isSide
|
|
156
|
-
}, {
|
|
157
|
-
default: vue.withCtx(() => [
|
|
158
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.nvidiaGpuModels, (model) => {
|
|
159
|
-
return vue.openBlock(), vue.createBlock(_component_dao_option, {
|
|
160
|
-
key: model,
|
|
161
|
-
value: model
|
|
162
|
-
}, null, 8, ["value"]);
|
|
163
|
-
}), 128))
|
|
141
|
+
modelValue: _ctx.openNvidiaAssignGpuRef,
|
|
142
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.openNvidiaAssignGpuRef = $event),
|
|
143
|
+
disabled: _ctx.assignGpuDisabled || _ctx.isSide
|
|
144
|
+
}, null, 8, ["modelValue", "disabled"])
|
|
164
145
|
]),
|
|
165
|
-
_:
|
|
166
|
-
},
|
|
146
|
+
_: 2
|
|
147
|
+
}, [
|
|
148
|
+
!_ctx.isSide && _ctx.assignGpuDisabled && _ctx.$slots["assign-gpu-disabled-message"] ? {
|
|
149
|
+
name: "helper",
|
|
150
|
+
fn: vue.withCtx(() => [
|
|
151
|
+
vue.renderSlot(_ctx.$slots, "assign-gpu-disabled-message")
|
|
152
|
+
]),
|
|
153
|
+
key: "0"
|
|
154
|
+
} : void 0
|
|
155
|
+
]), 1032, ["label"]),
|
|
156
|
+
_ctx.openNvidiaAssignGpuRef ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
157
|
+
vue.createVNode(_component_dao_form_item, {
|
|
158
|
+
label: _ctx.$t("biz.components.Gpu.assignGpu.type"),
|
|
159
|
+
"wrapper-type": "radio"
|
|
160
|
+
}, {
|
|
161
|
+
default: vue.withCtx(() => [
|
|
162
|
+
vue.createVNode(_component_dao_radio_group, {
|
|
163
|
+
modelValue: _ctx.assignGpuType,
|
|
164
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => _ctx.assignGpuType = $event),
|
|
165
|
+
vertical: false,
|
|
166
|
+
onChange: _ctx.handleAssignGpuTypeChange
|
|
167
|
+
}, {
|
|
168
|
+
default: vue.withCtx(() => [
|
|
169
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.assignTypes, (type) => {
|
|
170
|
+
return vue.openBlock(), vue.createBlock(_component_dao_radio, {
|
|
171
|
+
key: type.value,
|
|
172
|
+
value: type.value,
|
|
173
|
+
label: type.label,
|
|
174
|
+
disabled: _ctx.assignGpuDisabled || _ctx.isSide
|
|
175
|
+
}, null, 8, ["value", "label", "disabled"]);
|
|
176
|
+
}), 128))
|
|
177
|
+
]),
|
|
178
|
+
_: 1
|
|
179
|
+
}, 8, ["modelValue", "onChange"])
|
|
180
|
+
]),
|
|
181
|
+
_: 1
|
|
182
|
+
}, 8, ["label"]),
|
|
183
|
+
_ctx.assignGpuType === "assignModel" ? (vue.openBlock(), vue.createBlock(_component_dao_form_item_validate, {
|
|
184
|
+
key: 0,
|
|
185
|
+
label: _ctx.$t("biz.components.Gpu.gpuModel"),
|
|
186
|
+
name: _ctx.nvidiaVgpuModelKey,
|
|
187
|
+
tag: "dao-select",
|
|
188
|
+
"control-props": {
|
|
189
|
+
loading: (_a2 = _ctx.nvidiaVgpuModelsAdaptor) == null ? void 0 : _a2.loading,
|
|
190
|
+
disabled: _ctx.assignGpuDisabled || _ctx.isSide
|
|
191
|
+
},
|
|
192
|
+
required: !_ctx.isSide
|
|
193
|
+
}, {
|
|
194
|
+
default: vue.withCtx(() => [
|
|
195
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.displayNvidiaGpuModels, (model) => {
|
|
196
|
+
return vue.openBlock(), vue.createBlock(_component_dao_option, {
|
|
197
|
+
key: model,
|
|
198
|
+
value: model
|
|
199
|
+
}, null, 8, ["value"]);
|
|
200
|
+
}), 128))
|
|
201
|
+
]),
|
|
202
|
+
_: 1
|
|
203
|
+
}, 8, ["label", "name", "control-props", "required"])) : (vue.openBlock(), vue.createBlock(_component_dao_form_item_validate, {
|
|
204
|
+
key: 1,
|
|
205
|
+
label: _ctx.$t("biz.components.Gpu.assignGpu.availableCards"),
|
|
206
|
+
name: _ctx.nvidiaVgpuDevicesKey,
|
|
207
|
+
"yup-type": _ctx.yup.array(),
|
|
208
|
+
"yup-concat": _ctx.yupDevicesSchema,
|
|
209
|
+
required: !_ctx.isSide
|
|
210
|
+
}, {
|
|
211
|
+
"control-content": vue.withCtx(({ value }) => [
|
|
212
|
+
vue.createVNode(_component_dao_assign_gpu_devices_list, {
|
|
213
|
+
modelValue: value.value,
|
|
214
|
+
"onUpdate:modelValue": ($event) => value.value = $event,
|
|
215
|
+
disabled: _ctx.assignGpuDisabled || _ctx.isSide,
|
|
216
|
+
"nvidia-vgpu-devices-adaptor": _ctx.nvidiaVgpuDevicesAdaptor
|
|
217
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "nvidia-vgpu-devices-adaptor"])
|
|
218
|
+
]),
|
|
219
|
+
_: 1
|
|
220
|
+
}, 8, ["label", "name", "yup-type", "yup-concat", "required"]))
|
|
221
|
+
], 64)) : vue.createCommentVNode("", true)
|
|
167
222
|
], 64)) : vue.createCommentVNode("", true)
|
|
168
223
|
];
|
|
169
224
|
}),
|
|
170
|
-
_:
|
|
225
|
+
_: 3
|
|
171
226
|
}, 8, ["title"])) : vue.createCommentVNode("", true)
|
|
172
227
|
], 64);
|
|
173
228
|
}
|
package/dist/components/gpu/src/{GpuAdvancedForm.vue.mjs → components/GpuAdvancedForm.vue.mjs}
RENAMED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import _sfc_main from "./GpuAdvancedForm.vue2.mjs";
|
|
2
|
-
import { resolveComponent, openBlock, createElementBlock, Fragment, createBlock, withCtx, createVNode, createCommentVNode, renderList } from "vue";
|
|
3
|
-
import _export_sfc from "
|
|
2
|
+
import { resolveComponent, openBlock, createElementBlock, Fragment, createBlock, withCtx, createVNode, createCommentVNode, renderList, createSlots, renderSlot } from "vue";
|
|
3
|
+
import _export_sfc from "../../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
4
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
5
|
-
var _a
|
|
5
|
+
var _a;
|
|
6
6
|
const _component_dao_radio = resolveComponent("dao-radio");
|
|
7
7
|
const _component_dao_radio_group = resolveComponent("dao-radio-group");
|
|
8
8
|
const _component_dao_form_item = resolveComponent("dao-form-item");
|
|
9
9
|
const _component_dao_switch = resolveComponent("dao-switch");
|
|
10
10
|
const _component_dao_form_item_validate = resolveComponent("dao-form-item-validate");
|
|
11
11
|
const _component_dao_option = resolveComponent("dao-option");
|
|
12
|
+
const _component_dao_assign_gpu_devices_list = resolveComponent("dao-assign-gpu-devices-list");
|
|
12
13
|
const _component_dao_form_group = resolveComponent("dao-form-group");
|
|
13
14
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
14
15
|
_ctx.enableRemoteCall && _ctx.isNvidiaGpu((_a = _ctx.quota) == null ? void 0 : _a.type) ? (openBlock(), createBlock(_component_dao_form_item, {
|
|
@@ -37,7 +38,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
37
38
|
]),
|
|
38
39
|
_: 1
|
|
39
40
|
}, 8, ["label"])) : createCommentVNode("", true),
|
|
40
|
-
_ctx.
|
|
41
|
+
_ctx.showAdvancedConfig ? (openBlock(), createBlock(_component_dao_form_group, {
|
|
41
42
|
key: 1,
|
|
42
43
|
title: _ctx.$t("biz.components.Gpu.advancedConfig"),
|
|
43
44
|
expandable: "",
|
|
@@ -53,14 +54,14 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
53
54
|
}, {
|
|
54
55
|
default: withCtx(() => [
|
|
55
56
|
createVNode(_component_dao_switch, {
|
|
56
|
-
modelValue: _ctx.
|
|
57
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.
|
|
58
|
-
onChange: _ctx.
|
|
57
|
+
modelValue: _ctx.openNvidiaVgpuSchedulePolicyRef,
|
|
58
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.openNvidiaVgpuSchedulePolicyRef = $event),
|
|
59
|
+
onChange: _ctx.handleNvidiaVgpuSchedulePolicyChange
|
|
59
60
|
}, null, 8, ["modelValue", "onChange"])
|
|
60
61
|
]),
|
|
61
62
|
_: 1
|
|
62
63
|
}, 8, ["label"]),
|
|
63
|
-
_ctx.
|
|
64
|
+
_ctx.openNvidiaVgpuSchedulePolicyRef ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
64
65
|
createVNode(_component_dao_form_item_validate, {
|
|
65
66
|
label: _ctx.$t("biz.components.Gpu.baseGpuSchedule.label"),
|
|
66
67
|
name: _ctx.nvidiaVgpuGpuScheduleKey,
|
|
@@ -129,44 +130,98 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
129
130
|
]),
|
|
130
131
|
_: 1
|
|
131
132
|
}, 8, ["label", "name", "control-props", "yup-type", "icon-message"])) : createCommentVNode("", true),
|
|
132
|
-
_ctx.enableNvidiaVgpuModel ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
133
|
+
_ctx.enableNvidiaVgpuModel || _ctx.enableNvidiaVgpuDevices ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
133
134
|
createVNode(_component_dao_form_item, {
|
|
134
|
-
label: _ctx.$t("biz.components.Gpu.
|
|
135
|
+
label: _ctx.$t("biz.components.Gpu.assignGpu.label"),
|
|
135
136
|
"wrapper-type": "switch"
|
|
136
|
-
}, {
|
|
137
|
+
}, createSlots({
|
|
137
138
|
default: withCtx(() => [
|
|
138
139
|
createVNode(_component_dao_switch, {
|
|
139
|
-
modelValue: _ctx.
|
|
140
|
-
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.
|
|
141
|
-
|
|
142
|
-
}, null, 8, ["modelValue", "
|
|
143
|
-
]),
|
|
144
|
-
_: 1
|
|
145
|
-
}, 8, ["label"]),
|
|
146
|
-
_ctx.openNvidiaVgpuModelRef ? (openBlock(), createBlock(_component_dao_form_item_validate, {
|
|
147
|
-
key: 0,
|
|
148
|
-
label: _ctx.$t("biz.components.Gpu.gpuModel"),
|
|
149
|
-
name: _ctx.nvidiaVgpuModelKey,
|
|
150
|
-
tag: "dao-select",
|
|
151
|
-
"control-props": {
|
|
152
|
-
loading: (_a2 = _ctx.nvidiaVgpuModelsAdaptor) == null ? void 0 : _a2.loading
|
|
153
|
-
},
|
|
154
|
-
required: !_ctx.isSide
|
|
155
|
-
}, {
|
|
156
|
-
default: withCtx(() => [
|
|
157
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.nvidiaGpuModels, (model) => {
|
|
158
|
-
return openBlock(), createBlock(_component_dao_option, {
|
|
159
|
-
key: model,
|
|
160
|
-
value: model
|
|
161
|
-
}, null, 8, ["value"]);
|
|
162
|
-
}), 128))
|
|
140
|
+
modelValue: _ctx.openNvidiaAssignGpuRef,
|
|
141
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.openNvidiaAssignGpuRef = $event),
|
|
142
|
+
disabled: _ctx.assignGpuDisabled || _ctx.isSide
|
|
143
|
+
}, null, 8, ["modelValue", "disabled"])
|
|
163
144
|
]),
|
|
164
|
-
_:
|
|
165
|
-
},
|
|
145
|
+
_: 2
|
|
146
|
+
}, [
|
|
147
|
+
!_ctx.isSide && _ctx.assignGpuDisabled && _ctx.$slots["assign-gpu-disabled-message"] ? {
|
|
148
|
+
name: "helper",
|
|
149
|
+
fn: withCtx(() => [
|
|
150
|
+
renderSlot(_ctx.$slots, "assign-gpu-disabled-message")
|
|
151
|
+
]),
|
|
152
|
+
key: "0"
|
|
153
|
+
} : void 0
|
|
154
|
+
]), 1032, ["label"]),
|
|
155
|
+
_ctx.openNvidiaAssignGpuRef ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
156
|
+
createVNode(_component_dao_form_item, {
|
|
157
|
+
label: _ctx.$t("biz.components.Gpu.assignGpu.type"),
|
|
158
|
+
"wrapper-type": "radio"
|
|
159
|
+
}, {
|
|
160
|
+
default: withCtx(() => [
|
|
161
|
+
createVNode(_component_dao_radio_group, {
|
|
162
|
+
modelValue: _ctx.assignGpuType,
|
|
163
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => _ctx.assignGpuType = $event),
|
|
164
|
+
vertical: false,
|
|
165
|
+
onChange: _ctx.handleAssignGpuTypeChange
|
|
166
|
+
}, {
|
|
167
|
+
default: withCtx(() => [
|
|
168
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.assignTypes, (type) => {
|
|
169
|
+
return openBlock(), createBlock(_component_dao_radio, {
|
|
170
|
+
key: type.value,
|
|
171
|
+
value: type.value,
|
|
172
|
+
label: type.label,
|
|
173
|
+
disabled: _ctx.assignGpuDisabled || _ctx.isSide
|
|
174
|
+
}, null, 8, ["value", "label", "disabled"]);
|
|
175
|
+
}), 128))
|
|
176
|
+
]),
|
|
177
|
+
_: 1
|
|
178
|
+
}, 8, ["modelValue", "onChange"])
|
|
179
|
+
]),
|
|
180
|
+
_: 1
|
|
181
|
+
}, 8, ["label"]),
|
|
182
|
+
_ctx.assignGpuType === "assignModel" ? (openBlock(), createBlock(_component_dao_form_item_validate, {
|
|
183
|
+
key: 0,
|
|
184
|
+
label: _ctx.$t("biz.components.Gpu.gpuModel"),
|
|
185
|
+
name: _ctx.nvidiaVgpuModelKey,
|
|
186
|
+
tag: "dao-select",
|
|
187
|
+
"control-props": {
|
|
188
|
+
loading: (_a2 = _ctx.nvidiaVgpuModelsAdaptor) == null ? void 0 : _a2.loading,
|
|
189
|
+
disabled: _ctx.assignGpuDisabled || _ctx.isSide
|
|
190
|
+
},
|
|
191
|
+
required: !_ctx.isSide
|
|
192
|
+
}, {
|
|
193
|
+
default: withCtx(() => [
|
|
194
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.displayNvidiaGpuModels, (model) => {
|
|
195
|
+
return openBlock(), createBlock(_component_dao_option, {
|
|
196
|
+
key: model,
|
|
197
|
+
value: model
|
|
198
|
+
}, null, 8, ["value"]);
|
|
199
|
+
}), 128))
|
|
200
|
+
]),
|
|
201
|
+
_: 1
|
|
202
|
+
}, 8, ["label", "name", "control-props", "required"])) : (openBlock(), createBlock(_component_dao_form_item_validate, {
|
|
203
|
+
key: 1,
|
|
204
|
+
label: _ctx.$t("biz.components.Gpu.assignGpu.availableCards"),
|
|
205
|
+
name: _ctx.nvidiaVgpuDevicesKey,
|
|
206
|
+
"yup-type": _ctx.yup.array(),
|
|
207
|
+
"yup-concat": _ctx.yupDevicesSchema,
|
|
208
|
+
required: !_ctx.isSide
|
|
209
|
+
}, {
|
|
210
|
+
"control-content": withCtx(({ value }) => [
|
|
211
|
+
createVNode(_component_dao_assign_gpu_devices_list, {
|
|
212
|
+
modelValue: value.value,
|
|
213
|
+
"onUpdate:modelValue": ($event) => value.value = $event,
|
|
214
|
+
disabled: _ctx.assignGpuDisabled || _ctx.isSide,
|
|
215
|
+
"nvidia-vgpu-devices-adaptor": _ctx.nvidiaVgpuDevicesAdaptor
|
|
216
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "nvidia-vgpu-devices-adaptor"])
|
|
217
|
+
]),
|
|
218
|
+
_: 1
|
|
219
|
+
}, 8, ["label", "name", "yup-type", "yup-concat", "required"]))
|
|
220
|
+
], 64)) : createCommentVNode("", true)
|
|
166
221
|
], 64)) : createCommentVNode("", true)
|
|
167
222
|
];
|
|
168
223
|
}),
|
|
169
|
-
_:
|
|
224
|
+
_: 3
|
|
170
225
|
}, 8, ["title"])) : createCommentVNode("", true)
|
|
171
226
|
], 64);
|
|
172
227
|
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const vue = require("vue");
|
|
3
|
+
const yup = require("yup");
|
|
4
|
+
const vueI18n = require("vue-i18n");
|
|
5
|
+
const index = require("../../../../node_modules/@vueuse/core/index.js");
|
|
6
|
+
const extend = require("@dao-style/extend");
|
|
7
|
+
const veeValidate = require("vee-validate");
|
|
8
|
+
const props = require("../../props.js");
|
|
9
|
+
const types = require("../../types.js");
|
|
10
|
+
const AssignGpuDevicesList = require("./AssignGpuDevicesList.vue.js");
|
|
11
|
+
const utils = require("../../utils.js");
|
|
12
|
+
const useSetFieldValue = require("../../../../utils/useSetFieldValue.js");
|
|
13
|
+
function _interopNamespaceDefault(e) {
|
|
14
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
15
|
+
if (e) {
|
|
16
|
+
for (const k in e) {
|
|
17
|
+
if (k !== "default") {
|
|
18
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
19
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: () => e[k]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
n.default = e;
|
|
27
|
+
return Object.freeze(n);
|
|
28
|
+
}
|
|
29
|
+
const yup__namespace = /* @__PURE__ */ _interopNamespaceDefault(yup);
|
|
30
|
+
const _sfc_main = vue.defineComponent({
|
|
31
|
+
name: "DaoGpuAdvancedForm",
|
|
32
|
+
components: {
|
|
33
|
+
DaoFormItemValidate: extend.DaoFormItemValidate,
|
|
34
|
+
DaoAssignGpuDevicesList: AssignGpuDevicesList
|
|
35
|
+
},
|
|
36
|
+
props: props.gpuAdvancedFormProps,
|
|
37
|
+
emits: [
|
|
38
|
+
"update:openNvidiaVgpuModel",
|
|
39
|
+
"update:openNvidiaVgpuSchedulePolicy",
|
|
40
|
+
"update:openNvidiaAssignGpu"
|
|
41
|
+
],
|
|
42
|
+
setup(props$1, { emit }) {
|
|
43
|
+
const openNvidiaVgpuModelRef = index.useVModel(props$1, "openNvidiaVgpuModel", emit);
|
|
44
|
+
const openNvidiaVgpuSchedulePolicyRef = index.useVModel(props$1, "openNvidiaVgpuSchedulePolicy", emit);
|
|
45
|
+
const openNvidiaAssignGpuRef = index.useVModel(props$1, "openNvidiaAssignGpu", emit);
|
|
46
|
+
const i18nInstance = vueI18n.useI18n();
|
|
47
|
+
const gpuCallValue = vue.ref("local");
|
|
48
|
+
const priorityOpts = props.getPriorityOpts(i18nInstance);
|
|
49
|
+
const nodeScheduleModel = veeValidate.useFieldValue(types.nvidiaVgpuNodeScheduleKey);
|
|
50
|
+
const gpuScheduleModel = veeValidate.useFieldValue(types.nvidiaVgpuGpuScheduleKey);
|
|
51
|
+
const scheduleOps = [
|
|
52
|
+
{
|
|
53
|
+
label: "Binpack",
|
|
54
|
+
value: "binpack"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
label: "Spread",
|
|
58
|
+
value: "spread"
|
|
59
|
+
}
|
|
60
|
+
];
|
|
61
|
+
const nodeScheduleHelper = vue.computed(() => nodeScheduleModel.value && nodeScheduleModel.value === "spread" ? i18nInstance.t("biz.components.Gpu.baseNodeSchedule.spreadHelper") : i18nInstance.t("biz.components.Gpu.baseNodeSchedule.binpackHelper"));
|
|
62
|
+
const gpuScheduleHelper = vue.computed(() => gpuScheduleModel.value && gpuScheduleModel.value === "spread" ? i18nInstance.t("biz.components.Gpu.baseGpuSchedule.spreadHelper") : i18nInstance.t("biz.components.Gpu.baseGpuSchedule.binpackHelper"));
|
|
63
|
+
const setModelValue = useSetFieldValue.useSetFieldValue(types.nvidiaVgpuModelKey);
|
|
64
|
+
const setDevicesValue = useSetFieldValue.useSetFieldValue(types.nvidiaVgpuDevicesKey);
|
|
65
|
+
const setGpuScheduleValue = useSetFieldValue.useSetFieldValue(types.nvidiaVgpuGpuScheduleKey);
|
|
66
|
+
const setNodeScheduleValue = useSetFieldValue.useSetFieldValue(types.nvidiaVgpuNodeScheduleKey);
|
|
67
|
+
const nvidiaVgpuModelValue = veeValidate.useFieldValue(types.nvidiaVgpuModelKey);
|
|
68
|
+
const nvidiaVgpuDevicesValue = veeValidate.useFieldValue(types.nvidiaVgpuDevicesKey);
|
|
69
|
+
const handleNvidiaVgpuSchedulePolicyChange = (open) => {
|
|
70
|
+
if (open) {
|
|
71
|
+
setGpuScheduleValue("binpack");
|
|
72
|
+
setNodeScheduleValue("spread");
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
const isNvidiaVgpuType = vue.computed(() => {
|
|
76
|
+
var _a;
|
|
77
|
+
return utils.isNvidiaVgpu(((_a = props$1.quota) == null ? void 0 : _a.type) ?? "");
|
|
78
|
+
});
|
|
79
|
+
const showAdvancedConfig = vue.computed(() => isNvidiaVgpuType.value && (props$1.enableNvidiaVgpuModel || props$1.enableNvidiaVgpuDevices || props$1.enableNvidiaVgpuPriority || props$1.enableNvidiaVgpuSchedulePolicy));
|
|
80
|
+
const assignTypes = vue.computed(() => {
|
|
81
|
+
const types2 = [];
|
|
82
|
+
if (props$1.enableNvidiaVgpuModel) {
|
|
83
|
+
types2.push({
|
|
84
|
+
value: "assignModel",
|
|
85
|
+
label: i18nInstance.t("biz.components.Gpu.assignGpu.assignModel")
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
if (props$1.enableNvidiaVgpuDevices) {
|
|
89
|
+
types2.push({
|
|
90
|
+
value: "assignDevice",
|
|
91
|
+
label: i18nInstance.t("biz.components.Gpu.assignGpu.assignCard")
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
return types2;
|
|
95
|
+
});
|
|
96
|
+
const getInitialAssignGpuType = () => {
|
|
97
|
+
var _a, _b, _c;
|
|
98
|
+
const model = nvidiaVgpuModelValue.value ?? ((_a = props$1.quota) == null ? void 0 : _a[types.nvidiaVgpuModelKey]);
|
|
99
|
+
const devices = nvidiaVgpuDevicesValue.value ?? ((_b = props$1.quota) == null ? void 0 : _b[types.nvidiaVgpuDevicesKey]);
|
|
100
|
+
if (model && props$1.enableNvidiaVgpuModel) {
|
|
101
|
+
return "assignModel";
|
|
102
|
+
}
|
|
103
|
+
if ((devices == null ? void 0 : devices.length) && props$1.enableNvidiaVgpuDevices) {
|
|
104
|
+
return "assignDevice";
|
|
105
|
+
}
|
|
106
|
+
return ((_c = assignTypes.value[0]) == null ? void 0 : _c.value) ?? "assignModel";
|
|
107
|
+
};
|
|
108
|
+
const assignGpuType = vue.ref(getInitialAssignGpuType());
|
|
109
|
+
const displayNvidiaGpuModels = vue.computed(() => {
|
|
110
|
+
var _a;
|
|
111
|
+
const assignedModel = nvidiaVgpuModelValue.value ?? ((_a = props$1.quota) == null ? void 0 : _a[types.nvidiaVgpuModelKey]);
|
|
112
|
+
const models = props$1.nvidiaGpuModels ?? [];
|
|
113
|
+
const readonly = props$1.assignGpuDisabled || props$1.isSide;
|
|
114
|
+
if (!readonly || !assignedModel || models.includes(assignedModel)) {
|
|
115
|
+
return models;
|
|
116
|
+
}
|
|
117
|
+
return [...models, assignedModel];
|
|
118
|
+
});
|
|
119
|
+
const handleAssignGpuTypeChange = (value) => {
|
|
120
|
+
var _a;
|
|
121
|
+
if (value === "assignModel") {
|
|
122
|
+
setDevicesValue([]);
|
|
123
|
+
if (props$1.quota) {
|
|
124
|
+
setModelValue((_a = props$1.nvidiaGpuModels) == null ? void 0 : _a[0]);
|
|
125
|
+
}
|
|
126
|
+
} else {
|
|
127
|
+
setModelValue(void 0);
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
const nvidiaVgpuCore = vue.computed(() => {
|
|
131
|
+
var _a;
|
|
132
|
+
if (isNvidiaVgpuType.value) {
|
|
133
|
+
const coreStr = utils.getGPUResourceValue((_a = props$1.quota) == null ? void 0 : _a.resources, props.nvidiaVgpuCoreResource);
|
|
134
|
+
return coreStr ? Number(coreStr) : void 0;
|
|
135
|
+
}
|
|
136
|
+
return void 0;
|
|
137
|
+
});
|
|
138
|
+
const yupDevicesSchema = vue.computed(() => yup__namespace.array().of(
|
|
139
|
+
yup__namespace.string().required()
|
|
140
|
+
).min(1, i18nInstance.t("biz.components.Gpu.assignGpu.validate.assignCardRequired")).test("defaultCore", i18nInstance.t("biz.components.Gpu.assignGpu.validate.coreFirst"), () => !(nvidiaVgpuCore.value === void 0 || nvidiaVgpuCore.value === 0)).max(nvidiaVgpuCore.value ?? 0, i18nInstance.t("biz.components.Gpu.assignGpu.validate.assignModelMax", { max: nvidiaVgpuCore.value ?? 0 })));
|
|
141
|
+
return {
|
|
142
|
+
gpuCallValue,
|
|
143
|
+
priorityOpts,
|
|
144
|
+
openNvidiaVgpuModelRef,
|
|
145
|
+
nvidiaVgpuModelKey: types.nvidiaVgpuModelKey,
|
|
146
|
+
nvidiaVgpuPriorityKey: types.nvidiaVgpuPriorityKey,
|
|
147
|
+
isNvidiaVgpuType,
|
|
148
|
+
isNvidiaGpu: utils.isNvidiaGpu,
|
|
149
|
+
showAdvancedConfig,
|
|
150
|
+
scheduleOps,
|
|
151
|
+
openNvidiaVgpuSchedulePolicyRef,
|
|
152
|
+
handleNvidiaVgpuSchedulePolicyChange,
|
|
153
|
+
nvidiaVgpuGpuScheduleKey: types.nvidiaVgpuGpuScheduleKey,
|
|
154
|
+
nvidiaVgpuNodeScheduleKey: types.nvidiaVgpuNodeScheduleKey,
|
|
155
|
+
nodeScheduleHelper,
|
|
156
|
+
gpuScheduleHelper,
|
|
157
|
+
nvidiaVgpuCore,
|
|
158
|
+
assignTypes,
|
|
159
|
+
openNvidiaAssignGpuRef,
|
|
160
|
+
handleAssignGpuTypeChange,
|
|
161
|
+
assignGpuType,
|
|
162
|
+
displayNvidiaGpuModels,
|
|
163
|
+
nvidiaVgpuDevicesKey: types.nvidiaVgpuDevicesKey,
|
|
164
|
+
yupDevicesSchema,
|
|
165
|
+
yup: yup__namespace
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
module.exports = _sfc_main;
|