[ui] sort jobs by type (major jobs are shown first)

feat/vaults
Tomáš Mládek 2022-03-01 22:50:15 +01:00
parent 1aa779e816
commit e8af838020
No known key found for this signature in database
GPG Key ID: 65E225C8B3E2ED8A
2 changed files with 3 additions and 1 deletions

View File

@ -64,6 +64,7 @@ export interface IFile {
export interface IJob {
title: string;
job_type: string;
progress: number;
state: "InProgress" | "Done" | "Failed";
}

View File

@ -29,7 +29,8 @@
.map(([id, job]) => {
return { id, ...job };
})
.sort((j1, j2) => j1.id.localeCompare(j2.id));
.sort((j1, j2) => j1.id.localeCompare(j2.id))
.sort((j1, j2) => (j2.job_type || "").localeCompare(j1.job_type || ""));
if (activeJobs.length) {
timeout = setTimeout(updateJobs, 500);