fix: show message on model composition fail (#457)
* fix: show message on fail * fix: - forgoten log
This commit is contained in:
Родитель
27f60df561
Коммит
84f8285912
|
@ -26,6 +26,7 @@ export const constants = {
|
|||
statusCodeSucceeded: "succeeded",
|
||||
statusCodeReady: "ready",
|
||||
statusCodeFailed: "failed",
|
||||
statusCodeInvalid: "invalid",
|
||||
apiKeyHeader: "Ocp-Apim-Subscription-Key",
|
||||
maxRetry: 8,
|
||||
initialRetryInterval: 500, // ms
|
||||
|
|
|
@ -180,6 +180,9 @@ export const english: IAppStrings = {
|
|||
checkButtonAria: "Select model check button",
|
||||
checkAllButtonAria: "Select all models check button",
|
||||
|
||||
},
|
||||
errors: {
|
||||
failedCompose: "Something went wrong composed model was not created!"
|
||||
}
|
||||
},
|
||||
predict: {
|
||||
|
|
|
@ -180,7 +180,9 @@ export const spanish: IAppStrings = {
|
|||
headerAria: "Lista de encabezado de modelos",
|
||||
checkButtonAria: "Seleccionar botón de verificación del modelo",
|
||||
checkAllButtonAria: "Botón de verificación Seleccionar todos los modelos",
|
||||
|
||||
},
|
||||
errors: {
|
||||
failedCompose: "¡Algo salió mal, el modelo compuesto no fue creado!"
|
||||
}
|
||||
},
|
||||
predict: {
|
||||
|
|
|
@ -180,6 +180,9 @@ export interface IAppStrings {
|
|||
checkButtonAria: string,
|
||||
checkAllButtonAria: string,
|
||||
},
|
||||
errors: {
|
||||
failedCompose: string,
|
||||
}
|
||||
}
|
||||
predict: {
|
||||
title: string;
|
||||
|
|
|
@ -40,6 +40,7 @@ import ComposeModelView from "./composeModelView";
|
|||
import { ViewSelection } from "./viewSelection";
|
||||
import PreventLeaving from "../../common/preventLeaving/preventLeaving";
|
||||
import allSettled from "promise.allsettled";
|
||||
import { toast } from 'react-toastify';
|
||||
|
||||
export interface IModelComposePageProps extends RouteComponentProps, React.Props<ModelComposePage> {
|
||||
recentProjects: IProject[];
|
||||
|
@ -392,7 +393,7 @@ export default class ModelComposePage extends React.Component<IModelComposePageP
|
|||
composedTrainResults: composedModel["composedTrainResults"]
|
||||
} as IRecentModel;
|
||||
const recentModelRecords: IRecentModel[] = this.props.project.recentModelRecords ?
|
||||
[...this.props.project.recentModelRecords] : [];
|
||||
[...this.props.project.recentModelRecords] : [];
|
||||
recentModelRecords.unshift(newTrainRecord);
|
||||
if (recentModelRecords.length > constants.recentModelRecordsCount) {
|
||||
recentModelRecords.pop();
|
||||
|
@ -610,6 +611,10 @@ export default class ModelComposePage extends React.Component<IModelComposePageP
|
|||
ajax.then((response) => {
|
||||
if (response.data.modelInfo.status.toLowerCase() === constants.statusCodeReady) {
|
||||
resolve(response.data);
|
||||
} else if (response.data.modelInfo.status.toLowerCase() === constants.statusCodeInvalid) {
|
||||
toast.error(strings.modelCompose.errors.failedCompose, { autoClose: false });
|
||||
this.setState({ isComposing: false });
|
||||
return;
|
||||
} else if (Number(new Date()) < endTime) {
|
||||
// If the request isn't succeeded and the timeout hasn't elapsed, go again
|
||||
setTimeout(checkSucceeded, interval, resolve, reject);
|
||||
|
|
Загрузка…
Ссылка в новой задаче