constants.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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: 'Dashboard', value: 'dashboard', hidden: true },
  30. { label: 'Replicas', value: 'replicas' },
  31. { label: 'Migrations', value: 'migrations' },
  32. { label: 'Cloud Endpoints', value: 'endpoints' },
  33. // Optional pages
  34. { label: 'Planning', value: 'planning' },
  35. // User management pages
  36. { label: 'Projects', value: 'projects', requiresAdmin: true },
  37. { label: 'Users', value: 'users', requiresAdmin: true },
  38. ]
  39. // https://github.com/cloudbase/coriolis/blob/master/coriolis/constants.py
  40. export const providerTypes = {
  41. TARGET_MIGRATION: 1,
  42. SOURCE_MIGRATION: 2,
  43. TARGET_REPLICA: 4,
  44. SOURCE_REPLICA: 8,
  45. CONNECTION: 16,
  46. DESTINATION_OPTIONS: 512,
  47. SOURCE_OPTIONS: 131072,
  48. STORAGE: 32768,
  49. SOURCE_UPDATE: 65536,
  50. TARGET_UPDATE: 262144,
  51. }
  52. export const loginButtons = [
  53. // {
  54. // name: 'Google',
  55. // id: 'google',
  56. // url: '',
  57. // },
  58. ]
  59. export const env = {
  60. name: process.env.NODE_ENV || 'development',
  61. isDev: process.env.NODE_ENV !== 'production',
  62. isBrowser: typeof window !== 'undefined',
  63. }
  64. export const executionOptions = [
  65. {
  66. name: 'shutdown_instances',
  67. type: 'boolean',
  68. defaultValue: false,
  69. },
  70. ]
  71. export const wizardPages = [
  72. { id: 'type', title: 'New', breadcrumb: 'Type' },
  73. { id: 'source', title: 'Select your source cloud', breadcrumb: 'Source Cloud' },
  74. {
  75. id: 'source-options',
  76. title: 'Source options',
  77. breadcrumb: 'Source Options',
  78. },
  79. { id: 'vms', title: 'Select instances', breadcrumb: 'Select VMs' },
  80. { id: 'target', title: 'Select your target cloud', breadcrumb: 'Target Cloud' },
  81. { id: 'dest-options', title: 'Target options', breadcrumb: 'Target Options' },
  82. { id: 'networks', title: 'Networks', breadcrumb: 'Networks' },
  83. {
  84. id: 'storage',
  85. title: 'Storage Mapping',
  86. breadcrumb: 'Storage',
  87. },
  88. { id: 'schedule', title: 'Schedule', breadcrumb: 'Schedule', excludeFrom: 'migration' },
  89. { id: 'summary', title: 'Summary', breadcrumb: 'Summary' },
  90. ]
  91. export const basename = process.env.PUBLIC_PATH