github.com/zoomfoo/nomad@v0.8.5-0.20180907175415-f28fd3a1a056/ui/app/router.js (about)

     1  import EmberRouter from '@ember/routing/router';
     2  import config from './config/environment';
     3  
     4  const Router = EmberRouter.extend({
     5    location: config.locationType,
     6    rootURL: config.rootURL,
     7  });
     8  
     9  Router.map(function() {
    10    this.route('jobs', function() {
    11      this.route('run');
    12      this.route('job', { path: '/:job_name' }, function() {
    13        this.route('task-group', { path: '/:name' });
    14        this.route('definition');
    15        this.route('versions');
    16        this.route('deployments');
    17        this.route('evaluations');
    18        this.route('allocations');
    19        this.route('edit');
    20      });
    21    });
    22  
    23    this.route('clients', function() {
    24      this.route('client', { path: '/:node_id' });
    25    });
    26  
    27    this.route('servers', function() {
    28      this.route('server', { path: '/:agent_id' });
    29    });
    30  
    31    this.route('allocations', function() {
    32      this.route('allocation', { path: '/:allocation_id' }, function() {
    33        this.route('task', { path: '/:name' }, function() {
    34          this.route('logs');
    35        });
    36      });
    37    });
    38  
    39    this.route('settings', function() {
    40      this.route('tokens');
    41    });
    42  
    43    if (config.environment === 'development') {
    44      this.route('freestyle');
    45    }
    46  
    47    this.route('not-found', { path: '/*' });
    48  });
    49  
    50  export default Router;