| @@ -14,9 +14,7 @@ type ResourceItemProps = { | |||||
| }; | }; | ||||
| function ResourceItem({ item, isPublic, onClick, onRemove }: ResourceItemProps) { | function ResourceItem({ item, isPublic, onClick, onRemove }: ResourceItemProps) { | ||||
| const timeAgo = `更新于${ | |||||
| item.update_time ? formatDate(item.update_time, 'YYYY-MM-DD') : item.time_ago ?? '' | |||||
| }`; | |||||
| const timeAgo = `最近更新:${formatDate(item.full_last_update_time, 'YYYY-MM-DD HH:mm')}`; | |||||
| const create_by = item.create_by ?? ''; | const create_by = item.create_by ?? ''; | ||||
| return ( | return ( | ||||
| <div className={styles['resource-item']} onClick={() => onClick(item)}> | <div className={styles['resource-item']} onClick={() => onClick(item)}> | ||||
| @@ -164,6 +164,7 @@ export interface ResourceData { | |||||
| train_task?: TrainTask; // 训练任务 | train_task?: TrainTask; // 训练任务 | ||||
| praises_count: number; // 点赞数 | praises_count: number; // 点赞数 | ||||
| praised: boolean; // 是否点赞 | praised: boolean; // 是否点赞 | ||||
| full_last_update_time: string; // 完整的更新时间 | |||||
| } | } | ||||
| // 数据集数据 | // 数据集数据 | ||||
| @@ -30,7 +30,7 @@ interface Workflow { | |||||
| } | } | ||||
| // 根据参数设置输入组件 | // 根据参数设置输入组件 | ||||
| export const getParamComponent = (paramType: number, isSensitive?: number): JSX.Element => { | |||||
| export const getParamComponent = (paramType: number): JSX.Element => { | |||||
| // 防止后台返回不是 number 类型 | // 防止后台返回不是 number 类型 | ||||
| if (Number(paramType) === 3) { | if (Number(paramType) === 3) { | ||||
| return ( | return ( | ||||
| @@ -40,9 +40,9 @@ export const getParamComponent = (paramType: number, isSensitive?: number): JSX. | |||||
| </Radio.Group> | </Radio.Group> | ||||
| ); | ); | ||||
| } | } | ||||
| if (isSensitive && Number(isSensitive) === 1) { | |||||
| return <Input.Password placeholder="请输入值" visibilityToggle={false} allowClear />; | |||||
| } | |||||
| // if (isSensitive && Number(isSensitive) === 1) { | |||||
| // return <Input.Password placeholder="请输入值" visibilityToggle={false} allowClear />; | |||||
| // } | |||||
| return <Input placeholder="请输入值" allowClear />; | return <Input placeholder="请输入值" allowClear />; | ||||
| }; | }; | ||||
| @@ -202,11 +202,7 @@ function AddExperimentModal({ | |||||
| </Select> | </Select> | ||||
| </Form.Item> | </Form.Item> | ||||
| {globalParam.length > 0 && ( | {globalParam.length > 0 && ( | ||||
| <Form.Item | |||||
| label="运行参数" | |||||
| tooltip="展示关联的流水线的参数,脱敏的参数以xxxx展示" | |||||
| {...tailLayout} | |||||
| > | |||||
| <Form.Item label="运行参数" tooltip="展示关联的流水线的参数" {...tailLayout}> | |||||
| <div className={styles.global_param_item}> | <div className={styles.global_param_item}> | ||||
| <Form.List name="global_param"> | <Form.List name="global_param"> | ||||
| {(fields) => | {(fields) => | ||||
| @@ -219,10 +215,7 @@ function AddExperimentModal({ | |||||
| name={[name, 'param_value']} | name={[name, 'param_value']} | ||||
| rules={getParamRules(globalParam[name]['param_type'], true)} | rules={getParamRules(globalParam[name]['param_type'], true)} | ||||
| > | > | ||||
| {getParamComponent( | |||||
| globalParam[name]['param_type'], | |||||
| globalParam[name]['is_sensitive'], | |||||
| )} | |||||
| {getParamComponent(globalParam[name]['param_type'])} | |||||
| </Form.Item> | </Form.Item> | ||||
| )) | )) | ||||
| } | } | ||||
| @@ -47,10 +47,7 @@ function ParamsModal({ open, onCancel, globalParam = [] }: ParamsModalProps) { | |||||
| name={[name, 'param_value']} | name={[name, 'param_value']} | ||||
| label={getParamLabel(globalParam[name])} | label={getParamLabel(globalParam[name])} | ||||
| > | > | ||||
| {getParamComponent( | |||||
| globalParam[name]['param_type'], | |||||
| globalParam[name]['is_sensitive'], | |||||
| )} | |||||
| {getParamComponent(globalParam[name]['param_type'])} | |||||
| </Form.Item> | </Form.Item> | ||||
| )) | )) | ||||
| } | } | ||||
| @@ -52,30 +52,32 @@ function ServiceVersionInfo() { | |||||
| }, | }, | ||||
| ]; | ]; | ||||
| if (versionInfo?.run_state === ServiceRunStatus.Running && versionInfo?.page_path) { | |||||
| tabItems.push({ | |||||
| key: ModelDeploymentTabKey.Predict, | |||||
| label: '预测', | |||||
| icon: <KFIcon type="icon-yuce" />, | |||||
| children: ( | |||||
| <div style={{ height: '100%', width: '100%' }}> | |||||
| <FullScreenFrame url={versionInfo?.page_path}></FullScreenFrame> | |||||
| </div> | |||||
| ), | |||||
| }); | |||||
| } | |||||
| if (versionInfo?.run_state === ServiceRunStatus.Running) { | |||||
| if (versionInfo?.page_path) { | |||||
| tabItems.push({ | |||||
| key: ModelDeploymentTabKey.Predict, | |||||
| label: '预测', | |||||
| icon: <KFIcon type="icon-yuce" />, | |||||
| children: ( | |||||
| <div style={{ height: '100%', width: '100%' }}> | |||||
| <FullScreenFrame url={versionInfo?.page_path}></FullScreenFrame> | |||||
| </div> | |||||
| ), | |||||
| }); | |||||
| } | |||||
| if (versionInfo?.doc_path) { | |||||
| tabItems.push({ | |||||
| key: ModelDeploymentTabKey.Guide, | |||||
| label: '调用指南', | |||||
| icon: <KFIcon type="icon-tiaoyongzhinan" />, | |||||
| children: ( | |||||
| <div style={{ height: '100%', width: '100%' }}> | |||||
| <FullScreenFrame url={versionInfo?.doc_path}></FullScreenFrame> | |||||
| </div> | |||||
| ), | |||||
| }); | |||||
| if (versionInfo?.doc_path) { | |||||
| tabItems.push({ | |||||
| key: ModelDeploymentTabKey.Guide, | |||||
| label: '调用指南', | |||||
| icon: <KFIcon type="icon-tiaoyongzhinan" />, | |||||
| children: ( | |||||
| <div style={{ height: '100%', width: '100%' }}> | |||||
| <FullScreenFrame url={versionInfo?.doc_path}></FullScreenFrame> | |||||
| </div> | |||||
| ), | |||||
| }); | |||||
| } | |||||
| } | } | ||||
| tabItems.push({ | tabItems.push({ | ||||
| @@ -148,7 +148,7 @@ const GlobalParamsDrawer = forwardRef( | |||||
| > | > | ||||
| {getParamComponent(type)} | {getParamComponent(type)} | ||||
| </Form.Item> | </Form.Item> | ||||
| {type !== 3 && ( | |||||
| {/* {type !== 3 && ( | |||||
| <Form.Item | <Form.Item | ||||
| {...restField} | {...restField} | ||||
| name={[name, 'is_sensitive']} | name={[name, 'is_sensitive']} | ||||
| @@ -161,7 +161,7 @@ const GlobalParamsDrawer = forwardRef( | |||||
| <Radio value={0}>否</Radio> | <Radio value={0}>否</Radio> | ||||
| </Radio.Group> | </Radio.Group> | ||||
| </Form.Item> | </Form.Item> | ||||
| )} | |||||
| )} */} | |||||
| </> | </> | ||||
| ); | ); | ||||
| }} | }} | ||||