import Ember from 'ember'; import config from './config/environment'; const Router = Ember.Router.extend({ location: config.locationType }); Router.map(function() { this.route('login'); this.route('app', function() { this.route('list', {path: '/list/:page'}); this.route('create', {path: '/create'}, function() { this.route('api-group-select', {path: '/api-group-select/:page'}); this.route('app-config-select', {path: '/app-config-select/:page'}); this.route('splash-select', {path: '/splash-select/:page'}); this.route('theme-select', {path: '/theme-select/:page'}); }); this.route('edit', {path: '/:id/edit'}, function() { this.route('api-group-select', {path: '/api-group-select/:page'}); this.route('app-config-select', {path: '/app-config-select/:page'}); this.route('splash-select', {path: '/splash-select/:page'}); this.route('theme-select', {path: '/theme-select/:page'}); }); this.route('version', {path: '/:appId/:platform/version'}, function() { this.route('list', {path: '/list/:page'}); this.route('create'); this.route('edit', {path: '/:id/edit'}, function() { this.route('api-group-select', {path: '/api-group-select/:page'}); this.route('app-config-select', {path: '/app-config-select/:page'}); this.route('splash-select', {path: '/splash-select/:page'}); this.route('theme-select', {path: '/theme-select/:page'}); this.route('version-select', {path: '/version-select/:page'}); }); }); this.route('release', {path: '/:appId/:platform/release'}, function() { this.route('show'); this.route('edit', {path: '/:id/edit'}, function() { this.route('version-select', {path: '/version-select/:page'}); }); }); this.route('appoint', {path: '/:appId/:platform/appoint'}, function() { this.route('list', {path: '/list/:page'}); this.route('create', function() { this.route('version-select', {path: '/version-select/:page'}); }); this.route('edit', {path: '/:id/edit'}, function() { this.route('version-select', {path: '/version-select/:page'}); }); }); this.route('version-group', {path: '/:appId/version-group'}, function() { this.route('list', {path: '/list/:page'}); this.route('create', function() { this.route('version-select', {path: '/version-select/:page'}); }); this.route('edit', {path: '/:id/edit'}, function() { this.route('version-select', {path: '/version-select/:page'}); }); }); }); this.route('api-group', function() { this.route('list', {path: '/list/:page'}); this.route('create'); this.route('edit', {path: '/:id/edit'}); this.route('api', {path: '/:apiGroupId/api'}, function() { this.route('list', {path: '/list/:page'}); this.route('create'); this.route('edit', {path: '/:id/edit'}); this.route('import'); this.route('substitute'); }); }); this.route('splash', function() { this.route('list', {path: '/list/:page'}); this.route('create'); this.route('edit', {path: '/:id/edit'}); }); this.route('theme', function() { this.route('list', {path: '/list/:page'}); this.route('create'); this.route('edit', {path: '/:id/edit'}); }); this.route('app-config', function() { this.route('list', {path: '/list/:page'}); this.route('create'); this.route('edit', {path: '/:id/edit'}); this.route('manage', {path: '/:id/manage'}); this.route('footer-item', {path: '/:appConfigId/footer-item'}, function() { this.route('list', {path: '/list/:page'}); this.route('create'); this.route('edit', {path: '/:id/edit'}); }); }); this.route('role', function() { this.route('list', {path: '/list/:page'}); this.route('create'); this.route('edit', {path: '/:id/edit'}); }); this.route('user', function() { this.route('list', {path: '/list/:page'}); this.route('create', function() { this.route('role-select'); }); this.route('edit', {path: '/:id/edit'}, function() { this.route('role-select'); }); this.route('profile', function() { this.route('upload-avatar'); }); this.route('show', {path: '/:id/show'}); }); this.route('corp', function() { this.route('list', {path: '/list/:page'}); this.route('create', {path: '/create'}, function() { this.route('api-group-select', {path: '/api-group-select/:page'}); this.route('app-config-select', {path: '/app-config-select/:page'}); this.route('splash-select', {path: '/splash-select/:page'}); this.route('theme-select', {path: '/theme-select/:page'}); }); this.route('edit', {path: '/:id/edit'}, function() { this.route('tiny-app-group-select', {path: '/tiny-app-group-select/:page'}); this.route('api-group-select', {path: '/api-group-select/:page'}); this.route('app-config-select', {path: '/app-config-select/:page'}); this.route('splash-select', {path: '/splash-select/:page'}); this.route('theme-select', {path: '/theme-select/:page'}); }); // employee this.route('employee', {path: '/:corpId/employee'}, function() { this.route('list', {path: '/list/:page'}); this.route('create'); this.route('edit', {path: '/:id/edit'}); }); // tiny app group this.route('tiny-app-group', {path: '/:corpId/tiny-app-group'}, function() { this.route('list', {path: '/list/:page'}); this.route('create'); this.route('edit', {path: '/:id/edit'}); }); // tiny app this.route('tiny-app', {path: '/:corpId/tiny-app'}, function() { this.route('list', {path: '/list/:page'}); this.route('create', {path: '/create'}, function() { this.route('tiny-app-group-select', {path: '/tiny-app-group-select/:page'}); }); this.route('edit', {path: '/:id/edit'}, function() { this.route('tiny-app-group-select', {path: '/tiny-app-group-select/:page'}); }); }); this.route('dept', {path: '/:corpId/dept'}, function() { this.route('list', {path: '/list/:page'}); this.route('create'); this.route('edit', {path: '/:id/edit'}); this.route('tree'); }); this.route('contact', {path: '/:corpId/contact'}, function() { this.route('list', {path: '/list/:page'}); this.route('create'); this.route('edit', {path: '/:id/edit'}); }); }); this.route('admin', function() { this.route('list', {path: '/list/:page'}); this.route('create', function() { this.route('role-select'); }); this.route('edit', {path: '/:id/edit'}, function() { this.route('role-select'); }); this.route('profile', function() { this.route('upload-avatar'); }); this.route('show', {path: '/:id/show'}); }); this.route('cloud', function() { this.route('list', {path: '/list/:page'}); this.route('create'); this.route('edit', {path: '/:id/edit'}); this.route('corp', {path: '/:cloudId/corp'}, function() { this.route('list', {path: '/list/:page'}); this.route('manage', {path: '/:corpId/manage'}, function() { this.route('app-select', {path: '/app-select/:page'}); this.route('splash-select', {path: '/splash-select/:page'}); this.route('app-config-select', {path: '/app-config-select/:page'}); this.route('theme-select', {path: '/theme-select/:page'}); this.route('version-select', {path: '/version-select/:page'}); this.route('app-select-for-version-select', {path: '/app-select-for-version-select/:page'}); this.route('app-select-for-version-group-select', {path: '/app-select-for-version-group-select/:page'}); this.route('version-group-select', {path: '/version-group-select/:page'}); }); this.route('member', function() { this.route('list'); }); this.route('biz-manage', {path: '/:corpId/biz-manage'}); this.route('biz-group', {path: '/:corpId/biz-group'}, function() { this.route('create'); this.route('edit', {path: '/:id/edit'}); }); this.route('biz', {path: '/:corpId/biz'}, function() { this.route('create'); this.route('edit', {path: '/:id/edit'}); }); }); this.route('ad-slide', {path: '/:cloudId/ad-slide'}, function() { this.route('list', {path: '/list/:page'}); this.route('create', function() { this.route('app-select', {path: '/app-select/:page'}); this.route('app-select-for-version-select', {path: '/app-select-for-version-select/:page'}); this.route('version-select', {path: '/version-select/:page'}); this.route('corp-select', {path: '/corp-select/:page'}); }); this.route('edit', {path: '/:id/edit'}); this.route('manage'); }); }); this.route('app-alias', function() { this.route('list', {path: '/list/:page'}); }); this.route('app-version-alias', function() { this.route('list', {path: '/list/:page'}); this.route('create'); this.route('edit', {path: '/:id/edit'}); }); this.route('op-detail', {path: '/:model/:id/op-detail'}); }); export default Router;