2023-04-10 15:36:59 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
|
|
*/
|
|
|
|
|
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 () {
|
2023-02-02 15:37:40 +00:00
|
|
|
this.route('run', function () {
|
|
|
|
this.route('templates', function () {
|
|
|
|
this.route('new');
|
|
|
|
this.route('manage');
|
|
|
|
this.route('template', { path: '/:name' });
|
|
|
|
});
|
|
|
|
});
|
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');
|
2022-08-26 03:22:55 +00:00
|
|
|
this.route('services', function () {
|
|
|
|
this.route('service', { path: '/:name' });
|
|
|
|
});
|
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');
|
|
|
|
});
|
|
|
|
|
2021-12-20 20:40:30 +00:00
|
|
|
// if we don't include function() the outlet won't render
|
2022-01-28 14:37:32 +00:00
|
|
|
this.route('evaluations', function () {});
|
2021-12-20 20:11:01 +00:00
|
|
|
|
2017-09-29 00:18:28 +00:00
|
|
|
this.route('not-found', { path: '/*' });
|
2022-05-30 17:10:44 +00:00
|
|
|
this.route('variables', function () {
|
|
|
|
this.route('new');
|
|
|
|
|
|
|
|
this.route(
|
|
|
|
'variable',
|
|
|
|
{
|
2022-08-15 15:56:09 +00:00
|
|
|
path: '/var/*id',
|
2022-05-30 17:10:44 +00:00
|
|
|
},
|
|
|
|
function () {
|
|
|
|
this.route('edit');
|
|
|
|
}
|
|
|
|
);
|
2022-06-07 01:42:23 +00:00
|
|
|
|
|
|
|
this.route('path', {
|
|
|
|
path: '/path/*absolutePath',
|
|
|
|
});
|
2022-05-30 17:10:44 +00:00
|
|
|
});
|
2022-12-06 17:45:36 +00:00
|
|
|
|
|
|
|
this.route('policies', function () {
|
|
|
|
this.route('new');
|
|
|
|
|
|
|
|
this.route('policy', {
|
|
|
|
path: '/:name',
|
|
|
|
});
|
|
|
|
});
|
2022-11-28 15:44:52 +00:00
|
|
|
// Mirage-only route for testing OIDC flow
|
|
|
|
if (config['ember-cli-mirage']) {
|
|
|
|
this.route('oidc-mock');
|
|
|
|
}
|
2017-09-19 14:47:10 +00:00
|
|
|
});
|