constants.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*
  2. Copyright (C) 2017 Cloudbase Solutions SRL
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU Affero General Public License as
  5. published by the Free Software Foundation, either version 3 of the
  6. License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Affero General Public License for more details.
  11. You should have received a copy of the GNU Affero General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. // @flow
  15. export const coriolisUrl = (window.env && window.env.CORIOLIS_URL) || '/'
  16. let licenceUrl = (window.env && window.env.CORIOLIS_LICENSING_BASE_URL) || '/licensing'
  17. export const servicesUrl = {
  18. identity: `${coriolisUrl}identity/auth/tokens`,
  19. projects: `${coriolisUrl}identity/auth/projects`,
  20. users: `${coriolisUrl}identity/users`,
  21. endpoints: `${coriolisUrl}coriolis/endpoints`,
  22. coriolis: `${coriolisUrl}coriolis`,
  23. migrations: `${coriolisUrl}coriolis/migrations`,
  24. barbican: `${coriolisUrl}barbican`,
  25. openId: `${coriolisUrl}identity/OS-FEDERATION/identity_providers/google/protocols/openid/auth`,
  26. licence: licenceUrl,
  27. }
  28. export const navigationMenu = [
  29. { label: 'Replicas', value: 'replicas' },
  30. { label: 'Migrations', value: 'migrations' },
  31. { label: 'Cloud Endpoints', value: 'endpoints' },
  32. // Optional pages
  33. { label: 'Planning', value: 'planning' },
  34. // User management pages
  35. { label: 'Projects', value: 'projects', requiresAdmin: true },
  36. { label: 'Users', value: 'users', requiresAdmin: true },
  37. ]
  38. // https://github.com/cloudbase/coriolis/blob/master/coriolis/constants.py
  39. // PROVIDER_TYPE_IMPORT = 1 // migration target schema
  40. // PROVIDER_TYPE_EXPORT = 2 // migration source schema
  41. // PROVIDER_TYPE_REPLICA_IMPORT = 4 // replica target schema
  42. // PROVIDER_TYPE_REPLICA_EXPORT = 8 // replica source schema
  43. export const providerTypes = {
  44. TARGET_MIGRATION: 1,
  45. SOURCE_MIGRATION: 2,
  46. TARGET_REPLICA: 4,
  47. SOURCE_REPLICA: 8,
  48. CONNECTION: 16,
  49. STORAGE: 32768,
  50. }
  51. export const loginButtons = [
  52. // {
  53. // name: 'Google',
  54. // id: 'google',
  55. // url: '',
  56. // },
  57. ]
  58. export const env = {
  59. name: process.env.NODE_ENV || 'development',
  60. isDev: process.env.NODE_ENV !== 'production',
  61. isBrowser: typeof window !== 'undefined',
  62. }
  63. export const executionOptions = [
  64. {
  65. name: 'shutdown_instances',
  66. type: 'strict-boolean',
  67. defaultValue: false,
  68. },
  69. ]
  70. export const wizardPages = [
  71. { id: 'type', title: 'New', breadcrumb: 'Type' },
  72. { id: 'source', title: 'Select your source cloud', breadcrumb: 'Source Cloud' },
  73. {
  74. id: 'source-options',
  75. title: 'Source options',
  76. breadcrumb: 'Source Options',
  77. },
  78. { id: 'vms', title: 'Select instances', breadcrumb: 'Select VMs' },
  79. { id: 'target', title: 'Select your target cloud', breadcrumb: 'Target Cloud' },
  80. { id: 'dest-options', title: 'Target options', breadcrumb: 'Target Options' },
  81. { id: 'networks', title: 'Networks', breadcrumb: 'Networks' },
  82. {
  83. id: 'storage',
  84. title: 'Storage Mapping',
  85. breadcrumb: 'Storage',
  86. },
  87. { id: 'schedule', title: 'Schedule', breadcrumb: 'Schedule', excludeFrom: 'migration' },
  88. { id: 'summary', title: 'Summary', breadcrumb: 'Summary' },
  89. ]
  90. export const basename = process.env.PUBLIC_PATH