Skip to content

Commit

Permalink
handle running jobs in /jobs view
Browse files Browse the repository at this point in the history
  • Loading branch information
rhanka committed Oct 14, 2024
1 parent 146906a commit ce8c767
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/components/tools/jobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ export const getJobsFilteredData = async (accessToken) => {
processing_time: delay,
columns: validColumns.filter(c => j.data && j.data[c]),
processing_rate: j.processedOn && Math.floor((progress / 100) * (j.data.totalRows / delay)),
finishedOnTime: j.finishedOn ? dateTostr(new Date(j.finishedOn)) : 'job en cours',
deletionTime: j.finishedOn ? dateTostr(new Date(j.finishedOn + (j.data.tmpfilePersistence || 3600000))) : 'job en cours',
link: j.finishedOn && (Date.now() < new Date(j.finishedOn + (j.data.tmpfilePersistence || 3600000))) ? `/link?job=${j.data.randomKey}` : undefined,
finishedOnTime: j.finishedOn ? dateTostr(new Date(j.finishedOn)) : 'en cours',
deletionTime: j.status === 'completed' ? dateTostr(new Date(j.finishedOn + (j.data.tmpfilePersistence || 3600000))) : (j.status === 'failed' ? dateTostr(new Date(j.finishedOn)) : 'en cours'),
link: (['active', 'created', 'waiting', 'wait'].includes(j.status) || j.status === 'completed' && j.finishedOn && (Date.now() < new Date(j.finishedOn + (j.data.tmpfilePersistence || 3600000)))) ? `/link?job=${j.data.randomKey}` : undefined,
progress: progress
})});
return tmpJobs.sort((a,b) => (b.date - a.date)).map(j => {
Expand Down
5 changes: 4 additions & 1 deletion src/components/views/LinkJobs.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@
const statusLabel = {
completed: 'succès',
failed: 'échec',
cancelled: 'interrompu',
cancelled: 'annulé',
active: 'en cours',
wait: 'en attente',
waiting: 'en attente',
created: 'en cours'
}
Expand Down

0 comments on commit ce8c767

Please sign in to comment.