@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
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
import * as yup from 'yup';
|
|
2
|
-
import { GPUSetting, type GpuQuotaItem } from '../types';
|
|
3
|
-
import '../style/gpu-form-item';
|
|
4
|
-
declare const _default: import("vue").DefineComponent<{
|
|
5
|
-
gpuSettingsAdaptor: {
|
|
6
|
-
type: import("vue").PropType<import("../props").GPUSettings>;
|
|
7
|
-
default: undefined;
|
|
8
|
-
};
|
|
9
|
-
nvidiaVgpuModelsAdaptor: {
|
|
10
|
-
type: import("vue").PropType<{
|
|
11
|
-
data: import("../types").GPUSummary[];
|
|
12
|
-
loading: boolean;
|
|
13
|
-
refresh: () => import("../types").GPUSummary[] | Promise<import("../types").GPUSummary[]>;
|
|
14
|
-
}>;
|
|
15
|
-
default: undefined;
|
|
16
|
-
};
|
|
17
|
-
targetType: {
|
|
18
|
-
type: StringConstructor;
|
|
19
|
-
default: string;
|
|
20
|
-
};
|
|
21
|
-
enableRemoteCall: {
|
|
22
|
-
type: BooleanConstructor;
|
|
23
|
-
default: boolean;
|
|
24
|
-
};
|
|
25
|
-
enableRangeValidate: {
|
|
26
|
-
type: BooleanConstructor;
|
|
27
|
-
default: boolean;
|
|
28
|
-
};
|
|
29
|
-
enableNvidiaVgpuModel: {
|
|
30
|
-
type: BooleanConstructor;
|
|
31
|
-
default: boolean;
|
|
32
|
-
};
|
|
33
|
-
nvidiaVgpuModel: {
|
|
34
|
-
type: StringConstructor;
|
|
35
|
-
default: undefined;
|
|
36
|
-
};
|
|
37
|
-
enableNvidiaVgpuPriority: {
|
|
38
|
-
type: BooleanConstructor;
|
|
39
|
-
default: boolean;
|
|
40
|
-
};
|
|
41
|
-
nvidiaVgpuPriority: {
|
|
42
|
-
type: import("vue").PropType<"0" | "1">;
|
|
43
|
-
default: undefined;
|
|
44
|
-
};
|
|
45
|
-
dynamicLimitOne: {
|
|
46
|
-
type: BooleanConstructor;
|
|
47
|
-
default: boolean;
|
|
48
|
-
};
|
|
49
|
-
enableNvidiaVgpuSchedulePolicy: {
|
|
50
|
-
type: BooleanConstructor;
|
|
51
|
-
default: boolean;
|
|
52
|
-
};
|
|
53
|
-
nvidiaVgpuGpuSchedule: {
|
|
54
|
-
type: import("vue").PropType<import("../types").VgpuSchedulePolicy>;
|
|
55
|
-
default: undefined;
|
|
56
|
-
};
|
|
57
|
-
nvidiaVgpuNodeSchedule: {
|
|
58
|
-
type: import("vue").PropType<import("../types").VgpuSchedulePolicy>;
|
|
59
|
-
default: undefined;
|
|
60
|
-
};
|
|
61
|
-
quotaItem: {
|
|
62
|
-
type: import("vue").PropType<GpuQuotaItem>;
|
|
63
|
-
default: () => {};
|
|
64
|
-
};
|
|
65
|
-
isSide: {
|
|
66
|
-
type: BooleanConstructor;
|
|
67
|
-
default: boolean;
|
|
68
|
-
};
|
|
69
|
-
availableQuotaItem: {
|
|
70
|
-
type: import("vue").PropType<GpuQuotaItem>;
|
|
71
|
-
default: undefined;
|
|
72
|
-
};
|
|
73
|
-
usedQuotaItem: {
|
|
74
|
-
type: import("vue").PropType<GpuQuotaItem>;
|
|
75
|
-
default: undefined;
|
|
76
|
-
};
|
|
77
|
-
existTypes: {
|
|
78
|
-
type: import("vue").PropType<string[]>;
|
|
79
|
-
default: () => never[];
|
|
80
|
-
};
|
|
81
|
-
gpuOptionsMap: {
|
|
82
|
-
type: import("vue").PropType<Map<string, GPUSetting>>;
|
|
83
|
-
required: boolean;
|
|
84
|
-
};
|
|
85
|
-
nvidiaGpuModels: {
|
|
86
|
-
type: import("vue").PropType<string[]>;
|
|
87
|
-
required: boolean;
|
|
88
|
-
};
|
|
89
|
-
getDisplayResource: {
|
|
90
|
-
type: import("vue").PropType<(type: string) => import("../types").GPUResourceSetting[]>;
|
|
91
|
-
required: boolean;
|
|
92
|
-
};
|
|
93
|
-
}, {
|
|
94
|
-
quota: GpuQuotaItem;
|
|
95
|
-
dynamicQuota: import("vue").Ref<Record<string, string | number | undefined> | undefined>;
|
|
96
|
-
currentDisplayResource: import("vue").ComputedRef<import("../types").GPUResourceSetting[] | undefined>;
|
|
97
|
-
filteredGpuOptionsMap: import("vue").ComputedRef<Map<string, GPUSetting>>;
|
|
98
|
-
getGPUTypeInSide: (quotaType?: string) => string;
|
|
99
|
-
handleTypeChange: (val: unknown) => void;
|
|
100
|
-
validate: () => Promise<import("vee-validate").FormValidationResult<GpuQuotaItem>> | {
|
|
101
|
-
valid: boolean;
|
|
102
|
-
};
|
|
103
|
-
nvidiaVgpuModelKey: string;
|
|
104
|
-
nvidiaVgpuPriorityKey: string;
|
|
105
|
-
nvidiaVgpuKey: string;
|
|
106
|
-
nvidiaVgpuResOrder: Map<string, string>;
|
|
107
|
-
yup: typeof yup;
|
|
108
|
-
deSanitizeGPUObjectKey: <T extends Record<string, unknown>>(obj?: T | undefined) => T;
|
|
109
|
-
gpuResourceHelperSlot: () => string[] | undefined;
|
|
110
|
-
openNvidiaVgpuModel: import("vue").Ref<boolean>;
|
|
111
|
-
openNvidiaVgpuScheulePolicy: import("vue").Ref<boolean>;
|
|
112
|
-
isNvidiaVgpu: (key?: string | undefined) => boolean;
|
|
113
|
-
isNvidiaMig: (key?: string | undefined) => boolean;
|
|
114
|
-
showDynamicForm: import("vue").ComputedRef<boolean | undefined>;
|
|
115
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:quotaItem" | "refreshGpuOptionsMap")[], "change" | "update:quotaItem" | "refreshGpuOptionsMap", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
116
|
-
gpuSettingsAdaptor: {
|
|
117
|
-
type: import("vue").PropType<import("../props").GPUSettings>;
|
|
118
|
-
default: undefined;
|
|
119
|
-
};
|
|
120
|
-
nvidiaVgpuModelsAdaptor: {
|
|
121
|
-
type: import("vue").PropType<{
|
|
122
|
-
data: import("../types").GPUSummary[];
|
|
123
|
-
loading: boolean;
|
|
124
|
-
refresh: () => import("../types").GPUSummary[] | Promise<import("../types").GPUSummary[]>;
|
|
125
|
-
}>;
|
|
126
|
-
default: undefined;
|
|
127
|
-
};
|
|
128
|
-
targetType: {
|
|
129
|
-
type: StringConstructor;
|
|
130
|
-
default: string;
|
|
131
|
-
};
|
|
132
|
-
enableRemoteCall: {
|
|
133
|
-
type: BooleanConstructor;
|
|
134
|
-
default: boolean;
|
|
135
|
-
};
|
|
136
|
-
enableRangeValidate: {
|
|
137
|
-
type: BooleanConstructor;
|
|
138
|
-
default: boolean;
|
|
139
|
-
};
|
|
140
|
-
enableNvidiaVgpuModel: {
|
|
141
|
-
type: BooleanConstructor;
|
|
142
|
-
default: boolean;
|
|
143
|
-
};
|
|
144
|
-
nvidiaVgpuModel: {
|
|
145
|
-
type: StringConstructor;
|
|
146
|
-
default: undefined;
|
|
147
|
-
};
|
|
148
|
-
enableNvidiaVgpuPriority: {
|
|
149
|
-
type: BooleanConstructor;
|
|
150
|
-
default: boolean;
|
|
151
|
-
};
|
|
152
|
-
nvidiaVgpuPriority: {
|
|
153
|
-
type: import("vue").PropType<"0" | "1">;
|
|
154
|
-
default: undefined;
|
|
155
|
-
};
|
|
156
|
-
dynamicLimitOne: {
|
|
157
|
-
type: BooleanConstructor;
|
|
158
|
-
default: boolean;
|
|
159
|
-
};
|
|
160
|
-
enableNvidiaVgpuSchedulePolicy: {
|
|
161
|
-
type: BooleanConstructor;
|
|
162
|
-
default: boolean;
|
|
163
|
-
};
|
|
164
|
-
nvidiaVgpuGpuSchedule: {
|
|
165
|
-
type: import("vue").PropType<import("../types").VgpuSchedulePolicy>;
|
|
166
|
-
default: undefined;
|
|
167
|
-
};
|
|
168
|
-
nvidiaVgpuNodeSchedule: {
|
|
169
|
-
type: import("vue").PropType<import("../types").VgpuSchedulePolicy>;
|
|
170
|
-
default: undefined;
|
|
171
|
-
};
|
|
172
|
-
quotaItem: {
|
|
173
|
-
type: import("vue").PropType<GpuQuotaItem>;
|
|
174
|
-
default: () => {};
|
|
175
|
-
};
|
|
176
|
-
isSide: {
|
|
177
|
-
type: BooleanConstructor;
|
|
178
|
-
default: boolean;
|
|
179
|
-
};
|
|
180
|
-
availableQuotaItem: {
|
|
181
|
-
type: import("vue").PropType<GpuQuotaItem>;
|
|
182
|
-
default: undefined;
|
|
183
|
-
};
|
|
184
|
-
usedQuotaItem: {
|
|
185
|
-
type: import("vue").PropType<GpuQuotaItem>;
|
|
186
|
-
default: undefined;
|
|
187
|
-
};
|
|
188
|
-
existTypes: {
|
|
189
|
-
type: import("vue").PropType<string[]>;
|
|
190
|
-
default: () => never[];
|
|
191
|
-
};
|
|
192
|
-
gpuOptionsMap: {
|
|
193
|
-
type: import("vue").PropType<Map<string, GPUSetting>>;
|
|
194
|
-
required: boolean;
|
|
195
|
-
};
|
|
196
|
-
nvidiaGpuModels: {
|
|
197
|
-
type: import("vue").PropType<string[]>;
|
|
198
|
-
required: boolean;
|
|
199
|
-
};
|
|
200
|
-
getDisplayResource: {
|
|
201
|
-
type: import("vue").PropType<(type: string) => import("../types").GPUResourceSetting[]>;
|
|
202
|
-
required: boolean;
|
|
203
|
-
};
|
|
204
|
-
}>> & {
|
|
205
|
-
onChange?: ((...args: any[]) => any) | undefined;
|
|
206
|
-
"onUpdate:quotaItem"?: ((...args: any[]) => any) | undefined;
|
|
207
|
-
onRefreshGpuOptionsMap?: ((...args: any[]) => any) | undefined;
|
|
208
|
-
}, {
|
|
209
|
-
nvidiaVgpuModel: string;
|
|
210
|
-
nvidiaVgpuGpuSchedule: import("../types").VgpuSchedulePolicy;
|
|
211
|
-
nvidiaVgpuNodeSchedule: import("../types").VgpuSchedulePolicy;
|
|
212
|
-
gpuSettingsAdaptor: import("../props").GPUSettings;
|
|
213
|
-
nvidiaVgpuModelsAdaptor: {
|
|
214
|
-
data: import("../types").GPUSummary[];
|
|
215
|
-
loading: boolean;
|
|
216
|
-
refresh: () => import("../types").GPUSummary[] | Promise<import("../types").GPUSummary[]>;
|
|
217
|
-
};
|
|
218
|
-
targetType: string;
|
|
219
|
-
enableRemoteCall: boolean;
|
|
220
|
-
enableRangeValidate: boolean;
|
|
221
|
-
enableNvidiaVgpuModel: boolean;
|
|
222
|
-
enableNvidiaVgpuPriority: boolean;
|
|
223
|
-
nvidiaVgpuPriority: "0" | "1";
|
|
224
|
-
dynamicLimitOne: boolean;
|
|
225
|
-
enableNvidiaVgpuSchedulePolicy: boolean;
|
|
226
|
-
quotaItem: GpuQuotaItem;
|
|
227
|
-
isSide: boolean;
|
|
228
|
-
availableQuotaItem: GpuQuotaItem;
|
|
229
|
-
usedQuotaItem: GpuQuotaItem;
|
|
230
|
-
existTypes: string[];
|
|
231
|
-
}>;
|
|
232
|
-
export default _default;
|
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const vue = require("vue");
|
|
3
|
-
const yup = require("yup");
|
|
4
|
-
const lodashEs = require("lodash-es");
|
|
5
|
-
const veeValidate = require("vee-validate");
|
|
6
|
-
const vueI18n = require("vue-i18n");
|
|
7
|
-
const extend = require("@dao-style/extend");
|
|
8
|
-
const props = require("../props.js");
|
|
9
|
-
const types = require("../types.js");
|
|
10
|
-
const GpuResources = require("./GpuResources.vue.js");
|
|
11
|
-
const GpuAdvancedForm = require("./GpuAdvancedForm.vue.js");
|
|
12
|
-
const utils = require("../utils.js");
|
|
13
|
-
const GpuFormDynamicItem = require("./GpuFormDynamicItem.vue.js");
|
|
14
|
-
require("../style/gpu-form-item.scss.js");
|
|
15
|
-
function _interopNamespaceDefault(e) {
|
|
16
|
-
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
17
|
-
if (e) {
|
|
18
|
-
for (const k in e) {
|
|
19
|
-
if (k !== "default") {
|
|
20
|
-
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
21
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: () => e[k]
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
n.default = e;
|
|
29
|
-
return Object.freeze(n);
|
|
30
|
-
}
|
|
31
|
-
const yup__namespace = /* @__PURE__ */ _interopNamespaceDefault(yup);
|
|
32
|
-
const _sfc_main = vue.defineComponent({
|
|
33
|
-
name: "DaoGpuFormItem",
|
|
34
|
-
components: {
|
|
35
|
-
GpuFormDynamicItem,
|
|
36
|
-
DaoFormItemValidate: extend.DaoFormItemValidate,
|
|
37
|
-
GpuResources,
|
|
38
|
-
GpuAdvancedForm,
|
|
39
|
-
DaoHistoryLink: extend.DaoHistoryLink
|
|
40
|
-
},
|
|
41
|
-
props: props.gpuFormItemProps,
|
|
42
|
-
emits: [
|
|
43
|
-
"change",
|
|
44
|
-
"update:quotaItem",
|
|
45
|
-
"refreshGpuOptionsMap"
|
|
46
|
-
],
|
|
47
|
-
setup(props$1, {
|
|
48
|
-
emit: emits,
|
|
49
|
-
slots
|
|
50
|
-
}) {
|
|
51
|
-
const i18nInstance = vueI18n.useI18n();
|
|
52
|
-
const nvidiaVgpuResOrder = props.getNvidiaVgpuResOrder(i18nInstance);
|
|
53
|
-
const {
|
|
54
|
-
values: quota,
|
|
55
|
-
setValues,
|
|
56
|
-
validate
|
|
57
|
-
} = veeValidate.useForm({
|
|
58
|
-
initialValues: {}
|
|
59
|
-
});
|
|
60
|
-
const dynamicQuota = vue.ref({});
|
|
61
|
-
const currentDisplayResource = vue.computed(() => {
|
|
62
|
-
var _a;
|
|
63
|
-
return (_a = props$1.getDisplayResource) == null ? void 0 : _a.call(props$1, quota.type ?? "");
|
|
64
|
-
});
|
|
65
|
-
const openNvidiaVgpuModel = vue.ref(false);
|
|
66
|
-
const openNvidiaVgpuScheulePolicy = vue.ref(false);
|
|
67
|
-
const showDynamicForm = vue.computed(() => {
|
|
68
|
-
var _a, _b;
|
|
69
|
-
return (_b = (_a = props$1.gpuOptionsMap) == null ? void 0 : _a.get(quota.type ?? "")) == null ? void 0 : _b.isDynamic;
|
|
70
|
-
});
|
|
71
|
-
const initValues = () => {
|
|
72
|
-
var _a, _b;
|
|
73
|
-
const { id, type, resources } = props$1.quotaItem;
|
|
74
|
-
if (!id) {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
const newValues = {
|
|
78
|
-
id,
|
|
79
|
-
type
|
|
80
|
-
};
|
|
81
|
-
const isDynamic = type && ((_b = (_a = props$1.gpuOptionsMap) == null ? void 0 : _a.get(type)) == null ? void 0 : _b.isDynamic);
|
|
82
|
-
if (isDynamic) {
|
|
83
|
-
dynamicQuota.value = lodashEs.cloneDeep(utils.deSanitizeGPUObjectKey(resources) ?? {});
|
|
84
|
-
} else {
|
|
85
|
-
Object.entries(resources ?? {}).forEach(([key, val]) => {
|
|
86
|
-
lodashEs.set(newValues, ["resources", key], val);
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
if (utils.isNvidiaVgpu(type) && props$1.enableNvidiaVgpuModel) {
|
|
90
|
-
openNvidiaVgpuModel.value = !!props$1.quotaItem[types.nvidiaVgpuModelKey];
|
|
91
|
-
newValues[types.nvidiaVgpuModelKey] = openNvidiaVgpuModel.value ? props$1.quotaItem[types.nvidiaVgpuModelKey] : void 0;
|
|
92
|
-
}
|
|
93
|
-
if (utils.isNvidiaVgpu(type) && props$1.enableNvidiaVgpuSchedulePolicy) {
|
|
94
|
-
openNvidiaVgpuScheulePolicy.value = !!props$1.quotaItem[types.nvidiaVgpuGpuScheduleKey] || !!props$1.quotaItem[types.nvidiaVgpuNodeScheduleKey];
|
|
95
|
-
if (openNvidiaVgpuScheulePolicy.value) {
|
|
96
|
-
newValues[types.nvidiaVgpuGpuScheduleKey] = props$1.quotaItem[types.nvidiaVgpuGpuScheduleKey];
|
|
97
|
-
newValues[types.nvidiaVgpuNodeScheduleKey] = props$1.quotaItem[types.nvidiaVgpuNodeScheduleKey];
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
if (props$1.enableNvidiaVgpuPriority) {
|
|
101
|
-
newValues[types.nvidiaVgpuPriorityKey] = props$1.quotaItem[types.nvidiaVgpuPriorityKey];
|
|
102
|
-
}
|
|
103
|
-
setValues(newValues);
|
|
104
|
-
};
|
|
105
|
-
if (utils.isNvidiaVgpu(props$1.quotaItem.type)) {
|
|
106
|
-
initValues();
|
|
107
|
-
} else {
|
|
108
|
-
const unwatchInit = vue.watch(() => props$1.gpuOptionsMap, (newGpuOptions) => {
|
|
109
|
-
if (newGpuOptions == null ? void 0 : newGpuOptions.size) {
|
|
110
|
-
initValues();
|
|
111
|
-
setTimeout(() => {
|
|
112
|
-
unwatchInit == null ? void 0 : unwatchInit();
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
}, {
|
|
116
|
-
immediate: true
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
if (props$1.isSide) {
|
|
120
|
-
vue.watch(() => props$1.quotaItem, () => {
|
|
121
|
-
initValues();
|
|
122
|
-
}, {
|
|
123
|
-
deep: true
|
|
124
|
-
});
|
|
125
|
-
} else {
|
|
126
|
-
vue.watch([() => quota, dynamicQuota], () => {
|
|
127
|
-
if (showDynamicForm.value) {
|
|
128
|
-
emits("change", {
|
|
129
|
-
type: quota.type,
|
|
130
|
-
id: quota.id,
|
|
131
|
-
resources: dynamicQuota.value,
|
|
132
|
-
removable: props$1.quotaItem.removable
|
|
133
|
-
});
|
|
134
|
-
} else {
|
|
135
|
-
const parsedResources = utils.deSanitizeGPUObjectKey(quota.resources);
|
|
136
|
-
const newQuota = {
|
|
137
|
-
type: quota.type,
|
|
138
|
-
id: quota.id,
|
|
139
|
-
resources: parsedResources,
|
|
140
|
-
removable: props$1.quotaItem.removable
|
|
141
|
-
};
|
|
142
|
-
if (quota.type === props.nvidiaVgpuKey) {
|
|
143
|
-
newQuota[types.nvidiaVgpuModelKey] = openNvidiaVgpuModel.value ? quota[types.nvidiaVgpuModelKey] : void 0;
|
|
144
|
-
if (props$1.enableNvidiaVgpuPriority) {
|
|
145
|
-
newQuota[types.nvidiaVgpuPriorityKey] = quota[types.nvidiaVgpuPriorityKey];
|
|
146
|
-
}
|
|
147
|
-
if (props$1.enableNvidiaVgpuSchedulePolicy) {
|
|
148
|
-
if (openNvidiaVgpuScheulePolicy.value) {
|
|
149
|
-
Object.assign(newQuota, {
|
|
150
|
-
[types.nvidiaVgpuGpuScheduleKey]: quota[types.nvidiaVgpuGpuScheduleKey],
|
|
151
|
-
[types.nvidiaVgpuNodeScheduleKey]: quota[types.nvidiaVgpuNodeScheduleKey]
|
|
152
|
-
});
|
|
153
|
-
} else {
|
|
154
|
-
Object.assign(newQuota, {
|
|
155
|
-
[types.nvidiaVgpuGpuScheduleKey]: void 0,
|
|
156
|
-
[types.nvidiaVgpuNodeScheduleKey]: void 0
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
emits("change", newQuota);
|
|
162
|
-
}
|
|
163
|
-
}, {
|
|
164
|
-
deep: true
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
const filteredGpuOptionsMap = vue.computed(() => {
|
|
168
|
-
var _a;
|
|
169
|
-
const map = /* @__PURE__ */ new Map();
|
|
170
|
-
(_a = props$1.gpuOptionsMap) == null ? void 0 : _a.forEach((option, key) => {
|
|
171
|
-
if (key === quota.type || !props$1.existTypes.includes(key) && (!props$1.targetType || props$1.targetType && key === props$1.targetType)) {
|
|
172
|
-
map.set(key, option);
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
return map;
|
|
176
|
-
});
|
|
177
|
-
const priorityOpts = props.getPriorityOpts(i18nInstance);
|
|
178
|
-
const handleTypeChange = (val) => {
|
|
179
|
-
quota.resources = {};
|
|
180
|
-
if (props$1.enableNvidiaVgpuPriority && val === props.nvidiaVgpuKey) {
|
|
181
|
-
quota[types.nvidiaVgpuPriorityKey] = priorityOpts[0].value;
|
|
182
|
-
}
|
|
183
|
-
if (val !== props.nvidiaVgpuKey && props$1.enableNvidiaVgpuSchedulePolicy) {
|
|
184
|
-
openNvidiaVgpuScheulePolicy.value = false;
|
|
185
|
-
}
|
|
186
|
-
};
|
|
187
|
-
const validateWrapper = () => {
|
|
188
|
-
if (props$1.isSide) {
|
|
189
|
-
return {
|
|
190
|
-
valid: true
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
return validate();
|
|
194
|
-
};
|
|
195
|
-
const gpuResourceHelperSlot = () => {
|
|
196
|
-
var _a;
|
|
197
|
-
return (_a = currentDisplayResource.value) == null ? void 0 : _a.reduce((acc, res) => {
|
|
198
|
-
const helperKey = `helper-${res.key}`;
|
|
199
|
-
if (slots[helperKey]) {
|
|
200
|
-
acc.push(helperKey);
|
|
201
|
-
}
|
|
202
|
-
return acc;
|
|
203
|
-
}, []);
|
|
204
|
-
};
|
|
205
|
-
const getGPUTypeInSide = (quotaType) => {
|
|
206
|
-
var _a;
|
|
207
|
-
if (!quotaType) {
|
|
208
|
-
return "";
|
|
209
|
-
}
|
|
210
|
-
return ((_a = filteredGpuOptionsMap.value.get(quotaType)) == null ? void 0 : _a.alias) ?? quotaType;
|
|
211
|
-
};
|
|
212
|
-
return {
|
|
213
|
-
quota,
|
|
214
|
-
dynamicQuota,
|
|
215
|
-
currentDisplayResource,
|
|
216
|
-
filteredGpuOptionsMap,
|
|
217
|
-
getGPUTypeInSide,
|
|
218
|
-
handleTypeChange,
|
|
219
|
-
validate: validateWrapper,
|
|
220
|
-
nvidiaVgpuModelKey: types.nvidiaVgpuModelKey,
|
|
221
|
-
nvidiaVgpuPriorityKey: types.nvidiaVgpuPriorityKey,
|
|
222
|
-
nvidiaVgpuKey: props.nvidiaVgpuKey,
|
|
223
|
-
nvidiaVgpuResOrder,
|
|
224
|
-
yup: yup__namespace,
|
|
225
|
-
deSanitizeGPUObjectKey: utils.deSanitizeGPUObjectKey,
|
|
226
|
-
gpuResourceHelperSlot,
|
|
227
|
-
openNvidiaVgpuModel,
|
|
228
|
-
openNvidiaVgpuScheulePolicy,
|
|
229
|
-
isNvidiaVgpu: utils.isNvidiaVgpu,
|
|
230
|
-
isNvidiaMig: utils.isNvidiaMig,
|
|
231
|
-
showDynamicForm
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
});
|
|
235
|
-
module.exports = _sfc_main;
|
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, watch } from "vue";
|
|
2
|
-
import * as yup from "yup";
|
|
3
|
-
import { cloneDeep, set } from "lodash-es";
|
|
4
|
-
import { useForm } from "vee-validate";
|
|
5
|
-
import { useI18n } from "vue-i18n";
|
|
6
|
-
import { DaoFormItemValidate, DaoHistoryLink } from "@dao-style/extend";
|
|
7
|
-
import { gpuFormItemProps, getNvidiaVgpuResOrder, nvidiaVgpuKey, getPriorityOpts } from "../props.mjs";
|
|
8
|
-
import { nvidiaVgpuModelKey, nvidiaVgpuPriorityKey, nvidiaVgpuGpuScheduleKey, nvidiaVgpuNodeScheduleKey } from "../types.mjs";
|
|
9
|
-
import GpuResources from "./GpuResources.vue.mjs";
|
|
10
|
-
import GpuAdvancedForm from "./GpuAdvancedForm.vue.mjs";
|
|
11
|
-
import { isNvidiaVgpu, deSanitizeGPUObjectKey, isNvidiaMig } from "../utils.mjs";
|
|
12
|
-
import GpuFormDynamicItem from "./GpuFormDynamicItem.vue.mjs";
|
|
13
|
-
import "../style/gpu-form-item.scss.mjs";
|
|
14
|
-
const _sfc_main = defineComponent({
|
|
15
|
-
name: "DaoGpuFormItem",
|
|
16
|
-
components: {
|
|
17
|
-
GpuFormDynamicItem,
|
|
18
|
-
DaoFormItemValidate,
|
|
19
|
-
GpuResources,
|
|
20
|
-
GpuAdvancedForm,
|
|
21
|
-
DaoHistoryLink
|
|
22
|
-
},
|
|
23
|
-
props: gpuFormItemProps,
|
|
24
|
-
emits: [
|
|
25
|
-
"change",
|
|
26
|
-
"update:quotaItem",
|
|
27
|
-
"refreshGpuOptionsMap"
|
|
28
|
-
],
|
|
29
|
-
setup(props, {
|
|
30
|
-
emit: emits,
|
|
31
|
-
slots
|
|
32
|
-
}) {
|
|
33
|
-
const i18nInstance = useI18n();
|
|
34
|
-
const nvidiaVgpuResOrder = getNvidiaVgpuResOrder(i18nInstance);
|
|
35
|
-
const {
|
|
36
|
-
values: quota,
|
|
37
|
-
setValues,
|
|
38
|
-
validate
|
|
39
|
-
} = useForm({
|
|
40
|
-
initialValues: {}
|
|
41
|
-
});
|
|
42
|
-
const dynamicQuota = ref({});
|
|
43
|
-
const currentDisplayResource = computed(() => {
|
|
44
|
-
var _a;
|
|
45
|
-
return (_a = props.getDisplayResource) == null ? void 0 : _a.call(props, quota.type ?? "");
|
|
46
|
-
});
|
|
47
|
-
const openNvidiaVgpuModel = ref(false);
|
|
48
|
-
const openNvidiaVgpuScheulePolicy = ref(false);
|
|
49
|
-
const showDynamicForm = computed(() => {
|
|
50
|
-
var _a, _b;
|
|
51
|
-
return (_b = (_a = props.gpuOptionsMap) == null ? void 0 : _a.get(quota.type ?? "")) == null ? void 0 : _b.isDynamic;
|
|
52
|
-
});
|
|
53
|
-
const initValues = () => {
|
|
54
|
-
var _a, _b;
|
|
55
|
-
const { id, type, resources } = props.quotaItem;
|
|
56
|
-
if (!id) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
const newValues = {
|
|
60
|
-
id,
|
|
61
|
-
type
|
|
62
|
-
};
|
|
63
|
-
const isDynamic = type && ((_b = (_a = props.gpuOptionsMap) == null ? void 0 : _a.get(type)) == null ? void 0 : _b.isDynamic);
|
|
64
|
-
if (isDynamic) {
|
|
65
|
-
dynamicQuota.value = cloneDeep(deSanitizeGPUObjectKey(resources) ?? {});
|
|
66
|
-
} else {
|
|
67
|
-
Object.entries(resources ?? {}).forEach(([key, val]) => {
|
|
68
|
-
set(newValues, ["resources", key], val);
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
if (isNvidiaVgpu(type) && props.enableNvidiaVgpuModel) {
|
|
72
|
-
openNvidiaVgpuModel.value = !!props.quotaItem[nvidiaVgpuModelKey];
|
|
73
|
-
newValues[nvidiaVgpuModelKey] = openNvidiaVgpuModel.value ? props.quotaItem[nvidiaVgpuModelKey] : void 0;
|
|
74
|
-
}
|
|
75
|
-
if (isNvidiaVgpu(type) && props.enableNvidiaVgpuSchedulePolicy) {
|
|
76
|
-
openNvidiaVgpuScheulePolicy.value = !!props.quotaItem[nvidiaVgpuGpuScheduleKey] || !!props.quotaItem[nvidiaVgpuNodeScheduleKey];
|
|
77
|
-
if (openNvidiaVgpuScheulePolicy.value) {
|
|
78
|
-
newValues[nvidiaVgpuGpuScheduleKey] = props.quotaItem[nvidiaVgpuGpuScheduleKey];
|
|
79
|
-
newValues[nvidiaVgpuNodeScheduleKey] = props.quotaItem[nvidiaVgpuNodeScheduleKey];
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
if (props.enableNvidiaVgpuPriority) {
|
|
83
|
-
newValues[nvidiaVgpuPriorityKey] = props.quotaItem[nvidiaVgpuPriorityKey];
|
|
84
|
-
}
|
|
85
|
-
setValues(newValues);
|
|
86
|
-
};
|
|
87
|
-
if (isNvidiaVgpu(props.quotaItem.type)) {
|
|
88
|
-
initValues();
|
|
89
|
-
} else {
|
|
90
|
-
const unwatchInit = watch(() => props.gpuOptionsMap, (newGpuOptions) => {
|
|
91
|
-
if (newGpuOptions == null ? void 0 : newGpuOptions.size) {
|
|
92
|
-
initValues();
|
|
93
|
-
setTimeout(() => {
|
|
94
|
-
unwatchInit == null ? void 0 : unwatchInit();
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
}, {
|
|
98
|
-
immediate: true
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
if (props.isSide) {
|
|
102
|
-
watch(() => props.quotaItem, () => {
|
|
103
|
-
initValues();
|
|
104
|
-
}, {
|
|
105
|
-
deep: true
|
|
106
|
-
});
|
|
107
|
-
} else {
|
|
108
|
-
watch([() => quota, dynamicQuota], () => {
|
|
109
|
-
if (showDynamicForm.value) {
|
|
110
|
-
emits("change", {
|
|
111
|
-
type: quota.type,
|
|
112
|
-
id: quota.id,
|
|
113
|
-
resources: dynamicQuota.value,
|
|
114
|
-
removable: props.quotaItem.removable
|
|
115
|
-
});
|
|
116
|
-
} else {
|
|
117
|
-
const parsedResources = deSanitizeGPUObjectKey(quota.resources);
|
|
118
|
-
const newQuota = {
|
|
119
|
-
type: quota.type,
|
|
120
|
-
id: quota.id,
|
|
121
|
-
resources: parsedResources,
|
|
122
|
-
removable: props.quotaItem.removable
|
|
123
|
-
};
|
|
124
|
-
if (quota.type === nvidiaVgpuKey) {
|
|
125
|
-
newQuota[nvidiaVgpuModelKey] = openNvidiaVgpuModel.value ? quota[nvidiaVgpuModelKey] : void 0;
|
|
126
|
-
if (props.enableNvidiaVgpuPriority) {
|
|
127
|
-
newQuota[nvidiaVgpuPriorityKey] = quota[nvidiaVgpuPriorityKey];
|
|
128
|
-
}
|
|
129
|
-
if (props.enableNvidiaVgpuSchedulePolicy) {
|
|
130
|
-
if (openNvidiaVgpuScheulePolicy.value) {
|
|
131
|
-
Object.assign(newQuota, {
|
|
132
|
-
[nvidiaVgpuGpuScheduleKey]: quota[nvidiaVgpuGpuScheduleKey],
|
|
133
|
-
[nvidiaVgpuNodeScheduleKey]: quota[nvidiaVgpuNodeScheduleKey]
|
|
134
|
-
});
|
|
135
|
-
} else {
|
|
136
|
-
Object.assign(newQuota, {
|
|
137
|
-
[nvidiaVgpuGpuScheduleKey]: void 0,
|
|
138
|
-
[nvidiaVgpuNodeScheduleKey]: void 0
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
emits("change", newQuota);
|
|
144
|
-
}
|
|
145
|
-
}, {
|
|
146
|
-
deep: true
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
const filteredGpuOptionsMap = computed(() => {
|
|
150
|
-
var _a;
|
|
151
|
-
const map = /* @__PURE__ */ new Map();
|
|
152
|
-
(_a = props.gpuOptionsMap) == null ? void 0 : _a.forEach((option, key) => {
|
|
153
|
-
if (key === quota.type || !props.existTypes.includes(key) && (!props.targetType || props.targetType && key === props.targetType)) {
|
|
154
|
-
map.set(key, option);
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
return map;
|
|
158
|
-
});
|
|
159
|
-
const priorityOpts = getPriorityOpts(i18nInstance);
|
|
160
|
-
const handleTypeChange = (val) => {
|
|
161
|
-
quota.resources = {};
|
|
162
|
-
if (props.enableNvidiaVgpuPriority && val === nvidiaVgpuKey) {
|
|
163
|
-
quota[nvidiaVgpuPriorityKey] = priorityOpts[0].value;
|
|
164
|
-
}
|
|
165
|
-
if (val !== nvidiaVgpuKey && props.enableNvidiaVgpuSchedulePolicy) {
|
|
166
|
-
openNvidiaVgpuScheulePolicy.value = false;
|
|
167
|
-
}
|
|
168
|
-
};
|
|
169
|
-
const validateWrapper = () => {
|
|
170
|
-
if (props.isSide) {
|
|
171
|
-
return {
|
|
172
|
-
valid: true
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
return validate();
|
|
176
|
-
};
|
|
177
|
-
const gpuResourceHelperSlot = () => {
|
|
178
|
-
var _a;
|
|
179
|
-
return (_a = currentDisplayResource.value) == null ? void 0 : _a.reduce((acc, res) => {
|
|
180
|
-
const helperKey = `helper-${res.key}`;
|
|
181
|
-
if (slots[helperKey]) {
|
|
182
|
-
acc.push(helperKey);
|
|
183
|
-
}
|
|
184
|
-
return acc;
|
|
185
|
-
}, []);
|
|
186
|
-
};
|
|
187
|
-
const getGPUTypeInSide = (quotaType) => {
|
|
188
|
-
var _a;
|
|
189
|
-
if (!quotaType) {
|
|
190
|
-
return "";
|
|
191
|
-
}
|
|
192
|
-
return ((_a = filteredGpuOptionsMap.value.get(quotaType)) == null ? void 0 : _a.alias) ?? quotaType;
|
|
193
|
-
};
|
|
194
|
-
return {
|
|
195
|
-
quota,
|
|
196
|
-
dynamicQuota,
|
|
197
|
-
currentDisplayResource,
|
|
198
|
-
filteredGpuOptionsMap,
|
|
199
|
-
getGPUTypeInSide,
|
|
200
|
-
handleTypeChange,
|
|
201
|
-
validate: validateWrapper,
|
|
202
|
-
nvidiaVgpuModelKey,
|
|
203
|
-
nvidiaVgpuPriorityKey,
|
|
204
|
-
nvidiaVgpuKey,
|
|
205
|
-
nvidiaVgpuResOrder,
|
|
206
|
-
yup,
|
|
207
|
-
deSanitizeGPUObjectKey,
|
|
208
|
-
gpuResourceHelperSlot,
|
|
209
|
-
openNvidiaVgpuModel,
|
|
210
|
-
openNvidiaVgpuScheulePolicy,
|
|
211
|
-
isNvidiaVgpu,
|
|
212
|
-
isNvidiaMig,
|
|
213
|
-
showDynamicForm
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
});
|
|
217
|
-
export {
|
|
218
|
-
_sfc_main as default
|
|
219
|
-
};
|