diff --git a/src/pages/EditModelService/index.jsx b/src/pages/EditModelService/index.jsx index ecfaaf7..bd96be5 100644 --- a/src/pages/EditModelService/index.jsx +++ b/src/pages/EditModelService/index.jsx @@ -172,7 +172,7 @@ class EditModelService$$Page extends React.Component { this.setState({ listModels: res.Model.listModels.nodes, }); - } catch { + } catch (error) { // console.log(error, '===> err') } } @@ -196,7 +196,7 @@ class EditModelService$$Page extends React.Component { RAY_CLUSTER_INDEX: list[0]?.value, }); } - } catch { + } catch (error) { // console.log(error, '===> err') } } @@ -237,11 +237,12 @@ class EditModelService$$Page extends React.Component { model: getWorker.model.name, description: getWorker.description, configType: _configType, + labels: getWorker.labels, CUDA_VISIBLE_DEVICES: getWorker.additionalEnvs?.CUDA_VISIBLE_DEVICES, RAY_CLUSTER_INDEX: Number(getWorker.additionalEnvs?.RAY_CLUSTER_INDEX), NUMBER_GPUS: getWorker.additionalEnvs?.NUMBER_GPUS, resources: { - cpu: isMarksCpu ? Object.values(marks).indexOf(resources.cpu) : 0, + cpu: isMarksCpu ? Object.values(marks).findIndex(v => v === resources.cpu) : 0, memory: isMarksMemory ? Object.values(marks).findIndex(v => v === resources.memory?.split('Gi')[0]) : 0, @@ -251,7 +252,7 @@ class EditModelService$$Page extends React.Component { !isMarksMemory && resources.memory !== '512Mi' ? resources.memory?.split('Gi')[0] : undefined, - customGPU: gpuMarks[resources.nvidiaGPU] ? undefined : resources.nvidiaGPU, + customGPU: !gpuMarks[resources.nvidiaGPU] ? resources.nvidiaGPU : undefined, }, }); this.setState({ @@ -287,7 +288,7 @@ class EditModelService$$Page extends React.Component { : undefined, }); } - } catch { + } catch (error) { // console.log(error, '===> error') } } @@ -313,6 +314,7 @@ class EditModelService$$Page extends React.Component { name: v.name, displayName: v.displayName, description: v.description, + labels: v.labels, namespace: this.appHelper.utils.getAuthData().project || 'abc', type: v.configType && v.configType.includes('fastchat-vllm') ? 'fastchat-vllm' : 'fastchat', @@ -606,7 +608,10 @@ class EditModelService$$Page extends React.Component { disabled: false, mode: 'single', onChange: function () { - return Reflect.apply(this.onChangeModel, this, [...Array.prototype.slice.call(arguments)]); + return this.onChangeModel.apply( + this, + Array.prototype.slice.call(arguments).concat([]) + ); }.bind(this), placeholder: '请选择模型', showSearch: true, @@ -1114,7 +1119,10 @@ class EditModelService$$Page extends React.Component { 'x-component-props': { _sdkSwrGetFunc: {}, onChange: function () { - return Reflect.apply(this.onChangeType, this, [...Array.prototype.slice.call(arguments)]); + return this.onChangeType.apply( + this, + Array.prototype.slice.call(arguments).concat([]) + ); }.bind(this), }, }} @@ -1315,7 +1323,10 @@ class EditModelService$$Page extends React.Component { disabled={false} ghost={false} onClick={function () { - return Reflect.apply(this.onClickCheck, this, [...Array.prototype.slice.call(arguments)]); + return this.onClickCheck.apply( + this, + Array.prototype.slice.call(arguments).concat([]) + ); }.bind(this)} shape="default" size="small" @@ -1388,7 +1399,10 @@ class EditModelService$$Page extends React.Component { disabled={false} ghost={false} onClick={function () { - return Reflect.apply(this.handleCancle, this, [...Array.prototype.slice.call(arguments)]); + return this.handleCancle.apply( + this, + Array.prototype.slice.call(arguments).concat([]) + ); }.bind(this)} shape="default" > @@ -1401,7 +1415,10 @@ class EditModelService$$Page extends React.Component { disabled={false} ghost={false} onClick={function () { - return Reflect.apply(this.handleConfirm, this, [...Array.prototype.slice.call(arguments)]); + return this.handleConfirm.apply( + this, + Array.prototype.slice.call(arguments).concat([]) + ); }.bind(this)} shape="default" type="primary" @@ -1438,15 +1455,15 @@ const PageWrapper = (props = {}) => { }; return ( ( - - )} + self={self} sdkInitFunc={{ enabled: undefined, params: undefined, }} sdkSwrFuncs={[]} - self={self} + render={dataProps => ( + + )} /> ); }; @@ -1455,7 +1472,7 @@ export default PageWrapper; function __$$eval(expr) { try { return expr(); - } catch {} + } catch (error) {} } function __$$evalArray(expr) {