/* Copyright (C) 2017 Cloudbase Solutions SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ import React from 'react'; import Router from 'react-routing/src/Router'; import fetch from './core/fetch'; import App from './components/App'; import MigrationWizard from './components/MigrationWizard'; import WithSidebar from './components/WithSidebar'; import MigrationList from './components/MigrationList'; import MigrationView from './components/MigrationView'; import MigrationDetail from './components/MigrationDetail'; import MigrationTasks from './components/MigrationTasks'; import MigrationSchedule from './components/MigrationSchedule'; import CloudConnection from './components/CloudConnection'; import CloudConnectionsView from './components/CloudConnectionsView'; import CloudConnectionDetail from './components/CloudConnectionDetail'; import CloudConnectionAuth from './components/CloudConnectionAuth'; import ConnectionsList from './components/ConnectionsList'; import Project from './components/Project'; import ProjectDetail from './components/ProjectDetail'; import ProjectList from './components/ProjectList'; import ReplicaExecutions from './components/ReplicaExecutions'; import UserView from './components/UserView'; import UserOverview from './components/UserOverview'; import ContactPage from './components/ContactPage'; import LoginPage from './components/LoginPage'; import RegisterPage from './components/RegisterPage'; import NotFoundPage from './components/NotFoundPage'; import ErrorPage from './components/ErrorPage'; const router = new Router(on => { on('*', async (state, next) => { const component = await next(); return component && {component}; }); on('/', async () => ) on('/login', async () => ) on('/migrations', async () => ) on('/migrations/new', async () => ) on('/migration/:migrationId/', async (params) => ) on('/migration/tasks/:migrationId/', async (params) => ) on('/migration/schedule/:migrationId/', async (params) => ) // TODO: IMPORTANT Separate views migration/replica on('/replicas', async () => ) on('/replicas/new', async () => ) on('/replica/:migrationId/', async (params) => ) on('/replica/executions/:migrationId/', async (params) => ) on('/replica/schedule/:migrationId/', async (params) => ) on('/cloud-endpoints', async () => ) on('/cloud-endpoints/:connectionId/', async (params) => ) on('/cloud-endpoints/auth/:connectionId/', async (params) => ) on('/projects', async () => ) on('/project/details/:projectId/', async (params) => ) on('/user/profile/', async () => ) on('/user/billing/', async () =>
Nothing here yet
) on('/contact', async () => ); on('/login', async () => ); on('/register', async () => ); on('error', (state, error) => state.statusCode === 404 ? : ); }); export default router;