fix(web): default strategy process exception (#1032)

This commit is contained in:
katakuri
2024-01-05 11:45:40 +08:00
committed by GitHub
parent 757b61d4d7
commit d8393a9b32
24 changed files with 31 additions and 27 deletions

View File

@@ -104,13 +104,13 @@ export default function DocPanel(props: IProps) {
color = '#2db7f5';
break;
case 'FINISHED':
color = '#87d068';
color = 'cyan';
break;
case 'FAILED':
color = 'f50';
color = 'red';
break;
default:
color = 'f50';
color = 'red';
break;
}
return (

View File

@@ -81,12 +81,16 @@ export default function Segmentation(props: IProps) {
checked = false;
}
const strategy = strategies.filter((item) => item.strategy === name)[0];
const newParam: any = {};
// remove unused parameter, otherwise api will failed.
strategy.parameters.forEach((param) => {
const paramName = param.param_name;
newParam[paramName] = (item?.chunk_parameters as any)[paramName];
});
const newParam: any = {
chunk_strategy: item.chunk_parameters.chunk_strategy,
};
if (strategy && strategy.parameters) {
// remove unused parameter, otherwise api will failed.
strategy.parameters.forEach((param) => {
const paramName = param.param_name;
newParam[paramName] = (item?.chunk_parameters as any)[paramName];
});
}
item.chunk_parameters = newParam;
});
return checked;