2017-12-15 21:39:18 +00:00
|
|
|
import EmberRouter from '@ember/routing/router';
|
2021-02-17 21:01:44 +00:00
|
|
|
import config from 'nomad-ui/config/environment';
|
2017-09-19 14:47:10 +00:00
|
|
|
|
2020-07-09 16:37:00 +00:00
|
|
|
export default class Router extends EmberRouter {
|
2020-06-10 13:49:16 +00:00
|
|
|
location = config.locationType;
|
|
|
|
rootURL = config.rootURL;
|
|
|
|
}
|
2017-09-19 14:47:10 +00:00
|
|
|
|
2021-12-28 14:45:20 +00:00
|
|
|
Router.map(function () {
|
|
|
|
this.route('exec', { path: '/exec/:job_name' }, function () {
|
|
|
|
this.route('task-group', { path: '/:task_group_name' }, function () {
|
2020-03-24 23:22:16 +00:00
|
|
|
this.route('task', { path: '/:task_name' });
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2021-12-28 14:45:20 +00:00
|
|
|
this.route('jobs', function () {
|
2018-08-14 19:54:54 +00:00
|
|
|
this.route('run');
|
2021-12-28 14:45:20 +00:00
|
|
|
this.route('job', { path: '/:job_name' }, function () {
|
2017-09-19 14:47:10 +00:00
|
|
|
this.route('task-group', { path: '/:name' });
|
|
|
|
this.route('definition');
|
|
|
|
this.route('versions');
|
|
|
|
this.route('deployments');
|
2021-07-20 22:27:41 +00:00
|
|
|
this.route('dispatch');
|
2018-07-06 23:41:09 +00:00
|
|
|
this.route('evaluations');
|
2018-07-19 23:57:44 +00:00
|
|
|
this.route('allocations');
|
2021-10-07 21:11:38 +00:00
|
|
|
this.route('clients');
|
2017-09-19 14:47:10 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2021-12-28 14:45:20 +00:00
|
|
|
this.route('optimize', function () {
|
2020-11-04 18:22:24 +00:00
|
|
|
this.route('summary', { path: '*slug' });
|
|
|
|
});
|
2020-10-29 12:46:42 +00:00
|
|
|
|
2021-12-28 14:45:20 +00:00
|
|
|
this.route('clients', function () {
|
|
|
|
this.route('client', { path: '/:node_id' }, function () {
|
2020-06-13 03:59:33 +00:00
|
|
|
this.route('monitor');
|
|
|
|
});
|
2017-09-19 14:47:10 +00:00
|
|
|
});
|
|
|
|
|
2021-12-28 14:45:20 +00:00
|
|
|
this.route('servers', function () {
|
|
|
|
this.route('server', { path: '/:agent_id' }, function () {
|
2020-06-16 03:06:27 +00:00
|
|
|
this.route('monitor');
|
|
|
|
});
|
2017-09-19 14:47:10 +00:00
|
|
|
});
|
|
|
|
|
2020-08-13 16:56:35 +00:00
|
|
|
this.route('topology');
|
|
|
|
|
2021-12-28 14:45:20 +00:00
|
|
|
this.route('csi', function () {
|
|
|
|
this.route('volumes', function () {
|
2020-03-25 12:51:26 +00:00
|
|
|
this.route('volume', { path: '/:volume_name' });
|
|
|
|
});
|
2020-05-02 06:38:55 +00:00
|
|
|
|
2021-12-28 14:45:20 +00:00
|
|
|
this.route('plugins', function () {
|
|
|
|
this.route('plugin', { path: '/:plugin_name' }, function () {
|
2020-05-19 05:37:54 +00:00
|
|
|
this.route('allocations');
|
|
|
|
});
|
2020-05-02 06:38:55 +00:00
|
|
|
});
|
2020-03-25 12:51:26 +00:00
|
|
|
});
|
|
|
|
|
2021-12-28 14:45:20 +00:00
|
|
|
this.route('allocations', function () {
|
|
|
|
this.route('allocation', { path: '/:allocation_id' }, function () {
|
2020-06-01 13:15:59 +00:00
|
|
|
this.route('fs-root', { path: '/fs' });
|
|
|
|
this.route('fs', { path: '/fs/*path' });
|
|
|
|
|
2021-12-28 14:45:20 +00:00
|
|
|
this.route('task', { path: '/:name' }, function () {
|
2017-10-30 20:39:15 +00:00
|
|
|
this.route('logs');
|
2019-07-02 21:42:38 +00:00
|
|
|
this.route('fs-root', { path: '/fs' });
|
|
|
|
this.route('fs', { path: '/fs/*path' });
|
2017-10-30 20:39:15 +00:00
|
|
|
});
|
|
|
|
});
|
2017-09-19 14:47:10 +00:00
|
|
|
});
|
|
|
|
|
2021-12-28 14:45:20 +00:00
|
|
|
this.route('settings', function () {
|
2017-09-19 14:47:10 +00:00
|
|
|
this.route('tokens');
|
|
|
|
});
|
|
|
|
|
2017-09-29 00:18:28 +00:00
|
|
|
this.route('not-found', { path: '/*' });
|
2017-09-19 14:47:10 +00:00
|
|
|
});
|