Skip to content

Commit

Permalink
Replaced /get/job by /api/v1/jobs/1
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita Manovich committed Jan 28, 2019
1 parent 6ca3c6f commit a66073c
Showing 1 changed file with 33 additions and 6 deletions.
39 changes: 33 additions & 6 deletions cvat/apps/engine/static/engine/js/annotationUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,39 @@
function callAnnotationUI(jid) {
initLogger(jid);
let loadJobEvent = Logger.addContinuedEvent(Logger.EventType.loadJob);
serverRequest("/get/job/" + jid, function(job) {
serverRequest("get/annotation/job/" + jid, function(data) {
$('#loadingOverlay').remove();
setTimeout(() => {
buildAnnotationUI(job, data, loadJobEvent);
}, 0);
serverRequest("/api/v1/jobs/" + jid, function(job) {
serverRequest("/api/v1/tasks/" + job.task_id, function(task) {
serverRequest("/api/v1/tasks/" + job.task_id + "/frames/meta", function(imageMetaCache) {
serverRequest("get/annotation/job/" + jid, function(data) {
$('#loadingOverlay').remove();
setTimeout(() => {
// FIXME: code cloning
let spec = {"labels": {}, "attributes": {}};
for (let label of task.labels) {
spec.labels[label.id] = label.name;
spec.attributes[label.id] = {};
for (let attr of label.attributes) {
spec.attributes[label.id][attr.id] = attr.text;
}
}
// FIXME: patch job object to correspond to the new REST API
job.labels = spec.labels;
job.attributes = spec.attributes;
job.stop = job.stop_frame;
job.start = job.start_frame;
job.jobid = job.id;
job.taskid = task.id;
job.slug = task.name;
job.mode = task.mode;
job.overlap = task.overlap;
job.z_order = task.z_order;
job.flipped = task.flipped;
job.image_meta_data = imageMetaCache;

buildAnnotationUI(job, data, loadJobEvent);
}, 0);
});
});
});
});
}
Expand Down

0 comments on commit a66073c

Please sign in to comment.