constants.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. PROVIDER_TYPE_ENDPOINT_STORAGE = 32768
  44. PROVIDER_TYPE_SOURCE_REPLICA_UPDATE = 65536 // the replica can be updated if provider is source
  45. PROVIDER_TYPE_DESTINATION_REPLICA_UPDATE = 262144 // the replica can be updated if provider is source */
  46. export const providerTypes = {
  47. TARGET_MIGRATION: 1,
  48. SOURCE_MIGRATION: 2,
  49. TARGET_REPLICA: 4,
  50. SOURCE_REPLICA: 8,
  51. CONNECTION: 16,
  52. STORAGE: 32768,
  53. SOURCE_UPDATE: 65536,
  54. TARGET_UPDATE: 262144,
  55. }
  56. export const loginButtons = [
  57. // {
  58. // name: 'Google',
  59. // id: 'google',
  60. // url: '',
  61. // },
  62. ]
  63. export const env = {
  64. name: process.env.NODE_ENV || 'development',
  65. isDev: process.env.NODE_ENV !== 'production',
  66. isBrowser: typeof window !== 'undefined',
  67. }
  68. export const executionOptions = [
  69. {
  70. name: 'shutdown_instances',
  71. type: 'strict-boolean',
  72. defaultValue: false,
  73. },
  74. ]
  75. export const wizardPages = [
  76. { id: 'type', title: 'New', breadcrumb: 'Type' },
  77. { id: 'source', title: 'Select your source cloud', breadcrumb: 'Source Cloud' },
  78. {
  79. id: 'source-options',
  80. title: 'Source options',
  81. breadcrumb: 'Source Options',
  82. },
  83. { id: 'vms', title: 'Select instances', breadcrumb: 'Select VMs' },
  84. { id: 'target', title: 'Select your target cloud', breadcrumb: 'Target Cloud' },
  85. { id: 'dest-options', title: 'Target options', breadcrumb: 'Target Options' },
  86. { id: 'networks', title: 'Networks', breadcrumb: 'Networks' },
  87. {
  88. id: 'storage',
  89. title: 'Storage Mapping',
  90. breadcrumb: 'Storage',
  91. },
  92. { id: 'schedule', title: 'Schedule', breadcrumb: 'Schedule', excludeFrom: 'migration' },
  93. { id: 'summary', title: 'Summary', breadcrumb: 'Summary' },
  94. ]
  95. export const basename = process.env.PUBLIC_PATH