| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- /*
- 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 <http://www.gnu.org/licenses/>.
- */
- // @flow
- export const coriolisUrl = (window.env && window.env.CORIOLIS_URL) || '/'
- export const servicesUrl = {
- identity: `${coriolisUrl}identity/auth/tokens`,
- projects: `${coriolisUrl}identity/auth/projects`,
- users: `${coriolisUrl}identity/users`,
- endpoints: `${coriolisUrl}coriolis/endpoints`,
- coriolis: `${coriolisUrl}coriolis`,
- migrations: `${coriolisUrl}coriolis/migrations`,
- barbican: `${coriolisUrl}barbican`,
- openId: `${coriolisUrl}identity/OS-FEDERATION/identity_providers/google/protocols/openid/auth`,
- }
- export const userDomain = 'default'
- // Whether to use Barbican secrets when creating a new endpoint
- export const useSecret = true
- // Shows the 'Use Current User/Project/Domain for Authentification' switch
- // when creating a new openstack endpoint
- export const showOpenstackCurrentUserSwitch = false
- export const navigationMenu = [
- { label: 'Replicas', value: 'replicas' },
- { label: 'Migrations', value: 'migrations' },
- { label: 'Cloud Endpoints', value: 'endpoints' },
- // Optional pages
- { label: 'Planning', value: 'planning', disabled: true },
- // User management pages
- { label: 'Projects', value: 'projects', disabled: true, requiresAdmin: true },
- { label: 'Users', value: 'users', disabled: true, requiresAdmin: true },
- ]
- export const requestPollTimeout = 5000
- // https://github.com/cloudbase/coriolis/blob/master/coriolis/constants.py
- // PROVIDER_TYPE_IMPORT = 1 // migration target schema
- // PROVIDER_TYPE_EXPORT = 2 // migration source schema
- // PROVIDER_TYPE_REPLICA_IMPORT = 4 // replica target schema
- // PROVIDER_TYPE_REPLICA_EXPORT = 8 // replica source schema
- export const providerTypes = {
- TARGET_MIGRATION: 1,
- SOURCE_MIGRATION: 2,
- TARGET_REPLICA: 4,
- SOURCE_REPLICA: 8,
- CONNECTION: 16,
- }
- export const loginButtons = [
- // {
- // name: 'Google',
- // id: 'google',
- // url: '',
- // },
- ]
- export const env = {
- name: process.env.NODE_ENV || 'development',
- isDev: process.env.NODE_ENV !== 'production',
- isBrowser: typeof window !== 'undefined',
- }
- export const executionOptions = [
- {
- name: 'shutdown_instances',
- type: 'strict-boolean',
- defaultValue: false,
- },
- ]
- export const storageProviders = ['openstack', 'azure']
- export const sourceOptionsProviders = ['aws']
- export const wizardConfig = {
- pages: [
- { id: 'type', title: 'New', breadcrumb: 'Type' },
- { id: 'source', title: 'Select your source cloud', breadcrumb: 'Source Cloud' },
- {
- id: 'source-options',
- title: 'Source options',
- breadcrumb: 'Source Options',
- sourceFilter: (p: string) => sourceOptionsProviders.find(s => s === p),
- },
- { id: 'vms', title: 'Select instances', breadcrumb: 'Select VMs' },
- { id: 'target', title: 'Select your target cloud', breadcrumb: 'Target Cloud' },
- { id: 'dest-options', title: 'Target options', breadcrumb: 'Target Options' },
- { id: 'networks', title: 'Networks', breadcrumb: 'Networks' },
- {
- id: 'storage',
- title: 'Storage Mapping',
- breadcrumb: 'Storage',
- targetFilter: (p: string) => storageProviders.find(s => s === p),
- },
- { id: 'schedule', title: 'Schedule', breadcrumb: 'Schedule', excludeFrom: 'migration' },
- { id: 'summary', title: 'Summary', breadcrumb: 'Summary' },
- ],
- }
- // - Specifies the `limit` for each provider when listing all its VMs for pagination.
- // - If the provider is not in this list, the 'default' value will be used.
- // - If the `default` value is lower than the number of instances that fit into a page, the latter number will be used.
- // - `Infinity` value means no `limit` will be used, i.e. all VMs will be listed.
- export const instancesListBackgroundLoading = { default: 10, ovm: Infinity }
- // A list of providers for which `destination-options` API call(s) will be made in the Wizard
- // If the item is just a string with the provider name, only one API call will be made
- // If the item has `envRequiredFields`, an additional API call will be made once the specified fields are filled
- export const providersWithExtraOptions = [
- 'openstack',
- 'oracle_vm',
- {
- name: 'azure',
- envRequiredFields: ['location', 'resource_group'],
- },
- {
- name: 'oci',
- envRequiredFields: ['compartment', 'availability_domain'],
- },
- ]
- export const basename = process.env.PUBLIC_PATH
|