github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/ui/app/utils/generate-exec-url.js (about) 1 import { get } from '@ember/object'; 2 3 export default function generateExecUrl(router, { job, taskGroup, task, allocation }) { 4 const queryParams = router.currentRoute.queryParams; 5 6 if (task) { 7 return router.urlFor('exec.task-group.task', get(job, 'plainId'), get(taskGroup, 'name'), get(task, 'name'), { 8 queryParams: { 9 allocation: get(allocation, 'shortId'), 10 ...queryParams, 11 }, 12 }); 13 } else if (taskGroup) { 14 return router.urlFor('exec.task-group', get(job, 'plainId'), get(taskGroup, 'name'), { queryParams }); 15 } else if (allocation) { 16 return router.urlFor('exec', get(job, 'plainId'), { queryParams: { allocation: get(allocation, 'shortId'), ...queryParams } }); 17 } else { 18 return router.urlFor('exec', get(job, 'plainId'), { queryParams }); 19 } 20 }