Skip to content

Commit 2b231ec

Browse files
Fix: Popup to tell user to check the jobs tab + template error
1 parent 3578637 commit 2b231ec

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

client/platform/desktop/backend/native/viame.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,9 @@ async function exportTrainedPipeline(settings: Settings,
285285
job.on('exit', async (code) => {
286286
if (code === 0) {
287287
if (fs.existsSync(converterOutput)) {
288+
if (fs.existsSync(path)) {
289+
fs.unlinkSync(path);
290+
}
288291
// We move instead of copying because .onnx files can be huge
289292
fs.moveSync(converterOutput, path);
290293
} else {

client/platform/desktop/frontend/components/MultiTrainingMenu.vue

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,22 @@ export default defineComponent({
148148
});
149149
if (!location.canceled && location.filePath) {
150150
await exportTrainedPipeline(location.filePath!, item);
151+
const goToJobsPage = !await prompt({
152+
title: 'Export Started',
153+
text: 'You can check the export status in the Jobs tab.',
154+
negativeButton: 'View',
155+
positiveButton: 'OK',
156+
confirm: true,
157+
});
158+
if (goToJobsPage) {
159+
router.push('/jobs');
160+
}
151161
}
152162
} catch (err) {
153163
console.log(err);
154-
let text = 'Unable to export model';
155-
if (err.response?.status === 403) text = 'You do not have permission to export the selected resource(s).';
164+
const errorTemplate = 'Unable to export model';
165+
let text = `${errorTemplate}: ${err}`;
166+
if (err.response?.status === 403) text = `${errorTemplate}: You do not have permission to export the selected resource(s).`;
156167
prompt({
157168
title: 'Export Failed',
158169
text,

0 commit comments

Comments
 (0)