From d35a9a17d8daa010d45ba05b2e9a570422ce692f Mon Sep 17 00:00:00 2001 From: abullet33 <106544940+abullet33@users.noreply.github.com> Date: Fri, 13 Dec 2024 14:26:54 +0100 Subject: [PATCH] Feat/pci ai notebooks header notebook (#14128) * feat(ai.notebooks): header tabs and dashboard page * feat(ai.notebooks): dashboard tab part 2 * feat(ai.notebooks): life cycle in dashboard * feat(ai.notebooks): fix sonar issue and comments * feat(ai.notebooks): fix sonar issue * feat(ai.notebooks): fix sonar issue * feat(ai.notebooks): fix sonar issue * feat(ai.notebooks): rework cx * feat(ai.notebooks): rework cx part 2 * feat(ai.notebooks): fix sonnar issue * feat(ai.notebooks): refacto label management * feat(ai.notebooks): fix sonnar issue * feat(ai.notebooks): fix pr comments * feat(ai.notebooks): fix sonar issue * feat(ai.notebooks): fix pr comments * feat(ai.notebooks): fix pr comments * feat(ai.notebooks): fix pr comments ref:DATATR-1636, DATATR-1638 * Feat/pci ai notebooks attached data tab (#14246) * feat(ai.notebooks): attached-data tabs * feat(ai.notebooks): fix build * feat(ai.notebooks): fix sonar issue * feat(ai.notebooks): rework attached data tab post cx ref: DATATR-1639 * feat(ai.notebooks): logs tab (#14313) * feat(ai.notebooks): logs tab REF:DATATR-1641 * feat(ai.notebooks): fix types issue * feat(ai.notebooks): refacto datasync mock * feat(ai.notebooks): backup tabs (#14358) * feat(ai.notebooks): backup tabs * feat(ai.notebooks): fix sonar issue REF:DATATR-1640 * Feat/pci ai notebooks modal tracking (#14553) * feat(ai.notebooks): modal and tracking * feat(ai.notebooks): resolve conflit & fix sonar issue * feat(ai.notebooks): fix pr comments * feat(ai.notebooks): fix pr comments REF:DATATR-1744 Signed-off-by: Arthur Bullet --------- --------- Signed-off-by: Arthur Bullet --- .../apps/pci-ai-notebooks/package.json | 2 +- .../configuration/Messages_fr_FR.json | 15 +- .../notebooks/Messages_fr_FR.json | 5 +- .../notebooks/create/Messages_fr_FR.json | 7 +- .../notebooks/notebook/Messages_fr_FR.json | 7 + .../attached-data/Messages_fr_FR.json | 32 +++ .../notebook/backups/Messages_fr_FR.json | 17 ++ .../notebook/dashboard/Messages_fr_FR.json | 42 ++++ .../notebook/logs/Messages_fr_FR.json | 6 + .../src/__tests__/helpers/mocks/datasync.ts | 45 ++++ .../src/__tests__/helpers/mocks/job.ts | 34 +-- .../src/__tests__/helpers/mocks/label.ts | 6 + .../src/__tests__/helpers/mocks/logs.ts | 23 ++ .../src/__tests__/helpers/mocks/notebook.ts | 34 +-- .../helpers/mocks/notebook/editor.ts | 4 +- .../src/__tests__/helpers/mocks/sshkey.ts | 8 + .../cli-code-block/CliCodeBlock.component.tsx | 16 +- .../LabelsForm.component.tsx | 120 +++++------ .../components/labels/useLabelForm.hook.tsx | 39 ++++ .../configuration/configuration.constants.ts | 2 +- .../src/components/route-modal/RouteModal.tsx | 61 ++++++ .../src/components/ui/button.tsx | 9 +- .../src/components/ui/checkbox.tsx | 28 +++ .../src/components/ui/data-table.tsx | 3 +- .../src/components/ui/skeleton.tsx | 2 +- .../src/components/ui/slider.tsx | 10 +- .../src/configuration/polling.constants.ts | 4 + .../src/configuration/tracking.constants.ts | 11 +- .../api/ai/notebook/backups/backups.api.ts | 34 +++ .../ai/notebook/capabilities/editor.api.ts | 2 +- .../ai/notebook/capabilities/framework.api.ts | 2 +- .../api/ai/notebook/datasync/datasync.api.ts | 19 ++ .../api/ai/notebook/datasync/datasync.spec.ts | 36 ++++ .../data/api/ai/notebook/label/label.api.ts | 16 ++ .../data/api/ai/notebook/label/label.spec.tsx | 36 ++++ .../src/data/api/ai/notebook/logs/logs.api.ts | 11 + .../src/data/api/ai/notebook/notebook.api.ts | 2 +- .../data/api/ai/notebook/suggestions.api.ts | 1 - .../notebook/backups/useForkBackup.hook.tsx | 40 ++++ .../ai/notebook/backups/useGetBackup.hook.tsx | 26 +++ .../notebook/backups/useGetBackups.hook.tsx | 18 ++ .../capabilities/useGetEditor.hook.tsx | 2 +- .../capabilities/useGetFramework.hook.tsx | 2 +- .../ai/notebook/datasync/useDataSync.hook.tsx | 28 +++ .../ai/notebook/datasync/useDataSync.spec.tsx | 43 ++++ .../ai/notebook/label/useEditLabel.hook.tsx | 37 ++++ .../ai/notebook/label/useEditLabel.spec.tsx | 36 ++++ .../api/ai/notebook/logs/useGetLogs.hook.tsx | 18 ++ .../api/ai/notebook/logs/useGetLogs.spec.tsx | 33 +++ .../api/ai/notebook/useAddNotebook.hook.tsx | 6 +- .../ai/notebook/useDeleteNotebook.hook.tsx | 6 +- .../ai/notebook/useDeleteNotebook.spec.tsx | 1 - .../api/ai/notebook/useGetCommand.hook.tsx | 17 +- .../api/ai/notebook/useGetNotebooks.hook.tsx | 2 +- .../api/ai/notebook/useStartNotebook.hook.tsx | 4 +- .../api/ai/notebook/useStopNotebook.hook.tsx | 4 +- .../hooks/api/sshkey/useAddSshKey.hook.tsx | 2 +- .../hooks/api/sshkey/useAddSshKey.spec.tsx | 7 +- .../pci-ai-notebooks/src/hooks/useTracking.ts | 45 +++- .../src/lib/durationHelper.ts | 37 +++- .../{statusHelper.ts => notebookHelper.ts} | 18 ++ .../src/lib/orderFunnelHelper.tsx | 38 ++-- .../src/pages/Root.layout.tsx | 48 ++--- .../pci-ai-notebooks/src/pages/Root.page.tsx | 39 ++++ .../AddSSHKey.modal.tsx} | 45 ++-- .../src/pages/auth/auth.spec.tsx | 68 ------ .../src/pages/notebooks/Notebooks.page.tsx | 17 +- .../[notebookId]/Notebook.context.tsx | 12 +- .../[notebookId]/Notebook.layout.tsx | 7 +- .../_components/DeleteNotebook.component.tsx | 16 +- .../_components/NotebookHeader.component.tsx | 144 +++++++++++++ .../_components/NotebookTabs.component.tsx | 43 ++++ .../_components/StartNotebook.component.tsx | 22 +- .../_components/StopNotebook.component.tsx | 21 +- .../attached-data/AttachedData.page.tsx | 67 ++++++ .../VolumesListColumns.component.tsx | 143 ++++++++++++ .../VolumesListTable.component.tsx | 44 ++++ .../attached-data/dataSync/DataSync.modal.tsx | 203 ++++++++++++++++++ .../[notebookId]/backups/Backups.page.tsx | 38 ++++ .../BackupsListColumns.component.tsx | 85 ++++++++ .../BackupsListTable.component.tsx | 40 ++++ .../[notebookId]/backups/fork/Fork.modal.tsx | 97 +++++++++ .../[notebookId]/dashboard/Dashboard.page.tsx | 160 ++++++++++++++ .../_components/AccessLink.component.tsx | 59 +++++ .../_components/Configuration.component.tsx | 50 +++++ .../_components/Labels.component.tsx | 79 +++++++ .../_components/LifeCycle.component.tsx | 43 ++++ .../_components/Resources.component.tsx | 152 +++++++++++++ .../dashboard/delete/Delete.modal.tsx | 17 ++ .../notebooks/[notebookId]/logs/Logs.page.tsx | 109 ++++++++++ .../NotebooksListColumns.component.tsx | 65 ++++-- .../NotebooksListTable.component.tsx | 83 +------ .../auth/Auth.page.tsx} | 13 +- .../pages/notebooks/create/Create.page.tsx | 4 +- .../_components/CliEquivalent.component.tsx | 1 + .../_components/OrderFunnel.component.tsx | 33 +-- .../_components/OrderSummary.component.tsx | 7 +- .../_components/useOrderFunnel.hook.tsx | 3 +- .../pages/notebooks/delete/Delete.modal.tsx | 17 ++ .../Onboarding.page.tsx} | 0 .../src/pages/notebooks/start/Start.modal.tsx | 17 ++ .../src/pages/notebooks/stop/Stop.modal.tsx | 17 ++ .../pci-ai-notebooks/src/routes/routes.tsx | 118 ++++++++++ .../src/types/cloud/Project.ts | 19 +- .../cloud/billingView/BandwidthInstance.ts | 4 +- .../cloud/billingView/BandwidthStorage.ts | 4 +- .../src/types/cloud/billingView/Component.ts | 6 +- .../types/cloud/billingView/HourlyInstance.ts | 10 +- .../billingView/HourlyInstanceBandwidth.ts | 4 +- .../cloud/billingView/HourlyInstanceDetail.ts | 6 +- .../cloud/billingView/HourlyInstanceOption.ts | 10 +- .../billingView/HourlyInstanceOptionDetail.ts | 6 +- .../cloud/billingView/HourlyResources.ts | 12 +- .../types/cloud/billingView/HourlySnapshot.ts | 4 +- .../types/cloud/billingView/HourlyStorage.ts | 6 +- .../types/cloud/billingView/HourlyVolume.ts | 10 +- .../cloud/billingView/HourlyVolumeDetail.ts | 6 +- .../cloud/billingView/InstanceSnapshot.ts | 4 +- .../cloud/billingView/MonthlyCertification.ts | 6 +- .../billingView/MonthlyCertificationDetail.ts | 4 +- .../cloud/billingView/MonthlyInstance.ts | 8 +- .../billingView/MonthlyInstanceDetail.ts | 6 +- .../billingView/MonthlyInstanceOption.ts | 8 +- .../MonthlyInstanceOptionDetail.ts | 4 +- .../cloud/billingView/MonthlyResources.ts | 4 +- .../src/types/cloud/billingView/Quantity.ts | 4 +- .../cloud/billingView/RegionalizedResource.ts | 4 +- .../types/cloud/billingView/StoredStorage.ts | 4 +- .../types/cloud/billingView/TypedResources.ts | 6 +- .../src/types/cloud/billingView/UsedCredit.ts | 6 +- .../types/cloud/billingView/UsedCredits.ts | 4 +- .../types/cloud/billingView/VolumeSnapshot.ts | 4 +- .../cloud/project/ai/AuthorizationStatus.ts | 2 +- .../src/types/cloud/project/ai/Command.ts | 2 +- .../src/types/cloud/project/ai/DataStore.ts | 6 +- .../src/types/cloud/project/ai/Env.ts | 2 +- .../types/cloud/project/ai/GenericResponse.ts | 2 +- .../src/types/cloud/project/ai/Info.ts | 4 +- .../src/types/cloud/project/ai/Label.ts | 2 +- .../src/types/cloud/project/ai/Logs.ts | 2 +- .../src/types/cloud/project/ai/Resources.ts | 14 +- .../types/cloud/project/ai/ResourcesInput.ts | 20 +- .../src/types/cloud/project/ai/app/App.ts | 18 ++ .../cloud/project/ai/app/AppImageInput.ts | 5 + .../src/types/cloud/project/ai/app/AppSpec.ts | 42 ++++ .../cloud/project/ai/app/AppSpecInput.ts | 42 ++++ .../cloud/project/ai/app/AppStateEnum.ts | 13 ++ .../cloud/project/ai/app/AppStateHistory.ts | 9 + .../types/cloud/project/ai/app/AppStatus.ts | 34 +++ .../project/ai/app/DeploymentStrategy.ts | 9 + .../src/types/cloud/project/ai/app/Probe.ts | 17 ++ .../types/cloud/project/ai/app/ProbeInput.ts | 17 ++ .../ai/app/ScalingAutomaticStrategy.ts | 13 ++ .../ai/app/ScalingAutomaticStrategyInput.ts | 13 ++ ...calingAutomaticStrategyResourceTypeEnum.ts | 5 + .../project/ai/app/ScalingFixedStrategy.ts | 5 + .../ai/app/ScalingFixedStrategyInput.ts | 5 + .../cloud/project/ai/app/ScalingStrategy.ts | 10 + .../project/ai/app/ScalingStrategyInput.ts | 10 + .../types/cloud/project/ai/app/UpdateInput.ts | 24 +++ .../src/types/cloud/project/ai/app/index.ts | 18 ++ .../cloud/project/ai/capabilities/Features.ts | 4 +- .../cloud/project/ai/capabilities/Flavor.ts | 12 +- .../cloud/project/ai/capabilities/Preset.ts | 18 +- .../ai/capabilities/PresetCapabilities.ts | 12 +- .../ai/capabilities/PresetDocumentationUrl.ts | 4 +- .../ai/capabilities/PresetResources.ts | 2 +- .../project/ai/capabilities/ProjectQuotas.ts | 4 +- .../cloud/project/ai/capabilities/Region.ts | 10 +- .../project/ai/capabilities/app/Image.ts | 18 +- .../ai/capabilities/flavor/GpuInformation.ts | 6 +- .../capabilities/flavor/ResourcesPerUnit.ts | 10 +- .../project/ai/capabilities/job/Image.ts | 12 +- .../ai/capabilities/notebook/Editor.ts | 12 +- .../ai/capabilities/notebook/Framework.ts | 12 +- .../src/types/cloud/project/ai/index.ts | 5 + .../src/types/cloud/project/ai/job/Job.ts | 12 +- .../src/types/cloud/project/ai/job/JobSpec.ts | 8 +- .../cloud/project/ai/job/JobSpecInput.ts | 24 +-- .../types/cloud/project/ai/job/JobStatus.ts | 6 +- .../cloud/project/ai/job/JobStatusHistory.ts | 4 +- .../src/types/cloud/project/ai/job/Partner.ts | 6 +- .../types/cloud/project/ai/job/PresetImage.ts | 6 +- .../types/cloud/project/ai/notebook/Backup.ts | 6 +- .../types/cloud/project/ai/notebook/Editor.ts | 12 +- .../cloud/project/ai/notebook/Framework.ts | 12 +- .../cloud/project/ai/notebook/Notebook.ts | 12 +- .../cloud/project/ai/notebook/NotebookEnv.ts | 2 +- .../cloud/project/ai/notebook/NotebookSpec.ts | 10 +- .../project/ai/notebook/NotebookSpecInput.ts | 12 +- .../project/ai/notebook/NotebookStatus.ts | 6 +- .../project/ai/notebook/NotebookUpdate.ts | 12 +- .../project/ai/notebook/NotebookWorkspace.ts | 4 +- .../cloud/project/ai/partner/Contract.ts | 9 + .../project/ai/partner/ContractTermsLocale.ts | 5 + .../types/cloud/project/ai/partner/Partner.ts | 15 ++ .../types/cloud/project/ai/partner/index.ts | 3 + .../cloud/project/ai/registry/Registry.ts | 14 +- .../ai/registry/RegistryUpdateInput.ts | 6 +- .../src/types/cloud/project/ai/token/Token.ts | 10 +- .../types/cloud/project/ai/token/TokenSpec.ts | 2 +- .../cloud/project/ai/token/TokenStatus.ts | 2 +- .../types/cloud/project/ai/volume/DataSync.ts | 10 +- .../cloud/project/ai/volume/DataSyncSpec.ts | 2 +- .../cloud/project/ai/volume/DataSyncStatus.ts | 8 +- .../cloud/project/ai/volume/PrivateSwift.ts | 13 -- .../types/cloud/project/ai/volume/Progress.ts | 28 +-- .../cloud/project/ai/volume/Standalone.ts | 2 +- .../types/cloud/project/ai/volume/Volume.ts | 19 +- .../cloud/project/ai/volume/VolumeSource.ts | 8 +- .../cloud/project/ai/volume/VolumeStatus.ts | 6 +- .../cloud/project/ai/volume/VolumeTarget.ts | 2 +- .../types/cloud/project/ai/volume/index.ts | 1 - .../src/types/cloud/role/Permission.ts | 4 +- .../src/types/cloud/role/Role.ts | 8 +- .../src/types/cloud/role/Roles.ts | 4 +- .../src/types/cloud/role/Service.ts | 4 +- .../src/types/cloud/sshkey/SshKey.ts | 4 +- .../src/types/cloud/sshkey/SshKeyDetail.ts | 10 +- .../storage/ArchiveColdArchiveContainer.ts | 2 +- .../src/types/cloud/storage/Container.ts | 10 +- .../types/cloud/storage/ContainerAccess.ts | 4 +- .../types/cloud/storage/ContainerDetail.ts | 22 +- .../types/cloud/storage/ContainerObject.ts | 12 +- .../cloud/storage/ContainerObjectTempURL.ts | 4 +- .../src/types/cloud/storage/Endpoint.ts | 4 +- .../src/types/cloud/storage/PresignedURL.ts | 6 +- .../src/types/cloud/storage/Quota.ts | 4 +- .../types/cloud/storage/ReplicationRule.ts | 9 + .../storage/ReplicationRuleStatusEnum.ts | 5 + .../src/types/cloud/storage/index.ts | 2 + .../src/types/cloud/usage/Period.ts | 4 +- .../src/types/cloud/usage/UsageBill.ts | 10 +- .../src/types/cloud/usage/UsageCurrent.ts | 4 +- .../types/cloud/usage/UsageCurrentBills.ts | 2 +- .../src/types/cloud/usage/UsageForecast.ts | 4 +- .../src/types/cloud/usage/UsageHistory.ts | 6 +- .../types/cloud/usage/UsageHistoryDetail.ts | 6 +- .../cloud/usage/UsageHistoryDetailBills.ts | 2 +- .../src/types/cloud/user/Configuration.ts | 2 +- .../src/types/cloud/user/Openrc.ts | 2 +- .../src/types/cloud/user/Rclone.ts | 2 +- .../src/types/cloud/user/RoleEnum.ts | 3 + .../src/types/cloud/user/S3Credentials.ts | 6 +- .../cloud/user/S3CredentialsSecretOnly.ts | 2 +- .../cloud/user/S3CredentialsWithSecret.ts | 8 +- .../src/types/cloud/user/User.ts | 12 +- .../src/types/cloud/user/UserDetail.ts | 14 +- .../apps/pci-ai-notebooks/tailwind.config.ts | 96 +++++++++ yarn.lock | 80 +++++++ 250 files changed, 3902 insertions(+), 956 deletions(-) create mode 100644 packages/manager/apps/pci-ai-notebooks/public/translations/pci-ai-notebooks/notebooks/notebook/attached-data/Messages_fr_FR.json create mode 100644 packages/manager/apps/pci-ai-notebooks/public/translations/pci-ai-notebooks/notebooks/notebook/backups/Messages_fr_FR.json create mode 100644 packages/manager/apps/pci-ai-notebooks/public/translations/pci-ai-notebooks/notebooks/notebook/dashboard/Messages_fr_FR.json create mode 100644 packages/manager/apps/pci-ai-notebooks/public/translations/pci-ai-notebooks/notebooks/notebook/logs/Messages_fr_FR.json create mode 100644 packages/manager/apps/pci-ai-notebooks/src/__tests__/helpers/mocks/datasync.ts create mode 100644 packages/manager/apps/pci-ai-notebooks/src/__tests__/helpers/mocks/label.ts create mode 100644 packages/manager/apps/pci-ai-notebooks/src/__tests__/helpers/mocks/logs.ts rename packages/manager/apps/pci-ai-notebooks/src/components/{order/configuration => labels}/LabelsForm.component.tsx (52%) create mode 100644 packages/manager/apps/pci-ai-notebooks/src/components/labels/useLabelForm.hook.tsx create mode 100644 packages/manager/apps/pci-ai-notebooks/src/components/route-modal/RouteModal.tsx create mode 100644 packages/manager/apps/pci-ai-notebooks/src/components/ui/checkbox.tsx create mode 100644 packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/backups/backups.api.ts create mode 100644 packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/datasync/datasync.api.ts create mode 100644 packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/datasync/datasync.spec.ts create mode 100644 packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/label/label.api.ts create mode 100644 packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/label/label.spec.tsx create mode 100644 packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/logs/logs.api.ts create mode 100644 packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/backups/useForkBackup.hook.tsx create mode 100644 packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/backups/useGetBackup.hook.tsx create mode 100644 packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/backups/useGetBackups.hook.tsx create mode 100644 packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/datasync/useDataSync.hook.tsx create mode 100644 packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/datasync/useDataSync.spec.tsx create mode 100644 packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/label/useEditLabel.hook.tsx create mode 100644 packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/label/useEditLabel.spec.tsx create mode 100644 packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/logs/useGetLogs.hook.tsx create mode 100644 packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/logs/useGetLogs.spec.tsx rename packages/manager/apps/pci-ai-notebooks/src/lib/{statusHelper.ts => notebookHelper.ts} (52%) rename packages/manager/apps/pci-ai-notebooks/src/pages/_components/{AddSSHKey.component.tsx => sshkey/AddSSHKey.modal.tsx} (88%) delete mode 100644 packages/manager/apps/pci-ai-notebooks/src/pages/auth/auth.spec.tsx create mode 100644 packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/_components/NotebookHeader.component.tsx create mode 100644 packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/_components/NotebookTabs.component.tsx create mode 100644 packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/attached-data/AttachedData.page.tsx create mode 100644 packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/attached-data/_components/VolumesListColumns.component.tsx create mode 100644 packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/attached-data/_components/VolumesListTable.component.tsx create mode 100644 packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/attached-data/dataSync/DataSync.modal.tsx create mode 100644 packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/backups/Backups.page.tsx create mode 100644 packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/backups/_components/BackupsListColumns.component.tsx create mode 100644 packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/backups/_components/BackupsListTable.component.tsx create mode 100644 packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/backups/fork/Fork.modal.tsx create mode 100644 packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/dashboard/Dashboard.page.tsx create mode 100644 packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/dashboard/_components/AccessLink.component.tsx create mode 100644 packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/dashboard/_components/Configuration.component.tsx create mode 100644 packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/dashboard/_components/Labels.component.tsx create mode 100644 packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/dashboard/_components/LifeCycle.component.tsx create mode 100644 packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/dashboard/_components/Resources.component.tsx create mode 100644 packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/dashboard/delete/Delete.modal.tsx create mode 100644 packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/logs/Logs.page.tsx rename packages/manager/apps/pci-ai-notebooks/src/pages/{auth/auth.page.tsx => notebooks/auth/Auth.page.tsx} (93%) create mode 100644 packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/delete/Delete.modal.tsx rename packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/{_components/Onboarding.component.tsx => onboarding/Onboarding.page.tsx} (100%) create mode 100644 packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/start/Start.modal.tsx create mode 100644 packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/stop/Stop.modal.tsx create mode 100644 packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/App.ts create mode 100644 packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/AppImageInput.ts create mode 100644 packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/AppSpec.ts create mode 100644 packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/AppSpecInput.ts create mode 100644 packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/AppStateEnum.ts create mode 100644 packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/AppStateHistory.ts create mode 100644 packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/AppStatus.ts create mode 100644 packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/DeploymentStrategy.ts create mode 100644 packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/Probe.ts create mode 100644 packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/ProbeInput.ts create mode 100644 packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/ScalingAutomaticStrategy.ts create mode 100644 packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/ScalingAutomaticStrategyInput.ts create mode 100644 packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/ScalingAutomaticStrategyResourceTypeEnum.ts create mode 100644 packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/ScalingFixedStrategy.ts create mode 100644 packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/ScalingFixedStrategyInput.ts create mode 100644 packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/ScalingStrategy.ts create mode 100644 packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/ScalingStrategyInput.ts create mode 100644 packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/UpdateInput.ts create mode 100644 packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/index.ts create mode 100644 packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/partner/Contract.ts create mode 100644 packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/partner/ContractTermsLocale.ts create mode 100644 packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/partner/Partner.ts create mode 100644 packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/partner/index.ts delete mode 100644 packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/PrivateSwift.ts create mode 100644 packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/ReplicationRule.ts create mode 100644 packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/ReplicationRuleStatusEnum.ts diff --git a/packages/manager/apps/pci-ai-notebooks/package.json b/packages/manager/apps/pci-ai-notebooks/package.json index 172706c50c41..390cee532a50 100644 --- a/packages/manager/apps/pci-ai-notebooks/package.json +++ b/packages/manager/apps/pci-ai-notebooks/package.json @@ -33,6 +33,7 @@ "@ovhcloud/ods-theme-blue-jeans": "^17.1.0", "@radix-ui/react-accordion": "^1.1.2", "@radix-ui/react-alert-dialog": "^1.0.5", + "@radix-ui/react-checkbox": "^1.1.2", "@radix-ui/react-collapsible": "^1.0.3", "@radix-ui/react-dialog": "^1.0.5", "@radix-ui/react-dropdown-menu": "^2.0.6", @@ -69,7 +70,6 @@ "react-dom": "^18.2.0", "react-hook-form": "^7.50.1", "react-i18next": "^14.0.5", - "react-router": "^6.21.3", "react-router-dom": "^6.3.0", "sonner": "^1.4.0", "tailwind-merge": "^2.2.1", diff --git a/packages/manager/apps/pci-ai-notebooks/public/translations/pci-ai-notebooks/components/configuration/Messages_fr_FR.json b/packages/manager/apps/pci-ai-notebooks/public/translations/pci-ai-notebooks/components/configuration/Messages_fr_FR.json index ea70d8bc588f..9df57ae4ddc7 100644 --- a/packages/manager/apps/pci-ai-notebooks/public/translations/pci-ai-notebooks/components/configuration/Messages_fr_FR.json +++ b/packages/manager/apps/pci-ai-notebooks/public/translations/pci-ai-notebooks/components/configuration/Messages_fr_FR.json @@ -18,5 +18,18 @@ "addSshKeySuccessDescription": "Nouvelle clé SSH créée", "addSshKeyTitle": "Configurer un nouvelle clé SSH", "formSshKeyButtonCancel": "Annuler", - "formSshKeyButtonConfirm": "Confirmer" + "formSshKeyButtonConfirm": "Confirmer", + "cliToastCopied": "Le code a été copié", + "numberOfSeconds_zero": "{{count}} secondes", + "numberOfSeconds_one": "{{count}} seconde", + "numberOfSeconds_other": "{{count}} secondes", + "numberOfMinutes_zero": "{{count}} minutes", + "numberOfMinutes_one": "{{count}} minute", + "numberOfMinutes_other": "{{count}} minutes", + "numberOfHours_zero": "{{count}} heures", + "numberOfHours_one": "{{count}} heure", + "numberOfHours_other": "{{count}} heures", + "numberOfDays_zero": "{{count}} jours", + "numberOfDays_one": "{{count}} jour", + "numberOfDays_other": "{{count}} jours" } diff --git a/packages/manager/apps/pci-ai-notebooks/public/translations/pci-ai-notebooks/notebooks/Messages_fr_FR.json b/packages/manager/apps/pci-ai-notebooks/public/translations/pci-ai-notebooks/notebooks/Messages_fr_FR.json index 0c243601e95a..807db18e1d29 100644 --- a/packages/manager/apps/pci-ai-notebooks/public/translations/pci-ai-notebooks/notebooks/Messages_fr_FR.json +++ b/packages/manager/apps/pci-ai-notebooks/public/translations/pci-ai-notebooks/notebooks/Messages_fr_FR.json @@ -3,12 +3,13 @@ "createNewNotebook": "Créer un notebook", "tableHeaderName": "Name", "tableHeaderLocation": "Région", - "tableHeaderEnvironment": "Environnement", + "tableHeaderFramework": "Framework", + "tableHeaderEditor": "Editeur", "tableHeaderResources": "Ressources", "tableHeaderPrivacy": "Confidentialité ", "networkSecureTitle": "Privé", "networkPublicTitle": "Public", - "tableHeaderDuration": "Durée de fonctionnement", + "tableHeaderDuration": "Durée", "tableHeaderStatus": "Statut", "tableActionManage": "Gérer", "tableActionStart": "Démarrer", diff --git a/packages/manager/apps/pci-ai-notebooks/public/translations/pci-ai-notebooks/notebooks/create/Messages_fr_FR.json b/packages/manager/apps/pci-ai-notebooks/public/translations/pci-ai-notebooks/notebooks/create/Messages_fr_FR.json index 61c1938c535c..c3d4e908e1af 100644 --- a/packages/manager/apps/pci-ai-notebooks/public/translations/pci-ai-notebooks/notebooks/create/Messages_fr_FR.json +++ b/packages/manager/apps/pci-ai-notebooks/public/translations/pci-ai-notebooks/notebooks/create/Messages_fr_FR.json @@ -53,6 +53,9 @@ "cliCode": "Equivalent CLI", "errorGetCommandCli": "Une erreur est survenue lors de la génération de code équivalent pour la CLI", "cliEquivalentModalTitle": "Création d’un notebook équivalent", - "cliEquivalentModalDescription": "Créer le même notebook via la CLI", - "cliEquivalentModalToastMessage": "Le code a été copié" + "cliEquivalentModalDescription": "Commande CLI", + "cliEquivalentModalToastMessage": "Le code a été copié", + "errorCreatingNotebook": "Erreur", + "successCreatingNotebookTitle": "Succès", + "successCreatingNotebookDescription": "Votre notebook a été créé avec succès" } diff --git a/packages/manager/apps/pci-ai-notebooks/public/translations/pci-ai-notebooks/notebooks/notebook/Messages_fr_FR.json b/packages/manager/apps/pci-ai-notebooks/public/translations/pci-ai-notebooks/notebooks/notebook/Messages_fr_FR.json index afeff6751635..07513632c31e 100644 --- a/packages/manager/apps/pci-ai-notebooks/public/translations/pci-ai-notebooks/notebooks/notebook/Messages_fr_FR.json +++ b/packages/manager/apps/pci-ai-notebooks/public/translations/pci-ai-notebooks/notebooks/notebook/Messages_fr_FR.json @@ -1,4 +1,11 @@ { + "dashboardTab": "Dashboard", + "dataTab": "Données attachées", + "backupTab": "Backups", + "logsTab": "Logs", + "publicAccessLabel": "Public", + "privateAccessLabel": "Privé", + "openEditor": "Ouvrir {{editor}}", "deleteNotebookTitle": "Supprimer le notebook", "deleteNotebookDescription": "Etes-vous sur de vouloir supprimer le notebook {{name}} ?", "notebookButtonCancel": "Annuler", diff --git a/packages/manager/apps/pci-ai-notebooks/public/translations/pci-ai-notebooks/notebooks/notebook/attached-data/Messages_fr_FR.json b/packages/manager/apps/pci-ai-notebooks/public/translations/pci-ai-notebooks/notebooks/notebook/attached-data/Messages_fr_FR.json new file mode 100644 index 000000000000..1f3367b9199e --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/public/translations/pci-ai-notebooks/notebooks/notebook/attached-data/Messages_fr_FR.json @@ -0,0 +1,32 @@ +{ + "breadcrumb": "Conteneurs de données", + "attachedDataTitle": "Conteneurs de données", + "attachedDataDescription": "Si nécessaire, vous pouvez attacher des conteneurs Object Storage OVHcloud à votre notebook. Une fois attachés, ceux-ci seront temporairement chargés et mis en cache près de votre instance afin de réduire la latence et d’améliorer les performances. La bonne pratique est d’attacher un conteneur avec vos données entrantes et un autre avec vos données sortantes.", + "attachedDataInfoLink": "En savoir plus sur le stockage de données.", + "synchroniseDataButton": "Synchronisation globale des données", + "tableHeaderAlias": "Alias", + "tableHeaderContainer": "Conteneur de données", + "tableHeaderMountPath": "Répertoire de montage", + "tableHeaderPermission": "Permission", + "tableHeaderCaching": "Cache", + "mountPathCopyToast": "Le répertoire de montage a été copié", + "tableActionSyncData": "Synchroniser manuellement les données", + "tableWithCache": "Actif", + "tableWithoutCache": "Inactif", + "synchDataButtonHelper": "La synchronisation des données est possible seulement lorsque le notebook est en statut \"Echec de synchronisation\" (seulement pour le type push) ou \"En service\"", + "permission_RO": "Lecture Seule", + "permission_RW": "Lecture & Ecriture", + "permission_RWD": "Lecture & Ecriture & Suppression", + "synchDataDropdownMenuLabel": "Actions", + "dataSyncTitle": "Synchronisation manuelle des données", + "formDataSyncFieldTypeLabel": "Type de synchronisation", + "formDataSyncFieldTypeHelper": "Vous pouvez choisir entre une synchronisation de type push, vers votre conteneur de données ou de type pull, dans l'autre sens.", + "dataSyncGlobalAlertDescription": "La synchronisation sere effecutée sur l'ensemble de vos répertoires de montage", + "dataSyncMountPathAlertDescription": "La synchronisation sera effectuée seulement sur le répertoire de montage {{name}}", + "datasyncButtonCancel": "Annuler", + "datasyncButtonConfirm": "Synchroniser", + "dataSyncToastErrorTitle": "Erreur", + "dataSyncToastSuccessTitle": "Succès", + "dataSyncMountPathToastSuccessDescription": "La synchronisation des données sur le répertoire de montage {{name}} a été correctement lancée", + "dataSyncGlobalToastSuccessDescription": "La synchronisation des données sur tous les répertoire de montage a été correctement lancée" +} diff --git a/packages/manager/apps/pci-ai-notebooks/public/translations/pci-ai-notebooks/notebooks/notebook/backups/Messages_fr_FR.json b/packages/manager/apps/pci-ai-notebooks/public/translations/pci-ai-notebooks/notebooks/notebook/backups/Messages_fr_FR.json new file mode 100644 index 000000000000..f9d12fdead49 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/public/translations/pci-ai-notebooks/notebooks/notebook/backups/Messages_fr_FR.json @@ -0,0 +1,17 @@ +{ + "breadcrumb": "Backups", + "title": "Sauvegardes", + "description": "Vous trouverez ci-dessous la liste de vos sauvegardes. Vous pouvez créer un nouveau notebook à partir du chacune d'entre elles", + "tableHeaderId": "Id", + "tableHeaderCreationDate": "Date de création", + "tableHeaderUpdateDate": "Date de modification", + "backupDropdownMenuLabel": "Action", + "tableActionFork": "Fork", + "forkBackupTitle": "Commander un notebook depuis un backup", + "forkBackupDescription": "Utiliser le backup {{id}} créé le {{date}} pour commander un nouveau notebook?", + "forkButtonCancel": "Annuler", + "forkBackupButtonConfirm": "Commander", + "forkToastErrorTitle": "Une erreur est survenue", + "forkToastSuccessTitle": "Succés", + "forkToastSuccessDescription": "votre notebook a été créé avec succès" +} diff --git a/packages/manager/apps/pci-ai-notebooks/public/translations/pci-ai-notebooks/notebooks/notebook/dashboard/Messages_fr_FR.json b/packages/manager/apps/pci-ai-notebooks/public/translations/pci-ai-notebooks/notebooks/notebook/dashboard/Messages_fr_FR.json new file mode 100644 index 000000000000..e455f64ce9a9 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/public/translations/pci-ai-notebooks/notebooks/notebook/dashboard/Messages_fr_FR.json @@ -0,0 +1,42 @@ +{ + "dashboardTitle": "Dashboard", + "accessLinkTitle": "Accès", + "labelsTitle": "Labels", + "resourcesTitle": "Ressources", + "lifeCycleTitle": "Cycle de vie", + "billingSupportTitle": "Support & Facturation", + "configurationTitle": "Configuration", + "cliTitle": "CLI", + "cliCodeTitle": "Vous pouvez créer le même notebook en utilisant ces lignes de commande dans votre ovhai CLI.", + "powerTitleSection": "Power", + "computeTitleSection": "Compute", + "storageTitleSection": "Stockage", + "gpuMemoryField": "{{ gpu }} x {{ memory }} RAM", + "gcuComputeField": "CPU: {{ cpu }} vCores ", + "memoryField": "RAM: {{ memory }}", + "publicNetworkField": "Réseau public: {{ network }}/s", + "temporaryLocalStorageField": "Stockage local éphémère: {{ storage }} SSD", + "temporaryLocalStorageHelper": "Stockage local performant, mais non sauvegardé", + "workspaceStorage": "Espace de travail {{ storage }} SSD inclus", + "workspaceStorageHelper": "Stockage distant sauvegardé. Au-delà de 30 jours consécutifs de stockage ou/et du dépassement de ce quota de 10 Gio, les tarifs appliqués seront ceux de Public Cloud Object Storage.", + "sliderInfo": "{{ usedStorage }} / {{ totalStorage }}", + "durationTitle": "Durée de fonctionnement", + "timeLineTitle": "Timeline", + "notebookIdLabel": "Id du notebook", + "notebookIdCopyToast": "L'identifiant du notebook a été copié", + "billingLink": "Gérer la facturation", + "supportLink": "Contacter le support", + "deleteNotebookButton": "Supprimer", + "liveCodeEditorTitle": "Live code editor", + "openEditor": "Ouvrir {{editor}}", + "grafanaTitle": "Suivi de la consommation", + "grafanaButton": "Dashboard grafana", + "addLabelTitle": "Ajouter un label", + "keyFieldLabel": "Clé", + "valueFieldLabel": "Valeur", + "addLabelButtonCancel": "Annuler", + "addLabelNameSubmit": "Ajouter", + "notebookToastErrorTitle": "Erreur", + "notebookToastSuccessTitle": "Succés", + "deleteNotebookSuccess": "Le label a été correctement ajouté à votre notebook" +} diff --git a/packages/manager/apps/pci-ai-notebooks/public/translations/pci-ai-notebooks/notebooks/notebook/logs/Messages_fr_FR.json b/packages/manager/apps/pci-ai-notebooks/public/translations/pci-ai-notebooks/notebooks/notebook/logs/Messages_fr_FR.json new file mode 100644 index 000000000000..b9126a64f1b2 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/public/translations/pci-ai-notebooks/notebooks/notebook/logs/Messages_fr_FR.json @@ -0,0 +1,6 @@ +{ + "breadcrumb": "Logs", + "title": "Logs", + "description": "Pour vous aider à suivre et à piloter votre notebook, vous trouverez les derniers événements (logs) ci-dessous, quasiment en direct.", + "autoRefreshInputLabel": "Auto-Refresh" +} diff --git a/packages/manager/apps/pci-ai-notebooks/src/__tests__/helpers/mocks/datasync.ts b/packages/manager/apps/pci-ai-notebooks/src/__tests__/helpers/mocks/datasync.ts new file mode 100644 index 000000000000..edb4f2b944f5 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/__tests__/helpers/mocks/datasync.ts @@ -0,0 +1,45 @@ +import * as ai from '@/types/cloud/project/ai'; + +export const mockedDataSyncSpec: ai.volume.DataSyncSpec = { + direction: ai.volume.DataSyncEnum.pull, + manual: true, + volume: '1934e1d3-2ba0-4000-8fd3-6f11081e4401', +}; + +export const mockedDataSync: ai.volume.DataSync = { + createdAt: 'createdAt', + id: 'idDuDataSync', + spec: { + direction: ai.volume.DataSyncEnum.pull, + manual: true, + volume: '1934e1d3-2ba0-4000-8fd3-6f11081e4401', + }, + status: { + endedAt: 'endedAT', + info: { + code: ai.InfoCodeEnum.APP_ERROR, + message: 'error_message', + }, + progress: [ + { + completed: 1, + createdAt: 'createdAt', + deleted: 1, + direction: ai.volume.DataSyncEnum.pull, + failed: 3, + id: 'id', + info: 'info', + processed: 1, + skipped: 1, + state: ai.volume.DataSyncProgressStateEnum.DONE, + total: 1, + transferredBytes: 1, + updatedAt: 'updatedAt', + }, + ], + queuedAt: 'queudAt', + startedAt: 'startedAt', + state: ai.volume.DataSyncStateEnum.DONE, + }, + updatedAt: 'updatedAt', +}; diff --git a/packages/manager/apps/pci-ai-notebooks/src/__tests__/helpers/mocks/job.ts b/packages/manager/apps/pci-ai-notebooks/src/__tests__/helpers/mocks/job.ts index eb786859b1b1..40535f4e5334 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/__tests__/helpers/mocks/job.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/__tests__/helpers/mocks/job.ts @@ -1,4 +1,5 @@ import * as ai from '@/types/cloud/project/ai'; +import { mockedDataSync } from './datasync'; export const mockedJobSpec: ai.job.JobSpec = { image: 'image', @@ -15,38 +16,7 @@ export const mockedJobSpec: ai.job.JobSpec = { }, }; export const mockedJobStatus: ai.job.JobStatus = { - dataSync: [ - { - createdAt: 'createdAt', - id: 'datasyncId', - status: { - info: { - code: ai.InfoCodeEnum.APP_RUNNING, - message: 'message', - }, - progress: [ - { - completed: 1, - createdAt: 'createdAt', - deleted: 0, - direction: ai.volume.DataSyncEnum.push, - failed: 0, - id: 'progressId', - info: 'info', - processed: 3, - skipped: 1, - state: ai.volume.DataSyncProgressStateEnum.DONE, - total: 2, - transferredBytes: 30, - updatedAt: 'updatedAt', - }, - ], - queuedAt: 'queuedAt', - state: ai.volume.DataSyncStateEnum.DONE, - }, - updatedAt: 'updatedAt', - }, - ], + dataSync: [mockedDataSync], history: [ { date: 'date', diff --git a/packages/manager/apps/pci-ai-notebooks/src/__tests__/helpers/mocks/label.ts b/packages/manager/apps/pci-ai-notebooks/src/__tests__/helpers/mocks/label.ts new file mode 100644 index 000000000000..4aad2e74b23b --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/__tests__/helpers/mocks/label.ts @@ -0,0 +1,6 @@ +import * as ai from '@/types/cloud/project/ai'; + +export const mockedLabel: ai.Label = { + name: 'labelName', + value: 'labelValue', +}; diff --git a/packages/manager/apps/pci-ai-notebooks/src/__tests__/helpers/mocks/logs.ts b/packages/manager/apps/pci-ai-notebooks/src/__tests__/helpers/mocks/logs.ts new file mode 100644 index 000000000000..14f2e0708a10 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/__tests__/helpers/mocks/logs.ts @@ -0,0 +1,23 @@ +import * as ai from '@/types/cloud/project/ai'; + +export const mockedLogs: ai.Logs = { + lastActivity: 'now', + logs: [ + { + content: 'my first line log', + timestamp: '2024-11-27T15:15:35.684Z', + }, + { + content: 'my second line log', + timestamp: '2024-11-27T15:15:36.684Z', + }, + { + content: 'my third line log', + timestamp: '2024-11-27T15:15:37.684Z', + }, + { + content: 'another line log', + timestamp: '2024-11-27T15:15:38.684Z', + }, + ], +}; diff --git a/packages/manager/apps/pci-ai-notebooks/src/__tests__/helpers/mocks/notebook.ts b/packages/manager/apps/pci-ai-notebooks/src/__tests__/helpers/mocks/notebook.ts index d3c1c78f9f02..dc3d936b3f1f 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/__tests__/helpers/mocks/notebook.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/__tests__/helpers/mocks/notebook.ts @@ -1,5 +1,6 @@ import * as ai from '@/types/cloud/project/ai'; import { mockedJobStatus } from './job'; +import { mockedDataSync } from './datasync'; export const mockedNotebookSpec: ai.notebook.NotebookSpec = { env: { @@ -27,38 +28,7 @@ export const mockedNotebookSpec: ai.notebook.NotebookSpec = { }; export const mockedNotebookStatus: ai.notebook.NotebookStatus = { - dataSync: [ - { - createdAt: 'createdAt', - id: 'datasyncId', - status: { - info: { - code: ai.InfoCodeEnum.APP_RUNNING, - message: 'message', - }, - progress: [ - { - completed: 1, - createdAt: 'createdAt', - deleted: 0, - direction: ai.volume.DataSyncEnum.push, - failed: 0, - id: 'progressId', - info: 'info', - processed: 3, - skipped: 1, - state: ai.volume.DataSyncProgressStateEnum.DONE, - total: 2, - transferredBytes: 30, - updatedAt: 'updatedAt', - }, - ], - queuedAt: 'queuedAt', - state: ai.volume.DataSyncStateEnum.DONE, - }, - updatedAt: 'updatedAt', - }, - ], + dataSync: [mockedDataSync], info: { code: ai.InfoCodeEnum.JOB_DONE, diff --git a/packages/manager/apps/pci-ai-notebooks/src/__tests__/helpers/mocks/notebook/editor.ts b/packages/manager/apps/pci-ai-notebooks/src/__tests__/helpers/mocks/notebook/editor.ts index e839836720ed..576d76b76bd3 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/__tests__/helpers/mocks/notebook/editor.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/__tests__/helpers/mocks/notebook/editor.ts @@ -1,10 +1,10 @@ import * as ai from '@/types/cloud/project/ai'; -export const mockedEditor: ai.notebook.Editor = { +export const mockedEditor: ai.capabilities.notebook.Editor = { description: 'description', docUrl: 'docURl', id: 'editorId', logoUrl: 'logo', name: 'EditorName', - version: 'version', + versions: ['version'], }; diff --git a/packages/manager/apps/pci-ai-notebooks/src/__tests__/helpers/mocks/sshkey.ts b/packages/manager/apps/pci-ai-notebooks/src/__tests__/helpers/mocks/sshkey.ts index bf64920e5d25..30d656e9833e 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/__tests__/helpers/mocks/sshkey.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/__tests__/helpers/mocks/sshkey.ts @@ -6,3 +6,11 @@ export const mockedSshKey: sshkey.SshKey = { publicKey: 'publicKey', regions: ['GRA'], }; + +export const mockedSshKeyDetail: sshkey.SshKeyDetail = { + fingerPrint: 'fingerPrint', + id: 'id', + name: 'name', + publicKey: 'publicKey', + regions: ['GRA', 'BHS'], +}; diff --git a/packages/manager/apps/pci-ai-notebooks/src/components/cli-code-block/CliCodeBlock.component.tsx b/packages/manager/apps/pci-ai-notebooks/src/components/cli-code-block/CliCodeBlock.component.tsx index a38aceed6c35..d3da13e62a06 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/components/cli-code-block/CliCodeBlock.component.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/components/cli-code-block/CliCodeBlock.component.tsx @@ -8,21 +8,27 @@ interface CliCodeBlockProps { title: string; code: string; toastMessage?: string; + size?: string; } -const CliCodeBlock = ({ title, code, toastMessage }: CliCodeBlockProps) => { - const { t } = useTranslation('common'); +const CliCodeBlock = ({ + title, + code, + toastMessage, + size, +}: CliCodeBlockProps) => { + const { t } = useTranslation('pci-ai-notebooks/components/configuration'); const toast = useToast(); const handleCopyPass = (valueToCopy: string) => { navigator.clipboard.writeText(valueToCopy); toast.toast({ - title: toastMessage || t('copied'), + title: toastMessage || t('cliToastCopied'), }); }; return (
-
+

{title}

- +
 void;
+  configuredLabels: ai.Label[];
+  onAdd?: (newLabel: ai.Label) => void;
+  onDelete?: (deleteLabel: ai.Label) => void;
+  onChange?: (newLabels: ai.Label[]) => void;
   disabled?: boolean;
 }
 
 const LabelsForm = React.forwardRef(
-  ({ labelValue, onChange, disabled }, ref) => {
+  ({ configuredLabels, onAdd, onDelete, onChange, disabled }, ref) => {
     const { t } = useTranslation('pci-ai-notebooks/components/configuration');
-    const labelSchema = z.object({
-      name: z
-        .string()
-        .min(1)
-        .max(15)
-        .refine(
-          (newKey) =>
-            !labelValue.some(
-              (existingLabel) =>
-                existingLabel.name.toLowerCase() === newKey.toLowerCase(),
-            ),
-          {
-            message: t('existingKeyError'),
-          },
-        ),
-      value: z
-        .string()
-        .min(1)
-        .max(15),
-    });
 
-    const form = useForm({
-      resolver: zodResolver(labelSchema),
+    const { form } = useLabelForm({
+      configuredLabel: configuredLabels.map((label) => label.name),
     });
 
     const onSubmit: SubmitHandler = (data: ai.Label) => {
-      const newLabels = [...labelValue, data];
-      onChange(newLabels);
+      if (onAdd) {
+        onAdd(data);
+      }
+      if (onChange) {
+        const newLabels = [...configuredLabels, data];
+        onChange(newLabels);
+      }
       form.reset();
     };
 
-    const removeLabel = (indexToRemove: number) => {
-      const newLabels = labelValue.filter(
-        (_, index) => index !== indexToRemove,
-      );
-      onChange(newLabels);
+    const removeLabel = (key: string) => {
+      if (onChange) {
+        const newLabels = configuredLabels.filter(
+          (label: ai.Label) => label.name !== key,
+        );
+        onChange(newLabels);
+      }
+      if (onDelete) {
+        const labelToRemove = configuredLabels.find(
+          (label: ai.Label) => label.name === key,
+        );
+        onDelete(labelToRemove);
+      }
     };
 
     return (
@@ -105,45 +100,38 @@ const LabelsForm = React.forwardRef(
             onClick={form.handleSubmit(onSubmit)}
             disabled={
               disabled ||
-              labelValue.length >= CONFIGURATION_CONFIG.maxLabelNumber
+              configuredLabels.length >= CONFIGURATION_CONFIG.maxLabelNumber
             }
             className="mt-[1.875rem] text-primary rounded-full p-2 ml-2 hover:text-primary"
           >
             
           
         
-
    - {labelValue.map((label, index) => ( -
  • -
    - {label.name} - {label.value && ( - <> - - - - {label.value} - - - )} +
    + {configuredLabels.map((label) => ( + +
    + + {`${label.name} = ${label.value}`} + +
    - -
  • + ))} -
-

+

+

{t('numberOfConfiguredLabels', { - count: labelValue.length, + count: configuredLabels.length, max: CONFIGURATION_CONFIG.maxLabelNumber, - context: `${labelValue.length}`, })}

diff --git a/packages/manager/apps/pci-ai-notebooks/src/components/labels/useLabelForm.hook.tsx b/packages/manager/apps/pci-ai-notebooks/src/components/labels/useLabelForm.hook.tsx new file mode 100644 index 000000000000..f8e3f0790d92 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/components/labels/useLabelForm.hook.tsx @@ -0,0 +1,39 @@ +import { zodResolver } from '@hookform/resolvers/zod'; +import { useTranslation } from 'react-i18next'; +import { useForm } from 'react-hook-form'; +import { z } from 'zod'; + +export interface UseLabelFormProps { + configuredLabel: string[]; +} +export const useLabelForm = ({ configuredLabel }: UseLabelFormProps) => { + const { t } = useTranslation('pci-ai-notebooks/components/configuration'); + const labelSchema = z.object({ + name: z + .string() + .trim() + .min(1) + .max(15) + .refine( + (newKey) => + !configuredLabel?.some( + (existingLabel) => + existingLabel.toLowerCase() === newKey.toLowerCase(), + ), + { + message: t('existingKeyError'), + }, + ), + value: z + .string() + .trim() + .min(1) + .max(15), + }); + + const form = useForm({ + resolver: zodResolver(labelSchema), + }); + + return { form, labelSchema }; +}; diff --git a/packages/manager/apps/pci-ai-notebooks/src/components/order/configuration/configuration.constants.ts b/packages/manager/apps/pci-ai-notebooks/src/components/order/configuration/configuration.constants.ts index 780110b7928c..60a4a9d75e19 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/components/order/configuration/configuration.constants.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/components/order/configuration/configuration.constants.ts @@ -1,4 +1,4 @@ export const CONFIGURATION_CONFIG = { - maxLabelNumber: 10, + maxLabelNumber: 8, maxSshKeyNumber: 10, }; diff --git a/packages/manager/apps/pci-ai-notebooks/src/components/route-modal/RouteModal.tsx b/packages/manager/apps/pci-ai-notebooks/src/components/route-modal/RouteModal.tsx new file mode 100644 index 000000000000..15f4449b264f --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/components/route-modal/RouteModal.tsx @@ -0,0 +1,61 @@ +import { useNavigate } from 'react-router-dom'; +import { + Dialog, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, +} from '../ui/dialog'; +import { Skeleton } from '../ui/skeleton'; + +interface RouteModalProps { + backUrl?: string; + isLoading?: boolean; + children: React.ReactNode | React.ReactNode[]; + onClose?: () => void; +} +const RouteModal = ({ + backUrl, + isLoading = false, + children, + onClose, +}: RouteModalProps) => { + const navigate = useNavigate(); + const onOpenChange = (open: boolean) => { + if (!open) { + if (onClose) { + onClose(); + return; + } + if (backUrl) navigate(backUrl); + } + }; + + return ( + + {isLoading ? ( + + + + + + + + + + + + + + + + + + ) : ( + children + )} + + ); +}; + +export default RouteModal; diff --git a/packages/manager/apps/pci-ai-notebooks/src/components/ui/button.tsx b/packages/manager/apps/pci-ai-notebooks/src/components/ui/button.tsx index 57f4a373a512..d7fde546dc6a 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/components/ui/button.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/components/ui/button.tsx @@ -9,7 +9,7 @@ const buttonVariants = cva( { variants: { variant: { - default: "bg-primary text-primary-foreground hover:bg-primary-600", + default: "bg-primary text-primary-foreground hover:bg-primary-600 hover:text-primary-foreground", destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90", outline: @@ -25,13 +25,16 @@ const buttonVariants = cva( }, size: { default: "h-10 px-4 py-2 text-base", - sm: "h-9 rounded-md px-3 text-sm", + sm: "h-8 rounded-md px-3 text-sm", lg: "h-11 rounded-md px-8", icon: "h-10 w-10", link: "text-base", table: "h-4 w-4 my-auto", menu: 'size-8 p-0', - input: "h-10 w-full rounded-md px-3 py-2 text-sm" + input: "h-10 w-full rounded-md px-3 py-2 text-sm", + roundedIcon: "h-6 w-6 rounded-full", + roundedsmIcon: "h-4 w-4 rounded-full", + badge: "h-6 rounded-md px-2.5 py-0.5 text-xs" }, }, defaultVariants: { diff --git a/packages/manager/apps/pci-ai-notebooks/src/components/ui/checkbox.tsx b/packages/manager/apps/pci-ai-notebooks/src/components/ui/checkbox.tsx new file mode 100644 index 000000000000..0a6a9a5b9670 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/components/ui/checkbox.tsx @@ -0,0 +1,28 @@ +import * as React from "react" +import * as CheckboxPrimitive from "@radix-ui/react-checkbox" +import { Check } from "lucide-react" + +import { cn } from "@/lib/utils" + +const Checkbox = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + + + + + +)) +Checkbox.displayName = CheckboxPrimitive.Root.displayName + +export { Checkbox } diff --git a/packages/manager/apps/pci-ai-notebooks/src/components/ui/data-table.tsx b/packages/manager/apps/pci-ai-notebooks/src/components/ui/data-table.tsx index a71a1c699516..b3577ed56e1c 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/components/ui/data-table.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/components/ui/data-table.tsx @@ -250,7 +250,8 @@ DataTable.Skeleton = function DataTableSkeleton({ {Array.from({ length: columns }).map((col, iCol) => ( ))} diff --git a/packages/manager/apps/pci-ai-notebooks/src/components/ui/skeleton.tsx b/packages/manager/apps/pci-ai-notebooks/src/components/ui/skeleton.tsx index 01b8b6d4f716..7fec2f335e3e 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/components/ui/skeleton.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/components/ui/skeleton.tsx @@ -5,7 +5,7 @@ function Skeleton({ ...props }: React.HTMLAttributes) { return ( -
diff --git a/packages/manager/apps/pci-ai-notebooks/src/components/ui/slider.tsx b/packages/manager/apps/pci-ai-notebooks/src/components/ui/slider.tsx index aa8840ee9700..94483c5aece1 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/components/ui/slider.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/components/ui/slider.tsx @@ -5,8 +5,8 @@ import { cn } from "@/lib/utils" const Slider = React.forwardRef< React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( + React.ComponentPropsWithoutRef & { hideThumb?: boolean } +>(({ className, hideThumb, ...props }, ref) => ( - - + {(!hideThumb) && ( + + )} + )) Slider.displayName = SliderPrimitive.Root.displayName diff --git a/packages/manager/apps/pci-ai-notebooks/src/configuration/polling.constants.ts b/packages/manager/apps/pci-ai-notebooks/src/configuration/polling.constants.ts index 17067264d00d..4930ea38f61d 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/configuration/polling.constants.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/configuration/polling.constants.ts @@ -1,8 +1,12 @@ export const POLLING = { NOTEBOOKS: 30_000, NOTEBOOK: 30_000, + LOGS: 30_000, + BACKUPS: 30_000, }; export const USER_INACTIVITY_TIMEOUT = 5 * 60_000; // inactivity after 5 minutes export const TERMINATE_CONFIRMATION = 'TERMINATE'; + +export const TIMELINE_MAX = -7; diff --git a/packages/manager/apps/pci-ai-notebooks/src/configuration/tracking.constants.ts b/packages/manager/apps/pci-ai-notebooks/src/configuration/tracking.constants.ts index e422f6a30b60..06784b3275c8 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/configuration/tracking.constants.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/configuration/tracking.constants.ts @@ -1,11 +1,2 @@ -const APP_TRACKING_PREFIX = 'PublicCloud::databases_analytics::databases'; +export const APP_TRACKING_PREFIX = 'PublicCloud::ai::notebooks'; export const PCI_LEVEL2 = '86'; -export const TRACKING = { - onboarding: { - page: () => `${APP_TRACKING_PREFIX}::databases::onboarding`, - createDatabaseClick: () => - `${APP_TRACKING_PREFIX}::page::button::create_databases`, - guideClick: (guideName: string) => - `${APP_TRACKING_PREFIX}::page::tile-tutorial::go-to-${guideName}`, - }, -}; diff --git a/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/backups/backups.api.ts b/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/backups/backups.api.ts new file mode 100644 index 000000000000..4a8be2f412c8 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/backups/backups.api.ts @@ -0,0 +1,34 @@ +import { apiClient } from '@ovh-ux/manager-core-api'; +import * as ai from '@/types/cloud/project/ai'; +import { NotebookData } from '@/data/api'; + +export const getBackups = async ({ projectId, notebookId }: NotebookData) => + apiClient.v6 + .get(`/cloud/project/${projectId}/ai/notebook/${notebookId}/backup`) + .then((res) => res.data as ai.notebook.Backup[]); + +export interface BackupData extends NotebookData { + backupId: string; +} + +export const getBackup = async ({ + projectId, + notebookId, + backupId, +}: BackupData) => + apiClient.v6 + .get( + `/cloud/project/${projectId}/ai/notebook/${notebookId}/backup/${backupId}`, + ) + .then((res) => res.data as ai.notebook.Backup); + +export const forkBackup = async ({ + projectId, + notebookId, + backupId, +}: BackupData) => + apiClient.v6 + .post( + `/cloud/project/${projectId}/ai/notebook/${notebookId}/backup/${backupId}/fork`, + ) + .then((res) => res.data as ai.notebook.Notebook); diff --git a/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/capabilities/editor.api.ts b/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/capabilities/editor.api.ts index eaf67bb9f26b..4a8df5e9d24d 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/capabilities/editor.api.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/capabilities/editor.api.ts @@ -10,4 +10,4 @@ export const getEditor = async ({ projectId }: PCIAi) => 'X-Pagination-Size': '50000', }, }) - .then((res) => res.data as ai.notebook.Editor[]); + .then((res) => res.data as ai.capabilities.notebook.Editor[]); diff --git a/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/capabilities/framework.api.ts b/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/capabilities/framework.api.ts index 618ee7513919..21e6aa3a8958 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/capabilities/framework.api.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/capabilities/framework.api.ts @@ -10,4 +10,4 @@ export const getFramework = async ({ projectId }: PCIAi) => 'X-Pagination-Size': '50000', }, }) - .then((res) => res.data as ai.notebook.Framework[]); + .then((res) => res.data as ai.capabilities.notebook.Framework[]); diff --git a/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/datasync/datasync.api.ts b/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/datasync/datasync.api.ts new file mode 100644 index 000000000000..452641e1d580 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/datasync/datasync.api.ts @@ -0,0 +1,19 @@ +import { apiClient } from '@ovh-ux/manager-core-api'; +import { NotebookData } from '@/data/api'; +import * as ai from '@/types/cloud/project/ai'; + +export interface DataSyncProps extends NotebookData { + dataSyncSpec: ai.volume.DataSyncSpec; +} + +export const dataSync = async ({ + projectId, + notebookId, + dataSyncSpec, +}: DataSyncProps) => + apiClient.v6 + .post( + `/cloud/project/${projectId}/ai/notebook/${notebookId}/datasync`, + dataSyncSpec, + ) + .then((res) => res.data as ai.volume.DataSync); diff --git a/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/datasync/datasync.spec.ts b/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/datasync/datasync.spec.ts new file mode 100644 index 000000000000..7f7778b96065 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/datasync/datasync.spec.ts @@ -0,0 +1,36 @@ +import { apiClient } from '@ovh-ux/manager-core-api'; +import { describe, expect, vi } from 'vitest'; +import { dataSync } from './datasync.api'; +import { mockedDataSyncSpec } from '@/__tests__/helpers/mocks/datasync'; + +vi.mock('@ovh-ux/manager-core-api', () => { + const post = vi.fn(() => { + return Promise.resolve({ data: null }); + }); + return { + apiClient: { + v6: { + post, + }, + }, + }; +}); + +describe('label functions', () => { + afterEach(() => { + vi.clearAllMocks(); + }); + + it('should call dataSync with dataSyncInput', async () => { + expect(apiClient.v6.post).not.toHaveBeenCalled(); + await dataSync({ + projectId: 'projectId', + notebookId: 'notebookId', + dataSyncSpec: mockedDataSyncSpec, + }); + expect(apiClient.v6.post).toHaveBeenCalledWith( + '/cloud/project/projectId/ai/notebook/notebookId/datasync', + mockedDataSyncSpec, + ); + }); +}); diff --git a/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/label/label.api.ts b/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/label/label.api.ts new file mode 100644 index 000000000000..cd10779e8a16 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/label/label.api.ts @@ -0,0 +1,16 @@ +import { apiClient } from '@ovh-ux/manager-core-api'; +import { NotebookData } from '@/data/api'; +import * as ai from '@/types/cloud/project/ai'; + +export interface EditLabelProps extends NotebookData { + label: ai.Label; +} + +export const editLabel = async ({ + projectId, + notebookId, + label, +}: EditLabelProps) => + apiClient.v6 + .put(`/cloud/project/${projectId}/ai/notebook/${notebookId}/label`, label) + .then((res) => res.data); diff --git a/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/label/label.spec.tsx b/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/label/label.spec.tsx new file mode 100644 index 000000000000..92ebaf77445b --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/label/label.spec.tsx @@ -0,0 +1,36 @@ +import { apiClient } from '@ovh-ux/manager-core-api'; +import { describe, expect, vi } from 'vitest'; +import { editLabel } from './label.api'; +import { mockedLabel } from '@/__tests__/helpers/mocks/label'; + +vi.mock('@ovh-ux/manager-core-api', () => { + const put = vi.fn(() => { + return Promise.resolve({ data: null }); + }); + return { + apiClient: { + v6: { + put, + }, + }, + }; +}); + +describe('label functions', () => { + afterEach(() => { + vi.clearAllMocks(); + }); + + it('should call editLabel with labelInput', async () => { + expect(apiClient.v6.put).not.toHaveBeenCalled(); + await editLabel({ + projectId: 'projectId', + notebookId: 'notebookId', + label: mockedLabel, + }); + expect(apiClient.v6.put).toHaveBeenCalledWith( + '/cloud/project/projectId/ai/notebook/notebookId/label', + mockedLabel, + ); + }); +}); diff --git a/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/logs/logs.api.ts b/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/logs/logs.api.ts new file mode 100644 index 000000000000..e213529bf794 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/logs/logs.api.ts @@ -0,0 +1,11 @@ +import { apiClient } from '@ovh-ux/manager-core-api'; +import * as ai from '@/types/cloud/project/ai'; +import { NotebookData } from '@/data/api'; +import { mockedLogs } from '@/__tests__/helpers/mocks/logs'; + +export const getLogs = async ({ projectId, notebookId }: NotebookData) => { + // apiClient.v6 + // .get(`/cloud/project/${projectId}/ai/notebook/${notebookId}/log`) + // .then((res) => res.data as ai.Logs); + return mockedLogs; +}; diff --git a/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/notebook.api.ts b/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/notebook.api.ts index 937faaa55121..4ad646be69a6 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/notebook.api.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/notebook.api.ts @@ -20,7 +20,7 @@ export const getNotebook = async ({ projectId, notebookId }: NotebookData) => .then((res) => res.data as ai.notebook.Notebook); export interface AddNotebook extends PCIAi { - notebookInfo: ai.notebook.NotebookSpec; + notebookInfo: ai.notebook.NotebookSpecInput; } export const addNotebook = async ({ projectId, notebookInfo }: AddNotebook) => apiClient.v6 diff --git a/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/suggestions.api.ts b/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/suggestions.api.ts index 949b3c01d64b..45cb4539b74d 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/suggestions.api.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/data/api/ai/notebook/suggestions.api.ts @@ -1,5 +1,4 @@ import { apiClient } from '@ovh-ux/manager-core-api'; - import { PCIAi } from '../..'; import { Suggestions } from '@/types/orderFunnel'; import { mockedSuggestion } from '@/__tests__/helpers/mocks/suggestion'; diff --git a/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/backups/useForkBackup.hook.tsx b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/backups/useForkBackup.hook.tsx new file mode 100644 index 000000000000..f3c60ac0d527 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/backups/useForkBackup.hook.tsx @@ -0,0 +1,40 @@ +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { useParams } from 'react-router-dom'; +import { AIError } from '@/data/api'; +import * as ai from '@/types/cloud/project/ai'; +import { + BackupData, + forkBackup, +} from '@/data/api/ai/notebook/backups/backups.api'; + +interface UseForkBackup { + onError: (cause: AIError) => void; + onSuccess: (notebook: ai.notebook.Notebook) => void; +} + +export function useForkBackup({ onError, onSuccess }: UseForkBackup) { + const queryClient = useQueryClient(); + const { projectId } = useParams(); + const mutation = useMutation({ + mutationFn: (forkInfo: BackupData) => { + return forkBackup(forkInfo); + }, + onError, + onSuccess: (data) => { + // invalidate notebooks list to avoid displaying + // old list + queryClient.invalidateQueries({ + queryKey: [projectId, 'ai/notebook'], + refetchType: 'none', + }); + onSuccess(data); + }, + }); + + return { + forkBackup: (forkInfo: BackupData) => { + return mutation.mutate(forkInfo); + }, + ...mutation, + }; +} diff --git a/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/backups/useGetBackup.hook.tsx b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/backups/useGetBackup.hook.tsx new file mode 100644 index 000000000000..c589803e8e8f --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/backups/useGetBackup.hook.tsx @@ -0,0 +1,26 @@ +import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; +import * as ai from '@/types/cloud/project/ai'; +import { useQueryImmediateRefetch } from '@/hooks/api/useImmediateRefetch'; +import { AIError } from '@/data/api'; +import { getBackup } from '@/data/api/ai/notebook/backups/backups.api'; + +export function useGetBackup( + projectId: string, + notebookId: string, + backupId: string, + options: Omit = {}, +) { + const queryKey = [ + projectId, + 'ai', + 'notebook', + notebookId, + 'backup', + backupId, + ]; + return useQueryImmediateRefetch({ + queryKey, + queryFn: () => getBackup({ projectId, notebookId, backupId }), + ...options, + }) as UseQueryResult; +} diff --git a/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/backups/useGetBackups.hook.tsx b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/backups/useGetBackups.hook.tsx new file mode 100644 index 000000000000..fcf6d07c9d16 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/backups/useGetBackups.hook.tsx @@ -0,0 +1,18 @@ +import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; +import * as ai from '@/types/cloud/project/ai'; +import { useQueryImmediateRefetch } from '@/hooks/api/useImmediateRefetch'; +import { AIError } from '@/data/api'; +import { getBackups } from '@/data/api/ai/notebook/backups/backups.api'; + +export function useGetBackups( + projectId: string, + notebookId: string, + options: Omit = {}, +) { + const queryKey = [projectId, 'ai', 'notebook', notebookId, 'backup']; + return useQueryImmediateRefetch({ + queryKey, + queryFn: () => getBackups({ projectId, notebookId }), + ...options, + }) as UseQueryResult; +} diff --git a/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/capabilities/useGetEditor.hook.tsx b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/capabilities/useGetEditor.hook.tsx index d2bf5ca43343..2fb2f5c901eb 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/capabilities/useGetEditor.hook.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/capabilities/useGetEditor.hook.tsx @@ -13,5 +13,5 @@ export function useGetEditor( queryKey, queryFn: () => getEditor({ projectId }), ...options, - }) as UseQueryResult; + }) as UseQueryResult; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/capabilities/useGetFramework.hook.tsx b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/capabilities/useGetFramework.hook.tsx index 9dc505e22f1a..d141074e63af 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/capabilities/useGetFramework.hook.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/capabilities/useGetFramework.hook.tsx @@ -13,5 +13,5 @@ export function useGetFramework( queryKey, queryFn: () => getFramework({ projectId }), ...options, - }) as UseQueryResult; + }) as UseQueryResult; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/datasync/useDataSync.hook.tsx b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/datasync/useDataSync.hook.tsx new file mode 100644 index 000000000000..0d4e79bd2fe6 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/datasync/useDataSync.hook.tsx @@ -0,0 +1,28 @@ +import { useMutation } from '@tanstack/react-query'; +import { AIError } from '@/data/api'; +import { + DataSyncProps, + dataSync, +} from '@/data/api/ai/notebook/datasync/datasync.api'; + +export interface MutateLabelProps { + onError: (cause: AIError) => void; + onSuccess: () => void; +} + +export function useDataSync({ onError, onSuccess }: MutateLabelProps) { + const mutation = useMutation({ + mutationFn: (dataSyncInfo: DataSyncProps) => { + return dataSync(dataSyncInfo); + }, + onError, + onSuccess, + }); + + return { + dataSync: (dataSyncInfo: DataSyncProps) => { + return mutation.mutate(dataSyncInfo); + }, + ...mutation, + }; +} diff --git a/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/datasync/useDataSync.spec.tsx b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/datasync/useDataSync.spec.tsx new file mode 100644 index 000000000000..ec6c80ab1c1d --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/datasync/useDataSync.spec.tsx @@ -0,0 +1,43 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import * as dataSyncApi from '@/data/api/ai/notebook/datasync/datasync.api'; +import { useDataSync } from './useDataSync.hook'; +import { + mockedDataSync, + mockedDataSyncSpec, +} from '@/__tests__/helpers/mocks/datasync'; + +vi.mock('@/data/api/ai/notebook/datasync/datasync.api', () => ({ + dataSync: vi.fn(), +})); + +describe('useDataSync', () => { + it('should call useDataSync on mutation with data', async () => { + const projectId = 'projectId'; + const notebookId = 'notebookId'; + const onSuccess = vi.fn(); + const onError = vi.fn(); + + vi.mocked(dataSyncApi.dataSync).mockResolvedValue(mockedDataSync); + const { result } = renderHook(() => useDataSync({ onError, onSuccess }), { + wrapper: QueryClientWrapper, + }); + + const dataSyncProps = { + projectId, + notebookId, + dataSyncSpec: mockedDataSyncSpec, + }; + result.current.dataSync(dataSyncProps); + + await waitFor(() => { + expect(dataSyncApi.dataSync).toHaveBeenCalledWith(dataSyncProps); + expect(onSuccess).toHaveBeenCalledWith( + mockedDataSync, + dataSyncProps, + undefined, + ); + }); + }); +}); diff --git a/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/label/useEditLabel.hook.tsx b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/label/useEditLabel.hook.tsx new file mode 100644 index 000000000000..1c4e1be9197a --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/label/useEditLabel.hook.tsx @@ -0,0 +1,37 @@ +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { AIError } from '@/data/api'; +import { + EditLabelProps, + editLabel, +} from '@/data/api/ai/notebook/label/label.api'; + +export interface MutateLabelProps { + onError: (cause: AIError) => void; + onSuccess: () => void; +} + +export function useEditLabel({ + onError, + onSuccess: customOnSuccess, +}: MutateLabelProps) { + const queryClient = useQueryClient(); + const mutation = useMutation({ + mutationFn: (labelInfo: EditLabelProps) => { + return editLabel(labelInfo); + }, + onError, + onSuccess: (_data, variables) => { + queryClient.invalidateQueries({ + queryKey: [variables.projectId, 'notebook', variables.notebookId], + }); + customOnSuccess(); + }, + }); + + return { + editLabel: (labelInfo: EditLabelProps) => { + return mutation.mutate(labelInfo); + }, + ...mutation, + }; +} diff --git a/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/label/useEditLabel.spec.tsx b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/label/useEditLabel.spec.tsx new file mode 100644 index 000000000000..f70933b4b2cf --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/label/useEditLabel.spec.tsx @@ -0,0 +1,36 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import * as labelApi from '@/data/api/ai/notebook/label/label.api'; +import { useEditLabel } from './useEditLabel.hook'; +import { mockedLabel } from '@/__tests__/helpers/mocks/label'; + +vi.mock('@/data/api/ai/notebook/label/label.api', () => ({ + editLabel: vi.fn(), +})); + +describe('useEditLabel', () => { + it('should call useEditLabel on mutation with data', async () => { + const projectId = 'projectId'; + const notebookId = 'notebookId'; + const onSuccess = vi.fn(); + const onError = vi.fn(); + + vi.mocked(labelApi.editLabel).mockResolvedValue(mockedLabel); + const { result } = renderHook(() => useEditLabel({ onError, onSuccess }), { + wrapper: QueryClientWrapper, + }); + + const editLabelProps = { + projectId, + notebookId, + label: mockedLabel, + }; + result.current.editLabel(editLabelProps); + + await waitFor(() => { + expect(labelApi.editLabel).toHaveBeenCalledWith(editLabelProps); + expect(onSuccess).toHaveBeenCalled(); + }); + }); +}); diff --git a/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/logs/useGetLogs.hook.tsx b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/logs/useGetLogs.hook.tsx new file mode 100644 index 000000000000..ac2810a4b770 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/logs/useGetLogs.hook.tsx @@ -0,0 +1,18 @@ +import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; +import * as ai from '@/types/cloud/project/ai'; +import { useQueryImmediateRefetch } from '@/hooks/api/useImmediateRefetch'; +import { AIError } from '@/data/api'; +import { getLogs } from '@/data/api/ai/notebook/logs/logs.api'; + +export function useGetLogs( + projectId: string, + notebookId: string, + options: Omit = {}, +) { + const queryKey = [projectId, 'ai/notebook', notebookId, 'log']; + return useQueryImmediateRefetch({ + queryKey, + queryFn: () => getLogs({ projectId, notebookId }), + ...options, + }) as UseQueryResult; +} diff --git a/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/logs/useGetLogs.spec.tsx b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/logs/useGetLogs.spec.tsx new file mode 100644 index 000000000000..006920093218 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/logs/useGetLogs.spec.tsx @@ -0,0 +1,33 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import * as notebookApi from '@/data/api/ai/notebook/logs/logs.api'; +import { mockedNotebook } from '@/__tests__/helpers/mocks/notebook'; +import { mockedLogs } from '@/__tests__/helpers/mocks/logs'; +import { useGetLogs } from './useGetLogs.hook'; + +vi.mock('@/data/api/ai/notebook/logs/logs.api', () => ({ + getLogs: vi.fn(), +})); + +describe('useGetNotebook', () => { + it('should return Logs', async () => { + const projectId = 'projectId'; + const notebookId = 'notebookId'; + + vi.mocked(notebookApi.getLogs).mockResolvedValue(mockedLogs); + + const { result } = renderHook(() => useGetLogs(projectId, notebookId), { + wrapper: QueryClientWrapper, + }); + + await waitFor(() => { + expect(result.current.isSuccess).toBe(true); + expect(result.current.data).toEqual(mockedLogs); + expect(notebookApi.getLogs).toHaveBeenCalledWith({ + projectId, + notebookId, + }); + }); + }); +}); diff --git a/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/useAddNotebook.hook.tsx b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/useAddNotebook.hook.tsx index c80866a6aed7..d2a4348e2259 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/useAddNotebook.hook.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/useAddNotebook.hook.tsx @@ -14,12 +14,12 @@ export function useAddNotebook({ onError, onSuccess }: AddNotebookProps) { const queryClient = useQueryClient(); const { projectId } = useParams(); const mutation = useMutation({ - mutationFn: (notebookInfo: ai.notebook.NotebookSpec) => { + mutationFn: (notebookInfo: ai.notebook.NotebookSpecInput) => { return addNotebook({ projectId, notebookInfo }); }, onError, onSuccess: (data) => { - // invalidate services list to avoid displaying + // invalidate notebook list to avoid displaying // old list queryClient.invalidateQueries({ queryKey: [projectId, 'ai/notebook'], @@ -30,7 +30,7 @@ export function useAddNotebook({ onError, onSuccess }: AddNotebookProps) { }); return { - addNotebook: (notebookInfo: ai.notebook.NotebookSpec) => { + addNotebook: (notebookInfo: ai.notebook.NotebookSpecInput) => { return mutation.mutate(notebookInfo); }, ...mutation, diff --git a/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/useDeleteNotebook.hook.tsx b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/useDeleteNotebook.hook.tsx index 1418c206c50f..0cc4a714f5e5 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/useDeleteNotebook.hook.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/useDeleteNotebook.hook.tsx @@ -20,11 +20,11 @@ export function useDeleteNotebook({ }, onError, onSuccess: () => { - onDeleteSuccess(); - // Invalidate service list query to get the latest data + // Invalidate notebooks list query to get the latest data queryClient.invalidateQueries({ - queryKey: [projectId, 'ai/notebook'], + queryKey: [projectId, 'ai/notebook', { exact: true }], }); + onDeleteSuccess(); }, }); diff --git a/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/useDeleteNotebook.spec.tsx b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/useDeleteNotebook.spec.tsx index 5e72394b154b..e320a255e559 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/useDeleteNotebook.spec.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/useDeleteNotebook.spec.tsx @@ -34,7 +34,6 @@ describe('useDeleteNotebooks', () => { expect(notebookApi.deleteNotebook).toHaveBeenCalledWith( deleteNotebookProps, ); - expect(onDeleteSuccess).toHaveBeenCalledWith(); }); }); }); diff --git a/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/useGetCommand.hook.tsx b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/useGetCommand.hook.tsx index 0b5dfa8bb614..4b420f00422c 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/useGetCommand.hook.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/useGetCommand.hook.tsx @@ -1,4 +1,4 @@ -import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { useMutation } from '@tanstack/react-query'; import { useParams } from 'react-router-dom'; import * as ai from '@/types/cloud/project/ai'; @@ -11,26 +11,17 @@ interface GetCommandProps { } export function useGetCommand({ onError, onSuccess }: GetCommandProps) { - const queryClient = useQueryClient(); const { projectId } = useParams(); const mutation = useMutation({ - mutationFn: (notebookInfo: ai.notebook.NotebookSpec) => { + mutationFn: (notebookInfo: ai.notebook.NotebookSpecInput) => { return getCommand({ projectId, notebookInfo }); }, onError, - onSuccess: (data) => { - // invalidate services list to avoid displaying - // old list - queryClient.invalidateQueries({ - queryKey: [projectId, 'ai/notebook'], - refetchType: 'none', - }); - onSuccess(data); - }, + onSuccess, }); return { - getCommand: (notebookInfo: ai.notebook.NotebookSpec) => { + getCommand: (notebookInfo: ai.notebook.NotebookSpecInput) => { return mutation.mutate(notebookInfo); }, ...mutation, diff --git a/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/useGetNotebooks.hook.tsx b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/useGetNotebooks.hook.tsx index f5ffed2cf769..18f495617aa6 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/useGetNotebooks.hook.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/useGetNotebooks.hook.tsx @@ -8,7 +8,7 @@ export function useGetNotebooks( projectId: string, options: Omit = {}, ) { - const queryKey = [projectId, 'ai', 'notebook']; + const queryKey = [projectId, 'ai/notebook']; return useQueryImmediateRefetch({ queryKey, queryFn: () => getNotebooks({ projectId }), diff --git a/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/useStartNotebook.hook.tsx b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/useStartNotebook.hook.tsx index 1155f03ff555..91405ccf75f6 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/useStartNotebook.hook.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/useStartNotebook.hook.tsx @@ -20,11 +20,11 @@ export function useStartNotebook({ }, onError, onSuccess: () => { - onStartSuccess(); - // Invalidate service list query to get the latest data + // Invalidate notebooks list query to get the latest data queryClient.invalidateQueries({ queryKey: [projectId, 'ai/notebook'], }); + onStartSuccess(); }, }); diff --git a/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/useStopNotebook.hook.tsx b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/useStopNotebook.hook.tsx index f88429cf370e..af753c2d4cee 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/useStopNotebook.hook.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/ai/notebook/useStopNotebook.hook.tsx @@ -17,11 +17,11 @@ export function useStopNotebook({ onError, onStopSuccess }: UseStopNotebook) { }, onError, onSuccess: () => { - onStopSuccess(); - // Invalidate service list query to get the latest data + // Invalidate notebooks list query to get the latest data queryClient.invalidateQueries({ queryKey: [projectId, 'ai/notebook'], }); + onStopSuccess(); }, }); diff --git a/packages/manager/apps/pci-ai-notebooks/src/hooks/api/sshkey/useAddSshKey.hook.tsx b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/sshkey/useAddSshKey.hook.tsx index 05163d25da4a..800a3beb9e5e 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/hooks/api/sshkey/useAddSshKey.hook.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/sshkey/useAddSshKey.hook.tsx @@ -14,7 +14,7 @@ export function useAddSshKey({ onError, onAddKeySuccess }: UseAddSshKey) { const mutation = useMutation({ mutationFn: (sshKey: AddSSHKey) => addSSHKey(sshKey), onError, - onSuccess: (data: sshkey.SshKey) => { + onSuccess: (data: sshkey.SshKeyDetail) => { onAddKeySuccess(data); // Invalidate service list query to get the latest data queryClient.invalidateQueries({ diff --git a/packages/manager/apps/pci-ai-notebooks/src/hooks/api/sshkey/useAddSshKey.spec.tsx b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/sshkey/useAddSshKey.spec.tsx index f0db6f8763b5..b64afd535381 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/hooks/api/sshkey/useAddSshKey.spec.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/hooks/api/sshkey/useAddSshKey.spec.tsx @@ -2,7 +2,10 @@ import { renderHook, waitFor } from '@testing-library/react'; import { vi } from 'vitest'; import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; import * as sshkeyApi from '@/data/api/sshkey/sshkey.api'; -import { mockedSshKey } from '@/__tests__/helpers/mocks/sshkey'; +import { + mockedSshKey, + mockedSshKeyDetail, +} from '@/__tests__/helpers/mocks/sshkey'; import { useAddSshKey } from './useAddSshKey.hook'; vi.mock('@/data/api/sshkey/sshkey.api', () => ({ @@ -14,7 +17,7 @@ describe('useAddSshKey', () => { const onAddKeySuccess = vi.fn(); const onError = vi.fn(); - vi.mocked(sshkeyApi.addSSHKey).mockResolvedValue(mockedSshKey); + vi.mocked(sshkeyApi.addSSHKey).mockResolvedValue(mockedSshKeyDetail); const { result } = renderHook( () => useAddSshKey({ onError, onAddKeySuccess }), diff --git a/packages/manager/apps/pci-ai-notebooks/src/hooks/useTracking.ts b/packages/manager/apps/pci-ai-notebooks/src/hooks/useTracking.ts index 1f6da3c23344..2c3c9b3099e0 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/hooks/useTracking.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/hooks/useTracking.ts @@ -1,8 +1,12 @@ -import { useContext, useEffect } from 'react'; +import { useLocation, useMatches, useParams } from 'react-router-dom'; +import { useContext, useEffect, useRef } from 'react'; import { ShellContext } from '@ovh-ux/manager-react-shell-client'; import usePciProject from './api/project/usePciProject.hook'; -import { PCI_LEVEL2 } from '@/configuration/tracking.constants'; -import { PlanCode } from '@/configuration/project'; +import { + APP_TRACKING_PREFIX, + PCI_LEVEL2, +} from '@/configuration/tracking.constants'; +import { PlanCode } from '@/types/cloud/Project'; // Set the project mode, needed to track discovery actions function useProjectModeTracking() { @@ -47,3 +51,38 @@ export function useTrackPage(pageTracking: string) { }); }, []); } + +export function useTrackPageAuto() { + useProjectModeTracking(); + const { shell } = useContext(ShellContext); + const { trackPage } = shell.tracking; + const matches = useMatches(); + const location = useLocation(); + const params = useParams(); + // Last match is the current route, we need it + // to get the tracking key associated with the route + const match = matches[matches.length - 1]; + const hasTrackedRef = useRef(false); + + useEffect(() => { + if (hasTrackedRef.current) return; + const prefix = APP_TRACKING_PREFIX; + const { id } = match; + const routerTrackingKey = (match?.handle as { tracking: string })?.tracking; + const suffix = + routerTrackingKey || id || location.pathname.split('/').pop(); + let injectedTrackingKey = `${prefix}::${suffix}`; + + // replace . by :: + injectedTrackingKey = injectedTrackingKey.replaceAll('.', '::'); + trackPage({ + name: injectedTrackingKey, + level2: PCI_LEVEL2, + }); + hasTrackedRef.current = true; + }, [location.pathname, params.serviceId]); + + useEffect(() => { + hasTrackedRef.current = false; + }, [location.pathname]); +} diff --git a/packages/manager/apps/pci-ai-notebooks/src/lib/durationHelper.ts b/packages/manager/apps/pci-ai-notebooks/src/lib/durationHelper.ts index 5a822d5c32e5..324b0b9aa1db 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/lib/durationHelper.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/lib/durationHelper.ts @@ -1,5 +1,6 @@ import { Duration, Locale, formatDuration } from 'date-fns'; import * as duration from 'duration-fns'; +import { useTranslation } from 'react-i18next'; export function durationStringToHuman(durationString: string, locale: Locale) { return formatDuration(duration.parse(durationString), { @@ -64,9 +65,15 @@ export function convertDurationStringToISODuration(durationTime: string) { return durationToISODurationString(durationStringToDuration(durationTime)); } -export function convertSecondsToTimeString(seconds: number) { - if (seconds === 0) return '0s'; - if (seconds < 60) return `${seconds}s`; +export function convertSecondsToTimeString(seconds: number, short: boolean) { + const { t } = useTranslation('pci-ai-notebooks/components/configuration'); + + if (seconds < 60) + return short + ? `${seconds}s` + : t('numberOfSeconds', { + count: seconds, + }); const days = Math.floor(seconds / 86400); const leftoverSeconds = seconds % 86400; const hours = Math.floor(leftoverSeconds / 3600); @@ -75,13 +82,31 @@ export function convertSecondsToTimeString(seconds: number) { const timeStringParts = []; if (days > 0) { - timeStringParts.push(`${days}d`); + timeStringParts.push( + short + ? `${days}d` + : t('numberOfDays', { + count: days, + }), + ); } if (hours > 0) { - timeStringParts.push(`${hours}h`); + timeStringParts.push( + short + ? `${hours}h` + : t('numberOfHours', { + count: hours, + }), + ); } if (minutes > 0) { - timeStringParts.push(`${minutes}m`); + timeStringParts.push( + short + ? `${minutes}m` + : t('numberOfMinutes', { + count: minutes, + }), + ); } return timeStringParts.join(' '); diff --git a/packages/manager/apps/pci-ai-notebooks/src/lib/statusHelper.ts b/packages/manager/apps/pci-ai-notebooks/src/lib/notebookHelper.ts similarity index 52% rename from packages/manager/apps/pci-ai-notebooks/src/lib/statusHelper.ts rename to packages/manager/apps/pci-ai-notebooks/src/lib/notebookHelper.ts index 8f58386e1e08..2dd3ff9768d5 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/lib/statusHelper.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/lib/notebookHelper.ts @@ -8,8 +8,26 @@ export function isRunningNotebook(currentState: ai.notebook.NotebookStateEnum) { ); } +export function isStoppedNotebook(currentState: ai.notebook.NotebookStateEnum) { + return currentState === ai.notebook.NotebookStateEnum.STOPPED; +} + export function isDeletingNotebook( currentState: ai.notebook.NotebookStateEnum, ) { return currentState === ai.notebook.NotebookStateEnum.DELETING; } + +export function isDataSyncNotebook( + currentState: ai.notebook.NotebookStateEnum, +) { + return ( + currentState === ai.notebook.NotebookStateEnum.RUNNING || + currentState === ai.notebook.NotebookStateEnum.SYNC_FAILED + ); +} + +export const OVH_TAGS_CONFIG = { + id: 'ovh/id', + type: 'ovh/type', +}; diff --git a/packages/manager/apps/pci-ai-notebooks/src/lib/orderFunnelHelper.tsx b/packages/manager/apps/pci-ai-notebooks/src/lib/orderFunnelHelper.tsx index 05bd73f68ab4..379e20b51e38 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/lib/orderFunnelHelper.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/lib/orderFunnelHelper.tsx @@ -27,30 +27,32 @@ export function humanizeFramework( } export function getNotebookSpec(formResult: NotebookOrderResult) { - const notebookInfos: ai.notebook.NotebookSpec = { - env: { - frameworkId: formResult.framework.id, - frameworkVersion: formResult.version, - editorId: formResult.editor.id, - }, + const notebookEnv: ai.notebook.NotebookEnv = { + frameworkId: formResult.framework.id, + frameworkVersion: formResult.version, + editorId: formResult.editor.id, + }; + const notebookResource: ai.ResourcesInput = + formResult.flavor.type === ai.capabilities.FlavorTypeEnum.cpu + ? { + flavor: formResult.flavor.id, + cpu: Number(formResult.resourcesQuantity), + } + : { + flavor: formResult.flavor.id, + gpu: Number(formResult.resourcesQuantity), + }; + + const notebookInfos: ai.notebook.NotebookSpecInput = { + env: notebookEnv, + resources: notebookResource, + name: formResult.notebookName, region: formResult.region.id, unsecureHttp: formResult.unsecureHttp, sshPublicKeys: formResult.sshKey, labels: formResult.labels, }; - if (formResult.flavor.type === ai.capabilities.FlavorTypeEnum.cpu) { - notebookInfos.resources = { - flavor: formResult.flavor.id, - cpu: formResult.resourcesQuantity, - }; - } else { - notebookInfos.resources = { - flavor: formResult.flavor.id, - gpu: formResult.resourcesQuantity, - }; - } - if (formResult.volumes.length > 0) { notebookInfos.volumes = formResult.volumes.map((volume: OrderVolumes) => ({ cache: volume.cache, diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/Root.layout.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/Root.layout.tsx index 04254744315e..2b1fadcb7c5a 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/pages/Root.layout.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/Root.layout.tsx @@ -1,20 +1,23 @@ -import { Outlet, redirect, useLocation, useParams } from 'react-router-dom'; +import { + Outlet, + redirect, + useLocation, + useMatches, + useParams, +} from 'react-router-dom'; import { useRouting, useShell } from '@ovh-ux/manager-react-shell-client'; - import { useEffect } from 'react'; +import { defineCurrentPage } from '@ovh-ux/request-tagger'; import queryClient from '@/query.client'; - import { useLoadingIndicatorContext } from '@/contexts/LoadingIndicator.context'; import { getProject } from '@/data/api/project/project.api'; import Breadcrumb from '@/components/breadcrumb/Breadcrumb.component'; import BreadcrumbItem from '@/components/breadcrumb/BreadcrumbItem.component'; - import { Toaster } from '@/components/ui/toaster'; import PageLayout from '@/components/page-layout/PageLayout.component'; -import Auth from './auth/auth.page'; import { UserActivityProvider } from '@/contexts/UserActivityContext'; import { USER_INACTIVITY_TIMEOUT } from '@/configuration/polling.constants'; -import { useGetAuthorization } from '@/hooks/api/ai/authorization/useGetAuthorization.hook'; +import { useTrackPageAuto } from '@/hooks/useTracking'; export function breadcrumb() { return ( @@ -31,6 +34,8 @@ interface NotebooksLayoutProps { // try to fetch the service data, redirect to service page if it fails export const Loader = async ({ params }: NotebooksLayoutProps) => { const { projectId } = params; + + // check if we have a correct projectId return queryClient .fetchQuery({ queryKey: ['projectId', projectId], @@ -47,6 +52,7 @@ function RoutingSynchronisation() { const location = useLocation(); const routing = useRouting(); const shell = useShell(); + const matches = useMatches(); useEffect(() => { routing.stopListenForHashChange(); @@ -56,6 +62,15 @@ function RoutingSynchronisation() { setLoading(false); routing.onHashChange(); }, [location]); + + useEffect(() => { + const match = matches.slice(-1); + // We cannot type properly useMatches cause it's not support type inference or passing specific type https://github.com/remix-run/react-router/discussions/10902 + defineCurrentPage(`app.pci-databases-analytics.${match[0].id}`); + }, [location]); + + useTrackPageAuto(); + return <>; } @@ -65,29 +80,12 @@ export function useNotebooksData() { } export default function Layout() { - const { projectId } = useParams(); - const authorizationQuery = useGetAuthorization(projectId); - if (authorizationQuery.isSuccess && authorizationQuery.data.authorized) { - return ( - - - - - - - - - ); - } return ( + - { - authorizationQuery.refetch(); - }} - /> + diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/Root.page.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/Root.page.tsx index ab25676cc6b8..3db813298c09 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/pages/Root.page.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/Root.page.tsx @@ -1,4 +1,43 @@ +import { redirect } from 'react-router-dom'; +import queryClient from '@/query.client'; import Notebooks from './notebooks/Notebooks.page'; +import { getNotebooks } from '@/data/api/ai/notebook/notebook.api'; +import { getAuthorization } from '@/data/api/ai/authorization.api'; + +interface NotebooksProps { + params: { + projectId: string; + }; + request: Request; +} + +export const Loader = ({ params }: NotebooksProps) => { + // check if we have a correct category + const { projectId } = params; + return queryClient + .fetchQuery({ + queryKey: [projectId, 'auth'], + queryFn: () => getAuthorization({ projectId }), + }) + .then((auth) => { + if (!auth.authorized) { + return redirect(`/pci/projects/${projectId}/ai/notebooks/auth`); + } + return queryClient + .fetchQuery({ + queryKey: [projectId, 'ai/notebooks'], + queryFn: () => getNotebooks({ projectId }), + }) + .then((notebooks) => { + if (notebooks.length === 0) { + return redirect( + `/pci/projects/${projectId}/ai/notebooks/onboarding`, + ); + } + return null; + }); + }); +}; export default function Root() { return ; diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/_components/AddSSHKey.component.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/_components/sshkey/AddSSHKey.modal.tsx similarity index 88% rename from packages/manager/apps/pci-ai-notebooks/src/pages/_components/AddSSHKey.component.tsx rename to packages/manager/apps/pci-ai-notebooks/src/pages/_components/sshkey/AddSSHKey.modal.tsx index da29e50d66e3..755f19670fea 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/pages/_components/AddSSHKey.component.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/_components/sshkey/AddSSHKey.modal.tsx @@ -1,11 +1,10 @@ -import { useEffect } from 'react'; +import { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; -import { useParams } from 'react-router-dom'; +import { useNavigate, useParams } from 'react-router-dom'; import { z } from 'zod'; import { zodResolver } from '@hookform/resolvers/zod'; import { useForm } from 'react-hook-form'; import * as sshkey from '@/types/cloud/sshkey'; -import { ModalController } from '@/hooks/useModale'; import { UseAddSshKey, useAddSshKey, @@ -13,7 +12,6 @@ import { import { getAIApiErrorMessage } from '@/lib/apiHelper'; import { useToast } from '@/components/ui/use-toast'; import { - Dialog, DialogClose, DialogContent, DialogFooter, @@ -30,22 +28,20 @@ import { } from '@/components/ui/form'; import { Input } from '@/components/ui/input'; import { Button } from '@/components/ui/button'; +import RouteModal from '@/components/route-modal/RouteModal'; +import { useGetSshkey } from '@/hooks/api/sshkey/useGetSshkey.hook'; -interface AddSSHKeyProps { - configuredSshKeys: sshkey.SshKey[]; - controller: ModalController; - onSuccess?: (sshKey: sshkey.SshKey) => void; - onError?: (error: Error) => void; -} - -const AddSSHKey = ({ - configuredSshKeys, - controller, - onError, - onSuccess, -}: AddSSHKeyProps) => { +const AddSSHKey = () => { const { projectId } = useParams(); const { t } = useTranslation('pci-ai-notebooks/components/configuration'); + const navigate = useNavigate(); + + const sshKeyQuery = useGetSshkey(projectId); + + const configuredSshKeys: sshkey.SshKey[] = useMemo(() => { + return sshKeyQuery.data; + }, [sshKeyQuery.isSuccess]); + const sshKeySchema = z.object({ name: z .string() @@ -68,10 +64,6 @@ const AddSSHKey = ({ resolver: zodResolver(sshKeySchema), }); - useEffect(() => { - if (!controller.open) form.reset(); - }, [controller.open]); - const toast = useToast(); const sshKeyMutationConfig: UseAddSshKey = { @@ -81,9 +73,6 @@ const AddSSHKey = ({ variant: 'destructive', description: getAIApiErrorMessage(err), }); - if (onError) { - onError(err); - } }, onAddKeySuccess(sshKey) { form.reset(); @@ -93,9 +82,7 @@ const AddSSHKey = ({ name: sshKey.name, }), }); - if (onSuccess) { - onSuccess(sshKey); - } + navigate('../'); }, }; @@ -110,7 +97,7 @@ const AddSSHKey = ({ }); return ( - + @@ -179,7 +166,7 @@ const AddSSHKey = ({ - + ); }; diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/auth/auth.spec.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/auth/auth.spec.tsx deleted file mode 100644 index 9864a917f540..000000000000 --- a/packages/manager/apps/pci-ai-notebooks/src/pages/auth/auth.spec.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import { describe, it, expect, vi, beforeEach } from 'vitest'; -import { - act, - fireEvent, - render, - screen, - waitFor, -} from '@testing-library/react'; - -import Layout from '@/pages/Root.layout'; -import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; -import * as authAPI from '@/data/api/ai/authorization.api'; -import * as ai from '@/types/cloud/project/ai'; -import { mockedAuthorization } from '@/__tests__/helpers/mocks/authorization'; - -describe('Dashboard Layout', () => { - beforeEach(() => { - vi.restoreAllMocks(); - - vi.mock('react-router-dom', async () => { - const mod = await vi.importActual('react-router-dom'); - return { - ...mod, - useParams: () => ({ - projectId: 'projectId', - }), - }; - }); - - vi.mock('@/data/api/project/project.api', () => { - return { - getProject: vi.fn(() => ({ - project_id: '123456', - projectName: 'projectName', - description: 'description', - })), - }; - }); - vi.mock('@/data/api/ai/authorization.api', () => ({ - getAuthorization: vi.fn(() => mockedAuthorization), - postAuthorization: vi.fn(() => mockedAuthorization), - })); - }); - afterEach(() => { - vi.clearAllMocks(); - }); - - it('renders the Layout component and display auth page', async () => { - const noAut: ai.AuthorizationStatus = { - authorized: false, - }; - vi.mocked(authAPI.getAuthorization).mockResolvedValueOnce(noAut); - render(, { - wrapper: RouterWithQueryClientWrapper, - }); - await waitFor(() => { - expect(screen.getByTestId('activate-project-button')).toBeInTheDocument(); - expect(screen.getByTestId('auth-page-container')).toBeInTheDocument(); - }); - act(() => { - fireEvent.click(screen.getByTestId('activate-project-button')); - }); - await waitFor(() => { - expect(authAPI.postAuthorization).toHaveBeenCalled(); - expect(authAPI.getAuthorization).toHaveBeenCalled(); - }); - }); -}); diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/Notebooks.page.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/Notebooks.page.tsx index 939f11b195d6..c33ce3920c2c 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/Notebooks.page.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/Notebooks.page.tsx @@ -1,6 +1,6 @@ import { Plus } from 'lucide-react'; import { useTranslation } from 'react-i18next'; -import { useParams } from 'react-router-dom'; +import { useParams, Outlet } from 'react-router-dom'; import Link from '@/components/links/Link.component'; import { Button } from '@/components/ui/button'; import { POLLING } from '@/configuration/polling.constants'; @@ -8,7 +8,6 @@ import { useUserActivityContext } from '@/contexts/UserActivityContext'; import { useGetNotebooks } from '@/hooks/api/ai/notebook/useGetNotebooks.hook'; import Guides from '@/components/guides/Guides.component'; import NotebooksList from './_components/NotebooksListTable.component'; -import Onboarding from './_components/Onboarding.component'; const Notebooks = () => { const { t } = useTranslation('pci-ai-notebooks/notebooks'); @@ -19,9 +18,6 @@ const Notebooks = () => { }); if (notebooksQuery.isLoading) return ; - if (notebooksQuery.isSuccess && notebooksQuery.data.length === 0) { - return ; - } return ( <>
{
- + + ); }; diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/Notebook.context.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/Notebook.context.tsx index 301426096e49..4decbdafd87e 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/Notebook.context.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/Notebook.context.tsx @@ -1,6 +1,7 @@ import { UseQueryResult } from '@tanstack/react-query'; -import { useOutletContext, useParams } from 'react-router-dom'; +import { useParams } from 'react-router-dom'; import * as ai from '@/types/cloud/project/ai'; +import { useGetNotebook } from '@/hooks/api/ai/notebook/useGetNotebook.hook'; // Share data with the child routes export type NotebookLayoutContext = { @@ -8,10 +9,7 @@ export type NotebookLayoutContext = { notebookQuery: UseQueryResult; }; export const useNotebookData = () => { - const { projectId } = useParams(); - const { - notebook, - notebookQuery, - } = useOutletContext() as NotebookLayoutContext; - return { projectId, notebook, notebookQuery }; + const { projectId, notebookId } = useParams(); + const notebookQuery = useGetNotebook(projectId, notebookId); + return { projectId, notebook: notebookQuery.data, notebookQuery }; }; diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/Notebook.layout.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/Notebook.layout.tsx index 28be211174d1..d873c447d5d3 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/Notebook.layout.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/Notebook.layout.tsx @@ -7,6 +7,8 @@ import { useUserActivityContext } from '@/contexts/UserActivityContext'; import { getNotebook } from '@/data/api/ai/notebook/notebook.api'; import { useGetNotebook } from '@/hooks/api/ai/notebook/useGetNotebook.hook'; import { NotebookLayoutContext } from './Notebook.context'; +import { NotebookHeader } from './_components/NotebookHeader.component'; +import NotebookTabs from './_components/NotebookTabs.component'; interface NotebookLayoutProps { params: { @@ -55,8 +57,8 @@ export default function NotebookLayout() { if (!notebook) { return ( <> + - Loading your notebook data ); } @@ -67,7 +69,8 @@ export default function NotebookLayout() { return ( <> -
{notebook.spec.name}
+ +
diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/_components/DeleteNotebook.component.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/_components/DeleteNotebook.component.tsx index 897bfcabb11b..915c37247c4d 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/_components/DeleteNotebook.component.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/_components/DeleteNotebook.component.tsx @@ -2,7 +2,6 @@ import { useParams } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import { Button } from '@/components/ui/button'; import { - Dialog, DialogClose, DialogContent, DialogFooter, @@ -11,25 +10,22 @@ import { } from '@/components/ui/dialog'; import { useToast } from '@/components/ui/use-toast'; import * as ai from '@/types/cloud/project/ai'; -import { ModalController } from '@/hooks/useModale'; import { useDeleteNotebook } from '@/hooks/api/ai/notebook/useDeleteNotebook.hook'; import { getAIApiErrorMessage } from '@/lib/apiHelper'; +import RouteModal from '@/components/route-modal/RouteModal'; -interface DeleteNotebookModalProps { +interface DeleteNotebookProps { notebook: ai.notebook.Notebook; - controller: ModalController; onSuccess?: (notebook: ai.notebook.Notebook) => void; - onError?: (service: Error) => void; + onError?: (notebook: Error) => void; } const DeleteNotebook = ({ notebook, - controller, onError, onSuccess, -}: DeleteNotebookModalProps) => { +}: DeleteNotebookProps) => { const { projectId } = useParams(); - const { t } = useTranslation('pci-ai-notebooks/notebooks/notebook'); const toast = useToast(); @@ -64,7 +60,7 @@ const DeleteNotebook = ({ }); }; return ( - + @@ -96,7 +92,7 @@ const DeleteNotebook = ({ - + ); }; diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/_components/NotebookHeader.component.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/_components/NotebookHeader.component.tsx new file mode 100644 index 000000000000..43f82b957698 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/_components/NotebookHeader.component.tsx @@ -0,0 +1,144 @@ +import { useTranslation } from 'react-i18next'; +import { + ArrowUpRightFromSquare, + Globe, + LockKeyhole, + NotebookText, + PlayIcon, + Square, +} from 'lucide-react'; +import { useState } from 'react'; +import { Badge } from '@/components/ui/badge'; +import { Skeleton } from '@/components/ui/skeleton'; +import * as ai from '@/types/cloud/project/ai'; +import NotebookStatusBadge from '../../_components/NotebookStatusBadge.component'; +import { Button } from '@/components/ui/button'; +import { isDeletingNotebook, isRunningNotebook } from '@/lib/notebookHelper'; +import A from '@/components/links/A.component'; +import StartNotebook from './StartNotebook.component'; +import StopNotebook from './StopNotebook.component'; + +export const NotebookHeader = ({ + notebook, +}: { + notebook: ai.notebook.Notebook; +}) => { + const { t } = useTranslation('pci-ai-notebooks/notebooks/notebook'); + const { t: tRegions } = useTranslation('regions'); + const [isStartOpen, setIsStartOpen] = useState(false); + const [isStopOpen, setIsStopOpen] = useState(false); + return ( + <> +
+
+ +
+
+
+

{notebook.spec.name ?? 'Dashboard'}

+
+ {isRunningNotebook(notebook.status.state) || + isDeletingNotebook(notebook.status.state) ? ( + + ) : ( + + )} +
+
+
+ + + + + {notebook.spec.env.frameworkId} + + + {notebook.spec.env.frameworkVersion} + + + {tRegions(`region_${notebook.spec.region}`)} + + + {notebook.spec.unsecureHttp ? ( +
+ {t('publicAccessLabel')} + +
+ ) : ( +
+ {t('privateAccessLabel')} + +
+ )} +
+
+
+
+ {isStartOpen && ( + setIsStartOpen(false)} + onClose={() => setIsStartOpen(false)} + /> + )} + {isStopOpen && ( + setIsStopOpen(false)} + onClose={() => setIsStopOpen(false)} + /> + )} + + ); +}; + +NotebookHeader.Skeleton = function NotebookHeaderSkeleton() { + return ( +
+ +
+

Dashboard

+
+ + + + +
+
+
+ ); +}; diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/_components/NotebookTabs.component.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/_components/NotebookTabs.component.tsx new file mode 100644 index 000000000000..bdaffedd5b22 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/_components/NotebookTabs.component.tsx @@ -0,0 +1,43 @@ +import { useTranslation } from 'react-i18next'; +import { useParams } from 'react-router-dom'; +import TabsMenu from '@/components/tabs-menu/TabsMenu.component'; +import * as ai from '@/types/cloud/project/ai'; +import { useGetBackups } from '@/hooks/api/ai/notebook/backups/useGetBackups.hook'; +import { POLLING } from '@/configuration/polling.constants'; +import { useUserActivityContext } from '@/contexts/UserActivityContext'; + +interface NotebookTabsProps { + notebook: ai.notebook.Notebook; +} + +const NotebookTabs = ({ notebook }: NotebookTabsProps) => { + const { t } = useTranslation('pci-ai-notebooks/notebooks/notebook'); + const { projectId } = useParams(); + const { isUserActive } = useUserActivityContext(); + const { data: backups } = useGetBackups(projectId, notebook.id, { + refetchInterval: isUserActive && POLLING.BACKUPS, + }); + + const attachedData: ai.volume.Volume[] = notebook.spec.volumes.filter( + (vol: ai.volume.Volume) => vol.volumeSource.dataStore.internal === false, + ); + + const tabs = [ + { href: '', label: t('dashboardTab'), end: true }, + attachedData.length > 0 && { + href: 'attach-data', + label: t('dataTab'), + count: attachedData.length, + }, + backups && + backups?.length > 0 && { + href: 'backups', + label: t('backupTab'), + count: backups?.length, + }, + { href: 'logs', label: t('logsTab') }, + ].filter((tab) => tab); + return ; +}; + +export default NotebookTabs; diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/_components/StartNotebook.component.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/_components/StartNotebook.component.tsx index be8b5c726b76..2e8575351927 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/_components/StartNotebook.component.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/_components/StartNotebook.component.tsx @@ -2,7 +2,6 @@ import { useParams } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import { Button } from '@/components/ui/button'; import { - Dialog, DialogClose, DialogContent, DialogFooter, @@ -11,23 +10,23 @@ import { } from '@/components/ui/dialog'; import { useToast } from '@/components/ui/use-toast'; import * as ai from '@/types/cloud/project/ai'; -import { ModalController } from '@/hooks/useModale'; import { getAIApiErrorMessage } from '@/lib/apiHelper'; import { useStartNotebook } from '@/hooks/api/ai/notebook/useStartNotebook.hook'; +import RouteModal from '@/components/route-modal/RouteModal'; -interface StartNotebookModalProps { +interface StartNotebookProps { notebook: ai.notebook.Notebook; - controller: ModalController; - onSuccess?: (notebook: ai.notebook.Notebook) => void; - onError?: (service: Error) => void; + onSuccess?: () => void; + onError?: (notebook: Error) => void; + onClose?: () => void; } const StartNotebook = ({ notebook, - controller, onError, onSuccess, -}: StartNotebookModalProps) => { + onClose, +}: StartNotebookProps) => { const { projectId } = useParams(); const { t } = useTranslation('pci-ai-notebooks/notebooks/notebook'); @@ -52,7 +51,7 @@ const StartNotebook = ({ }), }); if (onSuccess) { - onSuccess(notebook); + onSuccess(); } }, }); @@ -63,8 +62,9 @@ const StartNotebook = ({ notebookId: notebook.id, }); }; + return ( - + @@ -96,7 +96,7 @@ const StartNotebook = ({ - + ); }; diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/_components/StopNotebook.component.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/_components/StopNotebook.component.tsx index 599f871adf14..46ba3e953794 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/_components/StopNotebook.component.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/_components/StopNotebook.component.tsx @@ -2,7 +2,6 @@ import { useParams } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import { Button } from '@/components/ui/button'; import { - Dialog, DialogClose, DialogContent, DialogFooter, @@ -11,23 +10,23 @@ import { } from '@/components/ui/dialog'; import { useToast } from '@/components/ui/use-toast'; import * as ai from '@/types/cloud/project/ai'; -import { ModalController } from '@/hooks/useModale'; import { getAIApiErrorMessage } from '@/lib/apiHelper'; import { useStopNotebook } from '@/hooks/api/ai/notebook/useStopNotebook.hook'; +import RouteModal from '@/components/route-modal/RouteModal'; -interface StopNotebookModalProps { +interface StopNotebookProps { notebook: ai.notebook.Notebook; - controller: ModalController; - onSuccess?: (notebook: ai.notebook.Notebook) => void; - onError?: (service: Error) => void; + onSuccess?: () => void; + onError?: (notebook: Error) => void; + onClose?: () => void; } const StopNotebook = ({ notebook, - controller, onError, onSuccess, -}: StopNotebookModalProps) => { + onClose, +}: StopNotebookProps) => { const { projectId } = useParams(); const { t } = useTranslation('pci-ai-notebooks/notebooks/notebook'); @@ -52,7 +51,7 @@ const StopNotebook = ({ }), }); if (onSuccess) { - onSuccess(notebook); + onSuccess(); } }, }); @@ -64,7 +63,7 @@ const StopNotebook = ({ }); }; return ( - + @@ -115,7 +114,7 @@ const StopNotebook = ({ - + ); }; diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/attached-data/AttachedData.page.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/attached-data/AttachedData.page.tsx new file mode 100644 index 000000000000..b52c26587c65 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/attached-data/AttachedData.page.tsx @@ -0,0 +1,67 @@ +import { useTranslation } from 'react-i18next'; +import { ArrowUpRightFromSquare, Info } from 'lucide-react'; +import { Outlet, useNavigate } from 'react-router-dom'; +import { useNotebookData } from '../Notebook.context'; +import A from '@/components/links/A.component'; +import { Button } from '@/components/ui/button'; +import VolumesList from './_components/VolumesListTable.component'; +import * as ai from '@/types/cloud/project/ai'; +import { isDataSyncNotebook } from '@/lib/notebookHelper'; +import BreadcrumbItem from '@/components/breadcrumb/BreadcrumbItem.component'; + +export function breadcrumb() { + return ( + + ); +} + +const AttachedData = () => { + const { notebook } = useNotebookData(); + const navigate = useNavigate(); + const { t } = useTranslation( + 'pci-ai-notebooks/notebooks/notebook/attached-data', + ); + const volumeInfoLink = 'https://docs.ovh.com/gb/en/publiccloud/ai/data/'; + return ( + <> +

{t('attachedDataTitle')}

+

{t('attachedDataDescription')}

+ +
+

{t('attachedDataInfoLink')}

+ +
+
+ {!isDataSyncNotebook(notebook.status.state) && ( +
+ +

{t('synchDataButtonHelper')}

+
+ )} +
+ +
+ + vol.volumeSource.dataStore.internal === false, + )} + /> + + + ); +}; + +export default AttachedData; diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/attached-data/_components/VolumesListColumns.component.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/attached-data/_components/VolumesListColumns.component.tsx new file mode 100644 index 000000000000..e86e26afa664 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/attached-data/_components/VolumesListColumns.component.tsx @@ -0,0 +1,143 @@ +import { ColumnDef } from '@tanstack/react-table'; +import { useTranslation } from 'react-i18next'; +import { Files, MoreHorizontal } from 'lucide-react'; +import { Button } from '@/components/ui/button'; +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuLabel, + DropdownMenuTrigger, +} from '@/components/ui/dropdown-menu'; +import { SortableHeader } from '@/components/ui/data-table'; +import * as ai from '@/types/cloud/project/ai'; +import { useToast } from '@/components/ui/use-toast'; +import { useNotebookData } from '../../Notebook.context'; +import { isDataSyncNotebook } from '@/lib/notebookHelper'; + +interface VolumesListColumnsProps { + onDataSyncClicked: (volume: ai.volume.Volume) => void; +} + +export const getColumns = ({ onDataSyncClicked }: VolumesListColumnsProps) => { + const { t } = useTranslation( + 'pci-ai-notebooks/notebooks/notebook/attached-data', + ); + const toast = useToast(); + const { notebook } = useNotebookData(); + const columns: ColumnDef[] = [ + { + id: 'Alias', + accessorFn: (row) => row.volumeSource.dataStore.alias, + header: ({ column }) => ( + {t('tableHeaderAlias')} + ), + }, + { + id: 'Container', + accessorFn: (row) => row.volumeSource.dataStore.container, + header: ({ column }) => ( + + {t('tableHeaderContainer')} + + ), + }, + { + id: 'Mountpath', + accessorFn: (row) => row.mountPath, + header: ({ column }) => ( + + {t('tableHeaderMountPath')} + + ), + cell: ({ row }) => { + return ( +
+ +
+ ); + }, + }, + { + id: 'Permission', + accessorFn: (row) => row.permission, + header: ({ column }) => ( + + {t('tableHeaderPermission')} + + ), + cell: ({ row }) => { + return t(`permission_${row.original.permission}`); + }, + }, + { + id: 'Caching', + accessorFn: (row) => row.cache, + header: ({ column }) => ( + + {t('tableHeaderCaching')} + + ), + cell: ({ row }) => { + return row.original.cache + ? t('tableWithCache') + : t('tableWithoutCache'); + }, + }, + { + id: 'actions', + cell: ({ row }) => { + return ( + + + + + + + {t('synchDataDropdownMenuLabel')} + + { + onDataSyncClicked(row.original); + }} + disabled={!isDataSyncNotebook(notebook.status.state)} + > + {t('tableActionSyncData')} + + + + ); + }, + }, + ]; + return columns; +}; diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/attached-data/_components/VolumesListTable.component.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/attached-data/_components/VolumesListTable.component.tsx new file mode 100644 index 000000000000..dba927b7d149 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/attached-data/_components/VolumesListTable.component.tsx @@ -0,0 +1,44 @@ +import { ColumnDef } from '@tanstack/react-table'; +import { useNavigate } from 'react-router-dom'; +import * as ai from '@/types/cloud/project/ai'; +import { getColumns } from './VolumesListColumns.component'; +import { DataTable } from '@/components/ui/data-table'; +import { Skeleton } from '@/components/ui/skeleton'; +import { useNotebookData } from '../../Notebook.context'; + +interface VolumesListProps { + volumes: ai.volume.Volume[]; +} + +export default function VolumesList({ volumes }: Readonly) { + const { notebook } = useNotebookData(); + const navigate = useNavigate(); + const columns: ColumnDef[] = getColumns({ + onDataSyncClicked: (volume: ai.volume.Volume) => { + const volumeId = notebook.status.volumes.find( + (vol) => vol.mountPath === volume.mountPath, + ).id; + navigate(`./data-sync/${volumeId}`); + }, + }); + + return ; +} + +VolumesList.Skeleton = function VolumesListSkeleton() { + return ( + <> +
+ +
+ + +
+
+ + + ); +}; diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/attached-data/dataSync/DataSync.modal.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/attached-data/dataSync/DataSync.modal.tsx new file mode 100644 index 000000000000..769afcbc18c4 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/attached-data/dataSync/DataSync.modal.tsx @@ -0,0 +1,203 @@ +import { useTranslation } from 'react-i18next'; +import { HelpCircle } from 'lucide-react'; +import { useNavigate, useParams } from 'react-router-dom'; +import { useEffect, useState } from 'react'; +import { z } from 'zod'; +import { zodResolver } from '@hookform/resolvers/zod'; +import { useForm } from 'react-hook-form'; +import { Button } from '@/components/ui/button'; +import { + DialogClose, + DialogContent, + DialogFooter, + DialogHeader, + DialogTitle, +} from '@/components/ui/dialog'; +import { useToast } from '@/components/ui/use-toast'; +import * as ai from '@/types/cloud/project/ai'; +import { getAIApiErrorMessage } from '@/lib/apiHelper'; +import { useDataSync } from '@/hooks/api/ai/notebook/datasync/useDataSync.hook'; +import { useNotebookData } from '../../Notebook.context'; +import { + Form, + FormControl, + FormField, + FormItem, + FormLabel, + FormMessage, +} from '@/components/ui/form'; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from '@/components/ui/select'; +import { + Popover, + PopoverContent, + PopoverTrigger, +} from '@/components/ui/popover'; +import RouteModal from '@/components/route-modal/RouteModal'; + +const DataSync = () => { + const { volumeId } = useParams(); + const [volume, setVolume] = useState(); + const { notebook, projectId } = useNotebookData(); + const { t } = useTranslation( + 'pci-ai-notebooks/notebooks/notebook/attached-data', + ); + const navigate = useNavigate(); + const toast = useToast(); + + useEffect(() => { + if (!volumeId) return; + const volumeToSync: ai.volume.VolumeStatus = notebook.status.volumes.find( + (vol: ai.volume.VolumeStatus) => vol.id === volumeId, + ); + if (volumeId && !volumeToSync) navigate('../'); + setVolume(volumeToSync); + }, [volumeId]); + + const { dataSync, isPending } = useDataSync({ + onError: (err) => { + toast.toast({ + title: t('dataSyncToastErrorTitle'), + variant: 'destructive', + description: getAIApiErrorMessage(err), + }); + }, + onSuccess: () => { + const toastdesc: string = volume + ? t('dataSyncMountPathToastSuccessDescription', { + name: volume.mountPath, + interpolation: { escapeValue: false }, + }) + : t('dataSyncGlobalToastSuccessDescription'); + toast.toast({ + title: t('dataSyncToastSuccessTitle'), + description: toastdesc, + }); + navigate('../'); + }, + }); + + const dataSyncTypeRules = z.nativeEnum(ai.volume.DataSyncEnum); + + const schema = z.object({ + type: dataSyncTypeRules, + }); + + type ValidationSchema = z.infer; + + const defaultValues: ValidationSchema = { + type: ai.volume.DataSyncEnum.pull, + }; + + const form = useForm({ + resolver: zodResolver(schema), + defaultValues, + }); + + const onSubmit = form.handleSubmit((formValues) => { + const dataSyncFormValues: ai.volume.DataSyncSpec = { + direction: formValues.type, + }; + if (volume) + dataSyncFormValues.volume = notebook.status.volumes.find( + (vol: ai.volume.VolumeStatus) => vol.mountPath === volume.mountPath, + )?.id; + + dataSync({ + projectId, + notebookId: notebook.id, + dataSyncSpec: dataSyncFormValues, + }); + }); + + return ( + + + + + {t('dataSyncTitle')} + + +
+ + ( + +
+ {t('formDataSyncFieldTypeLabel')} + + + + + +

{t('formDataSyncFieldTypeHelper')}

+
+
+
+ + + +
+ )} + /> + {volume ? ( +

+ {t('dataSyncMountPathAlertDescription', { + name: volume.mountPath, + interpolation: { escapeValue: false }, + })} +

+ ) : ( +

{t('dataSyncGlobalAlertDescription')}

+ )} + + + + + + + + +
+
+ ); +}; + +export default DataSync; diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/backups/Backups.page.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/backups/Backups.page.tsx new file mode 100644 index 000000000000..219f8e046dea --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/backups/Backups.page.tsx @@ -0,0 +1,38 @@ +import { useTranslation } from 'react-i18next'; +import { Outlet } from 'react-router-dom'; +import { useNotebookData } from '../Notebook.context'; +import BreadcrumbItem from '@/components/breadcrumb/BreadcrumbItem.component'; +import { useGetBackups } from '@/hooks/api/ai/notebook/backups/useGetBackups.hook'; +import { useUserActivityContext } from '@/contexts/UserActivityContext'; +import { POLLING } from '@/configuration/polling.constants'; +import BackupsList from './_components/BackupsListTable.component'; + +export function breadcrumb() { + return ( + + ); +} + +const Backups = () => { + const { projectId, notebook } = useNotebookData(); + const { t } = useTranslation('pci-ai-notebooks/notebooks/notebook/backups'); + const { isUserActive } = useUserActivityContext(); + + const backupsQuery = useGetBackups(projectId, notebook.id, { + refetchInterval: isUserActive && POLLING.BACKUPS, + }); + + return ( + <> +

{t('title')}

+

{t('description')}

+ {backupsQuery.isSuccess && } + + + ); +}; + +export default Backups; diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/backups/_components/BackupsListColumns.component.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/backups/_components/BackupsListColumns.component.tsx new file mode 100644 index 000000000000..4cd7e421b417 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/backups/_components/BackupsListColumns.component.tsx @@ -0,0 +1,85 @@ +import { ColumnDef } from '@tanstack/react-table'; +import { MoreHorizontal } from 'lucide-react'; +import { useTranslation } from 'react-i18next'; +import { Button } from '@/components/ui/button'; +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuLabel, + DropdownMenuTrigger, +} from '@/components/ui/dropdown-menu'; +import { SortableHeader } from '@/components/ui/data-table'; +import * as ai from '@/types/cloud/project/ai'; + +interface BackupsListColumnsProps { + onForkClicked: (backup: ai.notebook.Backup) => void; +} + +export const getColumns = ({ onForkClicked }: BackupsListColumnsProps) => { + const { t } = useTranslation('pci-ai-notebooks/notebooks/notebook/backups'); + const columns: ColumnDef[] = [ + { + id: 'Id', + accessorFn: (row) => row.id, + header: ({ column }) => ( + {t('tableHeaderId')} + ), + }, + { + id: 'CreationDate', + accessorFn: (row) => row.createdAt, + header: ({ column }) => ( + + {t('tableHeaderCreationDate')} + + ), + }, + { + id: 'UpdateDate', + accessorFn: (row) => row.updatedAt, + header: ({ column }) => ( + + {t('tableHeaderUpdateDate')} + + ), + }, + { + id: 'actions', + cell: ({ row }) => { + return ( + + + + + + + {t('backupDropdownMenuLabel')} + + { + onForkClicked(row.original); + }} + > + {t('tableActionFork')} + + + + ); + }, + }, + ]; + return columns; +}; diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/backups/_components/BackupsListTable.component.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/backups/_components/BackupsListTable.component.tsx new file mode 100644 index 000000000000..71f77b561cca --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/backups/_components/BackupsListTable.component.tsx @@ -0,0 +1,40 @@ +import { ColumnDef } from '@tanstack/react-table'; +import { useNavigate } from 'react-router-dom'; +import * as ai from '@/types/cloud/project/ai'; +import { getColumns } from './BackupsListColumns.component'; +import { DataTable } from '@/components/ui/data-table'; +import { Skeleton } from '@/components/ui/skeleton'; + +interface BackupsListProps { + backups: ai.notebook.Backup[]; +} + +export default function BackupsList({ backups }: Readonly) { + const navigate = useNavigate(); + + const columns: ColumnDef[] = getColumns({ + onForkClicked: (backup: ai.notebook.Backup) => { + navigate(`./fork/${backup.id}`); + }, + }); + + return ; +} + +BackupsList.Skeleton = function BackupsListSkeleton() { + return ( + <> +
+ +
+ + +
+
+ + + ); +}; diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/backups/fork/Fork.modal.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/backups/fork/Fork.modal.tsx new file mode 100644 index 000000000000..cba3d758e01b --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/backups/fork/Fork.modal.tsx @@ -0,0 +1,97 @@ +import { useTranslation } from 'react-i18next'; +import { useNavigate, useParams } from 'react-router-dom'; +import { useMemo } from 'react'; +import { + DialogClose, + DialogContent, + DialogFooter, + DialogHeader, + DialogTitle, +} from '@/components/ui/dialog'; +import { useToast } from '@/components/ui/use-toast'; +import { useForkBackup } from '@/hooks/api/ai/notebook/backups/useForkBackup.hook'; +import { getAIApiErrorMessage } from '@/lib/apiHelper'; +import * as ai from '@/types/cloud/project/ai'; +import { Button } from '@/components/ui/button'; +import RouteModal from '@/components/route-modal/RouteModal'; +import { useGetBackup } from '@/hooks/api/ai/notebook/backups/useGetBackup.hook'; +import { useNotebookData } from '../../Notebook.context'; + +const Fork = () => { + const { notebook, projectId } = useNotebookData(); + const { backupId } = useParams(); + const navigate = useNavigate(); + const { t } = useTranslation('pci-ai-notebooks/notebooks/notebook/backups'); + const backupQuery = useGetBackup(projectId, notebook.id, backupId); + const toast = useToast(); + + const backup: ai.notebook.Backup = useMemo(() => { + return backupQuery.data; + }, [backupId, backupQuery.isSuccess]); + + const { forkBackup, isPending } = useForkBackup({ + onError: (err) => { + toast.toast({ + title: t('forkToastErrorTitle'), + variant: 'destructive', + description: getAIApiErrorMessage(err), + }); + }, + onSuccess: (newNotebook) => { + toast.toast({ + title: t('forkToastSuccessTitle'), + description: t('forkToastSuccessDescription'), + }); + navigate(`../../../${newNotebook.id}`); + }, + }); + + const handleFork = () => { + forkBackup({ + projectId, + notebookId: notebook.id, + backupId: backup.id, + }); + }; + + return ( + + + + + {t('forkBackupTitle')} + + + {backup && ( +

+ {t('forkBackupDescription', { + id: backup.id, + date: backup.createdAt, + })} +

+ )} + + + + + + +
+
+ ); +}; + +export default Fork; diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/dashboard/Dashboard.page.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/dashboard/Dashboard.page.tsx new file mode 100644 index 000000000000..1ab4aa7727ad --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/dashboard/Dashboard.page.tsx @@ -0,0 +1,160 @@ +import { useTranslation } from 'react-i18next'; +import { + ArrowRight, + Atom, + Link, + RefreshCcwDot, + Settings2, + Tag, + TerminalSquare, + UserCheck, +} from 'lucide-react'; +import { useEffect, useState } from 'react'; +import { Outlet } from 'react-router-dom'; +import { Card, CardContent, CardHeader } from '@/components/ui/card'; +import { useNotebookData } from '../Notebook.context'; +import Resources from './_components/Resources.component'; +import Configurations from './_components/Configuration.component'; +import { useGetCommand } from '@/hooks/api/ai/notebook/useGetCommand.hook'; +import { getAIApiErrorMessage } from '@/lib/apiHelper'; +import { useToast } from '@/components/ui/use-toast'; +import * as ai from '@/types/cloud/project/ai'; +import CliCodeBlock from '@/components/cli-code-block/CliCodeBlock.component'; +import OvhLink from '@/components/links/OvhLink.component'; +import LifeCycle from './_components/LifeCycle.component'; +import Labels from './_components/Labels.component'; +import AccessLink from './_components/AccessLink.component'; + +const Dashboard = () => { + const { notebook, projectId } = useNotebookData(); + const { t } = useTranslation('pci-ai-notebooks/notebooks/notebook/dashboard'); + const { toast } = useToast(); + const [command, setCommand] = useState(); + + const { getCommand } = useGetCommand({ + onError: (err) => { + toast({ + title: t('errorGetCommandCli'), + variant: 'destructive', + description: getAIApiErrorMessage(err), + }); + }, + onSuccess: (cliCommand) => { + setCommand(cliCommand); + }, + }); + + useEffect(() => { + const filteredVolume: ai.volume.Volume[] = notebook.spec.volumes.filter( + (vol) => vol.volumeSource.dataStore.internal === false, + ); + getCommand({ ...notebook.spec, volumes: filteredVolume }); + }, [notebook]); + + return ( + <> +

{t('dashboardTitle')}

+
+ + +

+ + {t('accessLinkTitle')} +

+
+ + + +
+

+ + {t('labelsTitle')} +

+ + + +
+ + +

+ + {t('lifeCycleTitle')} +

+
+ + + +
+ + +

+ + {t('resourcesTitle')} +

+
+ + + +
+
+
+ + +

+ + {t('billingSupportTitle')} +

+
+ +
+ + {t('billingLink')} + + +
+
+ + {t('supportLink')} + + +
+
+
+

+ + {t('configurationTitle')} +

+ + + + +
+ + +

+ + {t('cliTitle')} +

+
+ + {command && ( + + )} + +
+
+ + + ); +}; + +export default Dashboard; diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/dashboard/_components/AccessLink.component.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/dashboard/_components/AccessLink.component.tsx new file mode 100644 index 000000000000..e7cfac2dee26 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/dashboard/_components/AccessLink.component.tsx @@ -0,0 +1,59 @@ +import { + Activity, + ArrowUpRightFromSquare, + NotebookPenIcon, +} from 'lucide-react'; +import { useTranslation } from 'react-i18next'; +import { useNotebookData } from '../../Notebook.context'; +import { Button } from '@/components/ui/button'; +import * as ai from '@/types/cloud/project/ai'; +import A from '@/components/links/A.component'; + +const AccessLink = () => { + const { notebook } = useNotebookData(); + const { t } = useTranslation('pci-ai-notebooks/notebooks/notebook/dashboard'); + + return ( + <> +
+
{t('liveCodeEditorTitle')}
+ +
+ +
+
{t('grafanaTitle')}
+ +
+ + + ); +}; + +export default AccessLink; diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/dashboard/_components/Configuration.component.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/dashboard/_components/Configuration.component.tsx new file mode 100644 index 000000000000..ae21f53f1e81 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/dashboard/_components/Configuration.component.tsx @@ -0,0 +1,50 @@ +import { Files } from 'lucide-react'; +import { useTranslation } from 'react-i18next'; +import { useNavigate } from 'react-router-dom'; +import { useNotebookData } from '../../Notebook.context'; +import { Button } from '@/components/ui/button'; +import { useToast } from '@/components/ui/use-toast'; +import { isStoppedNotebook } from '@/lib/notebookHelper'; + +const Configurations = () => { + const { notebook } = useNotebookData(); + const { t } = useTranslation('pci-ai-notebooks/notebooks/notebook/dashboard'); + const navigate = useNavigate(); + const toast = useToast(); + + return ( +
+
+
+

{t('notebookIdLabel')}

+

{notebook.id}

+
+ +
+ +
+ ); +}; + +export default Configurations; diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/dashboard/_components/Labels.component.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/dashboard/_components/Labels.component.tsx new file mode 100644 index 000000000000..a61711ec9392 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/dashboard/_components/Labels.component.tsx @@ -0,0 +1,79 @@ +import { useTranslation } from 'react-i18next'; +import { useMemo } from 'react'; +import { useNotebookData } from '../../Notebook.context'; +import { OVH_TAGS_CONFIG } from '@/lib/notebookHelper'; +import { useEditLabel } from '@/hooks/api/ai/notebook/label/useEditLabel.hook'; +import { useToast } from '@/components/ui/use-toast'; +import { getAIApiErrorMessage } from '@/lib/apiHelper'; +import * as ai from '@/types/cloud/project/ai'; +import LabelsForm from '@/components/labels/LabelsForm.component'; + +const Labels = () => { + const { notebook, notebookQuery, projectId } = useNotebookData(); + const { t } = useTranslation('pci-ai-notebooks/notebooks/notebook/dashboard'); + const toast = useToast(); + + const configuredLabel: ai.Label[] = useMemo( + () => + notebook?.spec?.labels && + Object.entries(notebook.spec.labels) + .filter( + ([key]) => key !== OVH_TAGS_CONFIG.id && key !== OVH_TAGS_CONFIG.type, + ) + .map(([key, value]) => ({ + name: key, + value, + })), + [notebook], + ); + + const { editLabel } = useEditLabel({ + onError: (err) => { + toast.toast({ + title: t('notebookToastErrorTitle'), + variant: 'destructive', + description: getAIApiErrorMessage(err), + }); + }, + onSuccess: () => { + toast.toast({ + title: t('notebookToastSuccessTitle'), + description: t('deleteNotebookSuccess'), + }); + notebookQuery.refetch(); + }, + }); + + const handleDeleteLabel = (key: string) => { + editLabel({ + projectId, + notebookId: notebook.id, + label: { + name: key, + }, + }); + }; + + const handleAddLabel = (label: ai.Label) => { + editLabel({ + projectId, + notebookId: notebook.id, + label: { + name: label.name, + value: label.value, + }, + }); + }; + + return ( +
+ handleAddLabel(newLabel)} + onDelete={(newLabel) => handleDeleteLabel(newLabel.name)} + /> +
+ ); +}; + +export default Labels; diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/dashboard/_components/LifeCycle.component.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/dashboard/_components/LifeCycle.component.tsx new file mode 100644 index 000000000000..3fc0cc10a1fd --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/dashboard/_components/LifeCycle.component.tsx @@ -0,0 +1,43 @@ +import { useTranslation } from 'react-i18next'; +import { Check } from 'lucide-react'; +import { format } from 'date-fns'; +import { useNotebookData } from '../../Notebook.context'; +import { convertSecondsToTimeString } from '@/lib/durationHelper'; +import { Table, TableBody, TableCell, TableRow } from '@/components/ui/table'; +import { TIMELINE_MAX } from '@/configuration/polling.constants'; +import { useDateFnsLocale } from '@/hooks/useDateFnsLocale.hook'; + +const LifeCycle = () => { + const { notebook } = useNotebookData(); + const { t } = useTranslation('pci-ai-notebooks/notebooks/notebook/dashboard'); + const dateLocale = useDateFnsLocale(); + return ( + <> +
{t('durationTitle')}
+ {convertSecondsToTimeString(notebook.status.duration, false)} +
{t('timeLineTitle')}
+ + + {notebook.status?.lastJobStatus?.history + ?.slice(TIMELINE_MAX) + .map((state) => ( + + + + + {state.state} + + {format(state.date, 'PPpp', { locale: dateLocale })} + + + ))} + +
+ + ); +}; + +export default LifeCycle; diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/dashboard/_components/Resources.component.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/dashboard/_components/Resources.component.tsx new file mode 100644 index 000000000000..d8eef2ecae52 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/dashboard/_components/Resources.component.tsx @@ -0,0 +1,152 @@ +import { Cpu, HardDrive, HelpCircle, MemoryStick, Zap } from 'lucide-react'; +import { useTranslation } from 'react-i18next'; +import { useNotebookData } from '../../Notebook.context'; +import { bytesConverter } from '@/lib/bytesHelper'; +import { Slider } from '@/components/ui/slider'; +import { + Popover, + PopoverContent, + PopoverTrigger, +} from '@/components/ui/popover'; + +const Resources = () => { + const { notebook } = useNotebookData(); + const { t } = useTranslation('pci-ai-notebooks/notebooks/notebook/dashboard'); + return ( +
+ {notebook.spec.resources.gpu > 0 ? ( +
+
+
{t('powerTitleSection')}
+ +
+ + {`${notebook.spec.resources.gpu} x ${notebook.spec.resources.flavor}`} + + + {`${notebook.spec.resources.gpu} x ${notebook.spec.resources.gpuModel}`} + + + {t('gpuMemoryField', { + gpu: notebook.spec.resources.gpu, + memory: bytesConverter( + notebook.spec.resources.gpuMemory, + false, + 0, + ), + })} + +
+ ) : ( +
+
+
{t('powerTitleSection')}
+ +
+ + {`${notebook.spec.resources.cpu} x ${notebook.spec.resources.flavor}`} + + {`${notebook.spec.resources.cpu} x INTEL CPU VCORES`} +
+ )} +
+
+
{t('computeTitleSection')}
+ +
+ {notebook.spec.resources.gpu > 0 && ( + + {t('gcuComputeField', { + cpu: notebook.spec.resources.cpu, + })} + + )} + + {t('memoryField', { + memory: bytesConverter(notebook.spec.resources.memory, false, 0), + })} + + + {t('publicNetworkField', { + network: bytesConverter( + notebook.spec.resources.publicNetwork, + true, + 2, + ), + })} + + +
+
{t('storageTitleSection')}
+ +
+
+ + {t('temporaryLocalStorageField', { + storage: bytesConverter( + notebook.spec.resources.ephemeralStorage, + false, + 0, + ), + })} + + + + + + +

{t('temporaryLocalStorageHelper')}

+
+
+
+
+
+ + {t('workspaceStorage', { + storage: bytesConverter( + notebook.status.workspace.storageFree, + false, + 1, + ), + })} + + + + + + +

{t('workspaceStorageHelper')}

+
+
+
+
+ + + {t('sliderInfo', { + usedStorage: bytesConverter( + notebook.status.workspace.storageUsed, + false, + 1, + ), + totalStorage: bytesConverter( + notebook.status.workspace.storageFree, + false, + 1, + ), + })} + +
+
+ ); +}; + +export default Resources; diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/dashboard/delete/Delete.modal.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/dashboard/delete/Delete.modal.tsx new file mode 100644 index 000000000000..406b97e2b709 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/dashboard/delete/Delete.modal.tsx @@ -0,0 +1,17 @@ +import { useNavigate, useParams } from 'react-router-dom'; +import { useGetNotebook } from '@/hooks/api/ai/notebook/useGetNotebook.hook'; +import DeleteNotebook from '../../_components/DeleteNotebook.component'; + +const DeleteNotebookModal = () => { + const { projectId, notebookId } = useParams(); + const navigate = useNavigate(); + const notebookQuery = useGetNotebook(projectId, notebookId); + return ( + navigate('../..')} + notebook={notebookQuery.data} + /> + ); +}; + +export default DeleteNotebookModal; diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/logs/Logs.page.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/logs/Logs.page.tsx new file mode 100644 index 000000000000..70dea1c52ca7 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/[notebookId]/logs/Logs.page.tsx @@ -0,0 +1,109 @@ +import { useTranslation } from 'react-i18next'; +import { useEffect, useRef, useState } from 'react'; +import { useNotebookData } from '../Notebook.context'; +import BreadcrumbItem from '@/components/breadcrumb/BreadcrumbItem.component'; +import { Skeleton } from '@/components/ui/skeleton'; +import { Switch } from '@/components/ui/switch'; +import { Label } from '@/components/ui/label'; +import { ScrollArea, ScrollBar } from '@/components/ui/scroll-area'; +import { useUserActivityContext } from '@/contexts/UserActivityContext'; +import { useGetLogs } from '@/hooks/api/ai/notebook/logs/useGetLogs.hook'; +import { POLLING } from '@/configuration/polling.constants'; + +export function breadcrumb() { + return ( + + ); +} + +interface RandomWidthSkeletonsProps { + itemCount: number; + minWidth: number; + maxWidth: number; +} +const RandomWidthSkeletons = ({ + itemCount, + minWidth, + maxWidth, +}: RandomWidthSkeletonsProps) => { + const randomWidths = Array.from( + { length: itemCount }, + () => + `${Math.floor(Math.random() * (maxWidth - minWidth + 1)) + minWidth}rem`, + ); + return ( +
    + {randomWidths.map((width, index) => ( +
  • + +
  • + ))} +
+ ); +}; + +const Logs = () => { + const { projectId, notebook } = useNotebookData(); + const { t } = useTranslation('pci-ai-notebooks/notebooks/notebook/logs'); + + const [poll, setPoll] = useState(false); + const listLogRef = useRef(null); + const { isUserActive } = useUserActivityContext(); + const logsQuery = useGetLogs(projectId, notebook.id, { + refetchInterval: isUserActive && poll && POLLING.LOGS, + }); + // scroll to the bottom on data update + useEffect(() => { + if ( + logsQuery.isSuccess && + logsQuery.data?.logs.length > 0 && + listLogRef.current + ) { + listLogRef.current.lastElementChild?.scrollIntoView({ + behavior: 'smooth', + }); + } + }, [logsQuery.isSuccess, logsQuery.data]); + + return ( + <> +

{t('title')}

+

{t('description')}

+
+ setPoll(checked)} + /> + +
+ + {logsQuery.isSuccess ? ( +
    + {logsQuery.data.logs.map((log, index) => ( +
  • + {log.timestamp} + {log.content} +
  • + ))} +
+ ) : ( + + )} + +
+ + ); +}; + +export default Logs; diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/_components/NotebooksListColumns.component.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/_components/NotebooksListColumns.component.tsx index fbb0b68c22e9..d758528926e3 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/_components/NotebooksListColumns.component.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/_components/NotebooksListColumns.component.tsx @@ -1,9 +1,10 @@ import { ColumnDef } from '@tanstack/react-table'; import { + ArrowUpRightFromSquare, Cpu, + Globe, + LockKeyhole, MoreHorizontal, - ShieldAlert, - ShieldCheck, Zap, } from 'lucide-react'; import { useTranslation } from 'react-i18next'; @@ -23,7 +24,12 @@ import { SortableHeader } from '@/components/ui/data-table'; import Link from '@/components/links/Link.component'; import { convertSecondsToTimeString } from '@/lib/durationHelper'; import NotebookStatusBadge from './NotebookStatusBadge.component'; -import { isDeletingNotebook, isRunningNotebook } from '@/lib/statusHelper'; +import { + isDeletingNotebook, + isRunningNotebook, + isStoppedNotebook, +} from '@/lib/notebookHelper'; +import A from '@/components/links/A.component'; interface NotebooksListColumnsProps { onStartClicked: (notebook: ai.notebook.Notebook) => void; @@ -81,14 +87,46 @@ export const getColumns = ({ ), }, { - id: 'Environment', - accessorFn: (row) => - `${row.spec.env.frameworkId} - ${row.spec.env.frameworkVersion}`, + id: 'Framework', + accessorFn: (row) => row.spec.env.frameworkId, + header: ({ column }) => ( + + {t('tableHeaderFramework')} + + ), + cell: ({ row }) => ( + {row.original.spec.env.frameworkId} + ), + }, + { + id: 'Editor', + accessorFn: (row) => row.spec.env.editorId, header: ({ column }) => ( - {t('tableHeaderEnvironment')} + {t('tableHeaderEditor')} ), + cell: ({ row }) => ( + + ), }, { id: 'Resources', @@ -119,7 +157,8 @@ export const getColumns = ({ }, { id: 'Operating time', - accessorFn: (row) => convertSecondsToTimeString(row.status.duration), + accessorFn: (row) => + convertSecondsToTimeString(row.status.duration, true), header: ({ column }) => ( {t('tableHeaderDuration')} @@ -140,13 +179,13 @@ export const getColumns = ({
{unsecureHttp ? (
- - {t('networkSecureTitle')} + + {t('networkPublicTitle')}
) : (
- - {t('networkPublicTitle')} + + {t('networkSecureTitle')}
)}
@@ -231,7 +270,7 @@ export const getColumns = ({ { diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/_components/NotebooksListTable.component.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/_components/NotebooksListTable.component.tsx index 46c98d08c738..e67d8cb7ca92 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/_components/NotebooksListTable.component.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/_components/NotebooksListTable.component.tsx @@ -1,93 +1,30 @@ import { ColumnDef } from '@tanstack/react-table'; -import { useMemo } from 'react'; +import { useNavigate } from 'react-router-dom'; import { DataTable } from '@/components/ui/data-table'; import { Skeleton } from '@/components/ui/skeleton'; import * as ai from '@/types/cloud/project/ai'; import { getColumns } from './NotebooksListColumns.component'; -import { useModale } from '@/hooks/useModale'; -import DeleteNotebook from '../[notebookId]/_components/DeleteNotebook.component'; -import StartNotebook from '../[notebookId]/_components/StartNotebook.component'; -import StopNotebook from '../[notebookId]/_components/StopNotebook.component'; interface NotebooksListProps { notebooks: ai.notebook.Notebook[]; - refetchFn: () => void; } -export default function NotebooksList({ - notebooks, - refetchFn, -}: NotebooksListProps) { - const startModale = useModale('start'); - const stopModale = useModale('stop'); - const deleteModale = useModale('delete'); - - const startingNotebook = useMemo( - () => notebooks.find((s) => s.id === startModale.value), - [startModale.value, notebooks], - ); - const stoppingNotebook = useMemo( - () => notebooks.find((s) => s.id === stopModale.value), - [stopModale.value, notebooks], - ); - - const deletingNotebook = useMemo( - () => notebooks.find((s) => s.id === deleteModale.value), - [deleteModale.value, notebooks], - ); +export default function NotebooksList({ notebooks }: NotebooksListProps) { + const navigate = useNavigate(); const columns: ColumnDef[] = getColumns({ onStartClicked: (notebook: ai.notebook.Notebook) => { - startModale.open(notebook.id); + navigate(`./start/${notebook.id}`); }, onStopClicked: (notebook: ai.notebook.Notebook) => { - stopModale.open(notebook.id); + navigate(`./stop/${notebook.id}`); }, onDeleteClicked: (notebook: ai.notebook.Notebook) => { - deleteModale.open(notebook.id); + navigate(`./delete/${notebook.id}`); }, }); - return ( - <> - - {deletingNotebook && ( - { - deleteModale.close(); - refetchFn(); - }} - /> - )} - {startingNotebook && ( - { - startModale.close(); - refetchFn(); - }} - /> - )} - {stoppingNotebook && ( - { - stopModale.close(); - refetchFn(); - }} - /> - )} - - ); + return ; } NotebooksList.Skeleton = function NotebooksListSkeleton() { @@ -97,10 +34,10 @@ NotebooksList.Skeleton = function NotebooksListSkeleton() { data-testid="notebook-list-table-skeleton" className="flex justify-between w-100 mb-2 items-end" > - +
- - + +
diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/auth/auth.page.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/auth/Auth.page.tsx similarity index 93% rename from packages/manager/apps/pci-ai-notebooks/src/pages/auth/auth.page.tsx rename to packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/auth/Auth.page.tsx index 5d3cec440579..b26d2fbf8b81 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/pages/auth/auth.page.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/auth/Auth.page.tsx @@ -1,5 +1,5 @@ import { useTranslation } from 'react-i18next'; -import { useParams } from 'react-router-dom'; +import { useNavigate, useParams } from 'react-router-dom'; import { AlertCircle, ArrowRight } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { useToast } from '@/components/ui/use-toast'; @@ -12,13 +12,10 @@ import OvhLink from '@/components/links/OvhLink.component'; import usePciProject from '@/hooks/api/project/usePciProject.hook'; import { PlanCode } from '@/configuration/project'; -interface AuthProps { - onSuccess?: () => void; -} - -export default function Auth({ onSuccess }: AuthProps) { +export default function Auth() { const { t } = useTranslation('pci-ai-notebooks/auth'); const toast = useToast(); + const navigate = useNavigate(); const { projectId } = useParams(); const projectData = usePciProject(); @@ -38,9 +35,7 @@ export default function Auth({ onSuccess }: AuthProps) { title: t('formActiveUserToastSuccessTitle'), description: t(`formActiveUserToastSuccessDescription`), }); - if (onSuccess) { - onSuccess(); - } + navigate('../'); }, }; diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/create/Create.page.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/create/Create.page.tsx index aeb08ff882fb..9f39d5b38592 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/create/Create.page.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/create/Create.page.tsx @@ -1,5 +1,5 @@ import { useTranslation } from 'react-i18next'; -import { useParams } from 'react-router-dom'; +import { Outlet, useParams } from 'react-router-dom'; import BreadcrumbItem from '@/components/breadcrumb/BreadcrumbItem.component'; import Guides from '@/components/guides/Guides.component'; import { useGetCatalog } from '@/hooks/api/catalog/useGetCatalog.hook'; @@ -8,7 +8,6 @@ import { useGetRegions } from '@/hooks/api/ai/capabilities/useGetRegions.hook'; import { useGetFramework } from '@/hooks/api/ai/notebook/capabilities/useGetFramework.hook'; import { useGetEditor } from '@/hooks/api/ai/notebook/capabilities/useGetEditor.hook'; import { useGetSshkey } from '@/hooks/api/sshkey/useGetSshkey.hook'; -import { mockedSuggestion } from '@/__tests__/helpers/mocks/suggestion'; import { useGetSuggestions } from '@/hooks/api/ai/notebook/useGetSuggestions.hook'; export function breadcrumb() { @@ -63,6 +62,7 @@ const Notebook = () => { suggestions={suggestionsQuery.data} /> )} + ); }; diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/create/_components/CliEquivalent.component.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/create/_components/CliEquivalent.component.tsx index 03ce10313f1b..b9e8ccd930f4 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/create/_components/CliEquivalent.component.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/create/_components/CliEquivalent.component.tsx @@ -28,6 +28,7 @@ const CliEquivalent = ({ command, controller }: CliEquivalentModalProps) => { title={t('cliEquivalentModalDescription')} code={command.command} toastMessage={t('cliEquivalentModalToastMessage')} + size="max-h-[60vh] px-6" /> diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/create/_components/OrderFunnel.component.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/create/_components/OrderFunnel.component.tsx index ca4bcd51df54..b0b754ef34a3 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/create/_components/OrderFunnel.component.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/create/_components/OrderFunnel.component.tsx @@ -41,7 +41,7 @@ import { PopoverTrigger, } from '@/components/ui/popover'; import { Label } from '@/components/ui/label'; -import LabelsForm from '@/components/order/configuration/LabelsForm.component'; +import LabelsForm from '@/components/labels/LabelsForm.component'; import SshKeyForm from '@/components/order/configuration/SshKeyForm.component'; import { SshKey } from '@/types/cloud/sshkey'; import VolumeForm from '@/components/order/volumes/VolumesForm.component'; @@ -49,11 +49,10 @@ import { useAddNotebook } from '@/hooks/api/ai/notebook/useAddNotebook.hook'; import { useToast } from '@/components/ui/use-toast'; import { getAIApiErrorMessage } from '@/lib/apiHelper'; import ErrorList from '@/components/order/error-list/ErrorList.component'; -import { OrderSshKey, PrivacyEnum, Suggestions } from '@/types/orderFunnel'; +import { PrivacyEnum, Suggestions } from '@/types/orderFunnel'; import { useModale } from '@/hooks/useModale'; import { useGetCommand } from '@/hooks/api/ai/notebook/useGetCommand.hook'; import CliEquivalent from './CliEquivalent.component'; -import AddSSHKey from '@/pages/_components/AddSSHKey.component'; import { getNotebookSpec } from '@/lib/orderFunnelHelper'; interface OrderFunnelProps { @@ -89,9 +88,8 @@ const OrderFunnel = ({ const navigate = useNavigate(); const { toast } = useToast(); - const [command, setCommand] = useState({}); + const [command, setCommand] = useState({ command: '' }); - const addSshKeyModale = useModale('addSshKey'); const { addNotebook, isPending: isPendingAddNotebook } = useAddNotebook({ onError: (err) => { toast({ @@ -102,7 +100,8 @@ const OrderFunnel = ({ }, onSuccess: (notebook) => { toast({ - title: t('successCreatingNotebook'), + title: t('successCreatingNotebookTitle'), + description: t('successCreatingNotebookDescription'), }); navigate(`../${notebook.id}`); }, @@ -122,7 +121,7 @@ const OrderFunnel = ({ }); const getCliCommand = () => { - const notebookInfos: ai.notebook.NotebookSpec = getNotebookSpec( + const notebookInfos: ai.notebook.NotebookSpecInput = getNotebookSpec( model.result, ); getCommand(notebookInfos); @@ -130,7 +129,7 @@ const OrderFunnel = ({ const onSubmit = model.form.handleSubmit( () => { - const notebookInfos: ai.notebook.NotebookSpec = getNotebookSpec( + const notebookInfos: ai.notebook.NotebookSpecInput = getNotebookSpec( model.result, ); addNotebook(notebookInfos); @@ -466,9 +465,9 @@ const OrderFunnel = ({ - model.form.setValue('labels', newLabel) + configuredLabels={field.value} + onChange={(newLabels: ai.Label[]) => + model.form.setValue('labels', newLabels) } /> @@ -495,7 +494,7 @@ const OrderFunnel = ({ size="sm" className="text-base" type="button" - onClick={() => addSshKeyModale.open()} + onClick={() => navigate('./add-sshkey')} > {t('sshkeyAddButtonLabel')} @@ -576,16 +575,6 @@ const OrderFunnel = ({ - { - addSshKeyModale.close(); - const newSshKeyList: OrderSshKey[] = model.form.getValues('sshKey'); - newSshKeyList.push({ name: sshKey.name, sshKey: sshKey.publicKey }); - model.form.setValue('sshKey', newSshKeyList); - }} - /> { {order.unsecureHttp ? (
{t('summaryFieldPublicLabel')} - +
) : (
{t('summaryFieldPrivateLabel')} - +
)} diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/create/_components/useOrderFunnel.hook.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/create/_components/useOrderFunnel.hook.tsx index 16f3e0c1c77e..213443545a67 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/create/_components/useOrderFunnel.hook.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/create/_components/useOrderFunnel.hook.tsx @@ -1,7 +1,6 @@ import { zodResolver } from '@hookform/resolvers/zod'; -import { useEffect, useMemo, useState } from 'react'; +import { useEffect, useMemo } from 'react'; import { useForm } from 'react-hook-form'; -import { useTranslation } from 'react-i18next'; import { useParams } from 'react-router-dom'; import { z } from 'zod'; import { s } from 'vitest/dist/reporters-P7C2ytIv'; diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/delete/Delete.modal.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/delete/Delete.modal.tsx new file mode 100644 index 000000000000..adc3c2c483bc --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/delete/Delete.modal.tsx @@ -0,0 +1,17 @@ +import { useNavigate, useParams } from 'react-router-dom'; +import { useGetNotebook } from '@/hooks/api/ai/notebook/useGetNotebook.hook'; +import DeleteNotebook from '../[notebookId]/_components/DeleteNotebook.component'; + +const DeleteNotebookModal = () => { + const { projectId, notebookId } = useParams(); + const navigate = useNavigate(); + const notebookQuery = useGetNotebook(projectId, notebookId); + return ( + navigate('../')} + notebook={notebookQuery.data} + /> + ); +}; + +export default DeleteNotebookModal; diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/_components/Onboarding.component.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/onboarding/Onboarding.page.tsx similarity index 100% rename from packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/_components/Onboarding.component.tsx rename to packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/onboarding/Onboarding.page.tsx diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/start/Start.modal.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/start/Start.modal.tsx new file mode 100644 index 000000000000..3431a369082d --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/start/Start.modal.tsx @@ -0,0 +1,17 @@ +import { useNavigate, useParams } from 'react-router-dom'; +import { useGetNotebook } from '@/hooks/api/ai/notebook/useGetNotebook.hook'; +import StartNotebook from '../[notebookId]/_components/StartNotebook.component'; + +const StartNotebookModal = () => { + const { projectId, notebookId } = useParams(); + const navigate = useNavigate(); + const notebookQuery = useGetNotebook(projectId, notebookId); + return ( + navigate('../')} + notebook={notebookQuery.data} + /> + ); +}; + +export default StartNotebookModal; diff --git a/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/stop/Stop.modal.tsx b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/stop/Stop.modal.tsx new file mode 100644 index 000000000000..630ce97b88b4 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/pages/notebooks/stop/Stop.modal.tsx @@ -0,0 +1,17 @@ +import { useNavigate, useParams } from 'react-router-dom'; +import { useGetNotebook } from '@/hooks/api/ai/notebook/useGetNotebook.hook'; +import StopNotebook from '../[notebookId]/_components/StopNotebook.component'; + +const StopNotebookModal = () => { + const { projectId, notebookId } = useParams(); + const navigate = useNavigate(); + const notebookQuery = useGetNotebook(projectId, notebookId); + return ( + navigate('../')} + notebook={notebookQuery.data} + /> + ); +}; + +export default StopNotebookModal; diff --git a/packages/manager/apps/pci-ai-notebooks/src/routes/routes.tsx b/packages/manager/apps/pci-ai-notebooks/src/routes/routes.tsx index 8164e37b43f1..078fb4d0d4ac 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/routes/routes.tsx +++ b/packages/manager/apps/pci-ai-notebooks/src/routes/routes.tsx @@ -29,6 +29,41 @@ export default [ path: '', id: 'notebooks', ...lazyRouteConfig(() => import('@/pages/Root.page')), + children: [ + { + path: 'start/:notebookId', + id: 'notebooks.start', + ...lazyRouteConfig(() => + import('@/pages/notebooks/start/Start.modal'), + ), + }, + { + path: 'stop/:notebookId', + id: 'notebooks.stop', + ...lazyRouteConfig(() => + import('@/pages/notebooks/stop/Stop.modal'), + ), + }, + { + path: 'delete/:notebookId', + id: 'notebooks.delete', + ...lazyRouteConfig(() => + import('@/pages/notebooks/delete/Delete.modal'), + ), + }, + ], + }, + { + path: 'auth', + id: 'auth', + ...lazyRouteConfig(() => import('@/pages/notebooks/auth/Auth.page')), + }, + { + path: 'onboarding', + id: 'onboarding', + ...lazyRouteConfig(() => + import('@/pages/notebooks/onboarding/Onboarding.page'), + ), }, { path: 'new', @@ -36,12 +71,95 @@ export default [ ...lazyRouteConfig(() => import('@/pages/notebooks/create/Create.page'), ), + children: [ + { + path: 'add-sshkey', + id: 'create.add-sshkey', + ...lazyRouteConfig(() => + import('@/pages/_components/sshkey/AddSSHKey.modal'), + ), + }, + ], }, { path: ':notebookId', ...lazyRouteConfig(() => import('@/pages/notebooks/[notebookId]/Notebook.layout'), ), + children: [ + { + path: '', + id: 'notebook.dashboard', + ...lazyRouteConfig(() => + import('@/pages/notebooks/[notebookId]/dashboard/Dashboard.page'), + ), + children: [ + { + path: 'delete', + id: 'notebook.dashboard.delete', + ...lazyRouteConfig(() => + import( + '@/pages/notebooks/[notebookId]/dashboard/delete/Delete.modal' + ), + ), + }, + ], + }, + { + path: 'attach-data', + id: 'notebook.attach-data', + ...lazyRouteConfig(() => + import( + '@/pages/notebooks/[notebookId]/attached-data/AttachedData.page' + ), + ), + children: [ + { + path: 'data-sync', + id: 'notebook.attach-data.data-sync', + ...lazyRouteConfig(() => + import( + '@/pages/notebooks/[notebookId]/attached-data/dataSync/DataSync.modal' + ), + ), + }, + { + path: 'data-sync/:volumeId?', + id: 'notebook.attach-data.data-sync.volume', + ...lazyRouteConfig(() => + import( + '@/pages/notebooks/[notebookId]/attached-data/dataSync/DataSync.modal' + ), + ), + }, + ], + }, + { + path: 'logs', + id: 'notebook.logs', + ...lazyRouteConfig(() => + import('@/pages/notebooks/[notebookId]/logs/Logs.page'), + ), + }, + { + path: 'backups', + id: 'notebook.backups', + ...lazyRouteConfig(() => + import('@/pages/notebooks/[notebookId]/backups/Backups.page'), + ), + children: [ + { + path: 'fork/:backupId?', + id: 'notebook.notebook.backups.fork', + ...lazyRouteConfig(() => + import( + '@/pages/notebooks/[notebookId]/backups/fork/Fork.modal' + ), + ), + }, + ], + }, + ], }, ], }, diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/Project.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/Project.ts index c932783a7b2d..638fd476b39c 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/Project.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/Project.ts @@ -4,11 +4,11 @@ import { ProjectStatusEnum } from '@/types/cloud/project/ProjectStatusEnum'; /** Project */ export interface Project { /** Project access */ - access?: AccessTypeEnum; + access: AccessTypeEnum; /** Project creation date */ - creationDate?: string; + creationDate: string; /** Description of your project */ - description: string; + description?: string; /** Expiration date of your project. After this date, your project will be deleted */ expiration?: string; /** Manual quota prevent automatic quota upgrade */ @@ -16,13 +16,18 @@ export interface Project { /** Project order id */ orderId?: number; /** Order plan code */ - planCode?: string; + planCode: string; /** Project name */ projectName?: string; /** Project id */ - project_id?: string; + project_id: string; /** Current status */ - status?: ProjectStatusEnum; + status: ProjectStatusEnum; /** Project unleashed */ - unleash?: boolean; + unleash: boolean; +} + +export enum PlanCode { + DISCOVERY = 'project.discovery', + STANDARD = 'project.2018', } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/BandwidthInstance.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/BandwidthInstance.ts index 54111e097f95..8c5e8a2ed010 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/BandwidthInstance.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/BandwidthInstance.ts @@ -3,7 +3,7 @@ import { Quantity } from '@/types/cloud/billingView/Quantity'; /** BandwidthInstance */ export interface BandwidthInstance { /** Total bandwidth in GiB */ - quantity?: Quantity; + quantity: Quantity; /** Total price */ - totalPrice?: number; + totalPrice: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/BandwidthStorage.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/BandwidthStorage.ts index 0edeb8f2d8f1..138c58174a6c 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/BandwidthStorage.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/BandwidthStorage.ts @@ -3,7 +3,7 @@ import { Quantity } from '@/types/cloud/billingView/Quantity'; /** BandwidthStorage */ export interface BandwidthStorage { /** Total bandwidth in GiB */ - quantity?: Quantity; + quantity: Quantity; /** Total price */ - totalPrice?: number; + totalPrice: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/Component.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/Component.ts index a508654c671b..414ab0fdb5e9 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/Component.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/Component.ts @@ -3,9 +3,9 @@ import { Quantity } from '@/types/cloud/billingView/Quantity'; /** Component */ export interface Component { /** Name of the component */ - name?: string; + name: string; /** Total quantity for the component */ - quantity?: Quantity; + quantity: Quantity; /** Total price for this component */ - totalPrice?: number; + totalPrice: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyInstance.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyInstance.ts index b55f91e2d08a..f1a8bbb3dcab 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyInstance.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyInstance.ts @@ -4,13 +4,13 @@ import { Quantity } from '@/types/cloud/billingView/Quantity'; /** HourlyInstance */ export interface HourlyInstance { /** Details about hourly instances */ - details?: HourlyInstanceDetail[]; + details: HourlyInstanceDetail[]; /** Hours of run instances */ - quantity?: Quantity; + quantity: Quantity; /** Instance reference */ - reference?: string; + reference: string; /** Instance region */ - region?: string; + region: string; /** Total price */ - totalPrice?: number; + totalPrice: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyInstanceBandwidth.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyInstanceBandwidth.ts index 9c50c1fb91ba..43f1aec10b7e 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyInstanceBandwidth.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyInstanceBandwidth.ts @@ -7,7 +7,7 @@ export interface HourlyInstanceBandwidth { /** Instance outgoing bandwidth details */ outgoingBandwidth?: BandwidthInstance; /** Region */ - region?: string; + region: string; /** Total price */ - totalPrice?: number; + totalPrice: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyInstanceDetail.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyInstanceDetail.ts index 3c399bb416b4..728532b23ca4 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyInstanceDetail.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyInstanceDetail.ts @@ -3,9 +3,9 @@ import { Quantity } from '@/types/cloud/billingView/Quantity'; /** HourlyInstanceDetail */ export interface HourlyInstanceDetail { /** Instance ID */ - instanceId?: string; + instanceId: string; /** Hours of run instances */ - quantity?: Quantity; + quantity: Quantity; /** Total price */ - totalPrice?: number; + totalPrice: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyInstanceOption.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyInstanceOption.ts index 16c76d49eb8c..58d8cdd3873a 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyInstanceOption.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyInstanceOption.ts @@ -4,13 +4,13 @@ import { Quantity } from '@/types/cloud/billingView/Quantity'; /** HourlyInstanceOption */ export interface HourlyInstanceOption { /** Details about hourly instances option */ - details?: HourlyInstanceOptionDetail[]; + details: HourlyInstanceOptionDetail[]; /** Quantity of instance hours running with this option */ - quantity?: Quantity; + quantity: Quantity; /** Instance reference */ - reference?: string; + reference: string; /** Instance region */ - region?: string; + region: string; /** Total price */ - totalPrice?: number; + totalPrice: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyInstanceOptionDetail.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyInstanceOptionDetail.ts index 4caf20f66cc3..d6a717f523bb 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyInstanceOptionDetail.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyInstanceOptionDetail.ts @@ -3,9 +3,9 @@ import { Quantity } from '@/types/cloud/billingView/Quantity'; /** HourlyInstanceOptionDetail */ export interface HourlyInstanceOptionDetail { /** Instance ID */ - instanceId?: string; + instanceId: string; /** Quantity of instance hours running with this option */ - quantity?: Quantity; + quantity: Quantity; /** Total price */ - totalPrice?: number; + totalPrice: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyResources.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyResources.ts index 772ad6edea68..a4b03b93f3f6 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyResources.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyResources.ts @@ -8,15 +8,15 @@ import { HourlyVolume } from '@/types/cloud/billingView/HourlyVolume'; /** HourlyResources */ export interface HourlyResources { /** Details about hourly instances */ - instance?: HourlyInstance[]; + instance: HourlyInstance[]; /** Details about instances bandwidth consumption */ - instanceBandwidth?: HourlyInstanceBandwidth[]; + instanceBandwidth: HourlyInstanceBandwidth[]; /** Details about hourly instances options */ - instanceOption?: HourlyInstanceOption[]; + instanceOption: HourlyInstanceOption[]; /** Details about hourly snapshots */ - snapshot?: HourlySnapshot[]; + snapshot: HourlySnapshot[]; /** Details about hourly storage */ - storage?: HourlyStorage[]; + storage: HourlyStorage[]; /** Details about hourly volumes */ - volume?: HourlyVolume[]; + volume: HourlyVolume[]; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlySnapshot.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlySnapshot.ts index 0423a049dbe4..f88995ae6eb3 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlySnapshot.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlySnapshot.ts @@ -6,9 +6,9 @@ export interface HourlySnapshot { /** Instance snapshot details */ instance?: InstanceSnapshot; /** Region */ - region?: string; + region: string; /** Total price */ - totalPrice?: number; + totalPrice: number; /** Volume snapshot details */ volume?: VolumeSnapshot; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyStorage.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyStorage.ts index 97adcef552c7..2abfcdb4aed8 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyStorage.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyStorage.ts @@ -15,11 +15,11 @@ export interface HourlyStorage { /** Storage outgoing internal bandwidth details */ outgoingInternalBandwidth?: BandwidthStorage; /** Region */ - region?: string; + region: string; /** Information about stored data */ stored?: StoredStorage; /** Total price */ - totalPrice?: number; + totalPrice: number; /** Storage type */ - type?: StorageTypeEnum; + type: StorageTypeEnum; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyVolume.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyVolume.ts index d995f85b53f4..8490126c7a9f 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyVolume.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyVolume.ts @@ -4,13 +4,13 @@ import { Quantity } from '@/types/cloud/billingView/Quantity'; /** HourlyVolume */ export interface HourlyVolume { /** Detail about volume consumption */ - details?: HourlyVolumeDetail[]; + details: HourlyVolumeDetail[]; /** Total GiBh of volume */ - quantity?: Quantity; + quantity: Quantity; /** Region */ - region?: string; + region: string; /** Total price */ - totalPrice?: number; + totalPrice: number; /** Volume type */ - type?: string; + type: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyVolumeDetail.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyVolumeDetail.ts index db52a7e38422..b8d091121beb 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyVolumeDetail.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/HourlyVolumeDetail.ts @@ -3,9 +3,9 @@ import { Quantity } from '@/types/cloud/billingView/Quantity'; /** HourlyVolumeDetail */ export interface HourlyVolumeDetail { /** GiBh of volume */ - quantity?: Quantity; + quantity: Quantity; /** Total price */ - totalPrice?: number; + totalPrice: number; /** Volume ID */ - volumeId?: string; + volumeId: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/InstanceSnapshot.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/InstanceSnapshot.ts index 6b3b620fcdb6..f7105778689b 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/InstanceSnapshot.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/InstanceSnapshot.ts @@ -3,7 +3,7 @@ import { Quantity } from '@/types/cloud/billingView/Quantity'; /** InstanceSnapshot */ export interface InstanceSnapshot { /** GiBh stored */ - quantity?: Quantity; + quantity: Quantity; /** Total price */ - totalPrice?: number; + totalPrice: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/MonthlyCertification.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/MonthlyCertification.ts index 43b397a531f6..f79b4ad76715 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/MonthlyCertification.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/MonthlyCertification.ts @@ -3,9 +3,9 @@ import { MonthlyCertificationDetail } from '@/types/cloud/billingView/MonthlyCer /** MonthlyCertification */ export interface MonthlyCertification { /** Details about certifications */ - details?: MonthlyCertificationDetail[]; + details: MonthlyCertificationDetail[]; /** Certification reference */ - reference?: string; + reference: string; /** Total price */ - totalPrice?: number; + totalPrice: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/MonthlyCertificationDetail.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/MonthlyCertificationDetail.ts index 13f41c449905..8be7ea1f1b99 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/MonthlyCertificationDetail.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/MonthlyCertificationDetail.ts @@ -1,7 +1,7 @@ /** MonthlyCertificationDetail */ export interface MonthlyCertificationDetail { /** Certification activation */ - activation?: string; + activation: string; /** Total price */ - totalPrice?: number; + totalPrice: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/MonthlyInstance.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/MonthlyInstance.ts index 915c603c941d..cbc29f9c95ed 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/MonthlyInstance.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/MonthlyInstance.ts @@ -3,11 +3,11 @@ import { MonthlyInstanceDetail } from '@/types/cloud/billingView/MonthlyInstance /** MonthlyInstance */ export interface MonthlyInstance { /** Details about monthly instances */ - details?: MonthlyInstanceDetail[]; + details: MonthlyInstanceDetail[]; /** Instance reference */ - reference?: string; + reference: string; /** Instance region */ - region?: string; + region: string; /** Total price */ - totalPrice?: number; + totalPrice: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/MonthlyInstanceDetail.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/MonthlyInstanceDetail.ts index ddb429e26ca9..e670467c0de4 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/MonthlyInstanceDetail.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/MonthlyInstanceDetail.ts @@ -1,9 +1,9 @@ /** MonthlyInstanceDetail */ export interface MonthlyInstanceDetail { /** Monthly instance activation */ - activation?: string; + activation: string; /** Instance ID */ - instanceId?: string; + instanceId: string; /** Total price */ - totalPrice?: number; + totalPrice: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/MonthlyInstanceOption.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/MonthlyInstanceOption.ts index 37bb7b7a2b52..21b44838cc7f 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/MonthlyInstanceOption.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/MonthlyInstanceOption.ts @@ -3,11 +3,11 @@ import { MonthlyInstanceOptionDetail } from '@/types/cloud/billingView/MonthlyIn /** MonthlyInstanceOption */ export interface MonthlyInstanceOption { /** Details about monthly instances */ - details?: MonthlyInstanceOptionDetail[]; + details: MonthlyInstanceOptionDetail[]; /** Instance reference */ - reference?: string; + reference: string; /** Instance region */ - region?: string; + region: string; /** Total price */ - totalPrice?: number; + totalPrice: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/MonthlyInstanceOptionDetail.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/MonthlyInstanceOptionDetail.ts index 2290ef214614..6c4500fcfa94 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/MonthlyInstanceOptionDetail.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/MonthlyInstanceOptionDetail.ts @@ -1,7 +1,7 @@ /** MonthlyInstanceOptionDetail */ export interface MonthlyInstanceOptionDetail { /** Instance ID */ - instanceId?: string; + instanceId: string; /** Total price */ - totalPrice?: number; + totalPrice: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/MonthlyResources.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/MonthlyResources.ts index 66c2a4e61629..b251ded5dff2 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/MonthlyResources.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/MonthlyResources.ts @@ -7,7 +7,7 @@ export interface MonthlyResources { /** Details about certifications */ certification?: MonthlyCertification[]; /** Details about monthly instances */ - instance?: MonthlyInstance[]; + instance: MonthlyInstance[]; /** Details about monthly instances options */ - instanceOption?: MonthlyInstanceOption[]; + instanceOption: MonthlyInstanceOption[]; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/Quantity.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/Quantity.ts index 01d7b2ba1f9e..fadfc09f3645 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/Quantity.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/Quantity.ts @@ -3,7 +3,7 @@ import { UnitQuantityEnum } from '@/types/cloud/billingView/UnitQuantityEnum'; /** Quantity */ export interface Quantity { /** Quantity unit */ - unit?: UnitQuantityEnum; + unit: UnitQuantityEnum; /** Quantity value */ - value?: number; + value: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/RegionalizedResource.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/RegionalizedResource.ts index 4e5db549c5af..91798916466a 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/RegionalizedResource.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/RegionalizedResource.ts @@ -3,7 +3,7 @@ import { Component } from '@/types/cloud/billingView/Component'; /** RegionalizedResource */ export interface RegionalizedResource { /** List of components */ - components?: Component[]; + components: Component[]; /** Region of the resource */ - region?: string; + region: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/StoredStorage.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/StoredStorage.ts index d510d4d2de02..b8a9a0cab281 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/StoredStorage.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/StoredStorage.ts @@ -3,7 +3,7 @@ import { Quantity } from '@/types/cloud/billingView/Quantity'; /** StoredStorage */ export interface StoredStorage { /** GiBh stored */ - quantity?: Quantity; + quantity: Quantity; /** Total price */ - totalPrice?: number; + totalPrice: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/TypedResources.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/TypedResources.ts index 41688f55a6a1..c45098f1a281 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/TypedResources.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/TypedResources.ts @@ -3,9 +3,9 @@ import { RegionalizedResource } from '@/types/cloud/billingView/RegionalizedReso /** TypedResources */ export interface TypedResources { /** Resources per region */ - resources?: RegionalizedResource[]; + resources: RegionalizedResource[]; /** Total price */ - totalPrice?: number; + totalPrice: number; /** Type of the resources */ - type?: string; + type: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/UsedCredit.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/UsedCredit.ts index 18cca95cb474..22e5688c7412 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/UsedCredit.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/UsedCredit.ts @@ -1,9 +1,9 @@ /** UsedCredit */ export interface UsedCredit { /** Credit description */ - description?: string; + description: string; /** Credit ID */ - id?: number; + id: number; /** Total credit used */ - usedAmount?: number; + usedAmount: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/UsedCredits.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/UsedCredits.ts index 640d52517d48..35fedc118b88 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/UsedCredits.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/UsedCredits.ts @@ -3,7 +3,7 @@ import { UsedCredit } from '@/types/cloud/billingView/UsedCredit'; /** UsedCredits */ export interface UsedCredits { /** Details about credits that will be used */ - details?: UsedCredit[]; + details: UsedCredit[]; /** Total credit that will be used to pay the bill */ - totalCredit?: number; + totalCredit: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/VolumeSnapshot.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/VolumeSnapshot.ts index dc675275030e..5abd58a24fc3 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/VolumeSnapshot.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/billingView/VolumeSnapshot.ts @@ -3,7 +3,7 @@ import { Quantity } from '@/types/cloud/billingView/Quantity'; /** VolumeSnapshot */ export interface VolumeSnapshot { /** GiBh stored */ - quantity?: Quantity; + quantity: Quantity; /** Total price */ - totalPrice?: number; + totalPrice: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/AuthorizationStatus.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/AuthorizationStatus.ts index 2eb3a0e98e5e..bb8283032265 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/AuthorizationStatus.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/AuthorizationStatus.ts @@ -1,5 +1,5 @@ /** Authorization status */ export interface AuthorizationStatus { /** True if project is authorized to use AI Solutions Platform */ - authorized?: boolean; + authorized: boolean; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/Command.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/Command.ts index 245938b7ac3a..7462c169f0a5 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/Command.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/Command.ts @@ -1,5 +1,5 @@ /** AI Solutions CLI command */ export interface Command { /** AI Solutions CLI command */ - command?: string; + command: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/DataStore.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/DataStore.ts index cd41b197cf6e..ec953d13651f 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/DataStore.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/DataStore.ts @@ -4,11 +4,11 @@ import { DataStoreTypeEnum } from '@/types/cloud/project/ai/DataStoreTypeEnum'; /** AI Solutions data store container Volume Object */ export interface DataStore { /** Data store alias */ - alias?: string; + alias: string; /** Data store endpoint URL */ endpoint?: string; /** Owner type of the datastore */ - owner?: DataStoreOwnerEnum; + owner: DataStoreOwnerEnum; /** Type of the datastore */ - type?: DataStoreTypeEnum; + type: DataStoreTypeEnum; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/Env.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/Env.ts index aa708d204159..474658c70a75 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/Env.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/Env.ts @@ -3,5 +3,5 @@ export interface Env { /** Name of the environment variable to set inside the AI Solutions instance */ name: string; /** Value of the environment variable to set inside the AI Solutions instance */ - value: string; + value?: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/GenericResponse.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/GenericResponse.ts index bb62305cd70d..055bf6968be9 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/GenericResponse.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/GenericResponse.ts @@ -1,5 +1,5 @@ /** Basic model with a single message field */ export interface GenericResponse { /** */ - message?: string; + message: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/Info.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/Info.ts index a37cddda1697..3dc2c577fec3 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/Info.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/Info.ts @@ -3,7 +3,7 @@ import { InfoCodeEnum } from '@/types/cloud/project/ai/InfoCodeEnum'; /** Information about the state of this entity */ export interface Info { /** Info code identifier */ - code?: InfoCodeEnum; + code: InfoCodeEnum; /** Formatted message */ - message?: string; + message: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/Label.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/Label.ts index d05f8a7a9f85..23ec8bb75de8 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/Label.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/Label.ts @@ -3,5 +3,5 @@ export interface Label { /** Name of the label to update/add */ name: string; /** Value of the label to update/add, is there is no value the label is deleted */ - value: string; + value?: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/Logs.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/Logs.ts index d648a99827b9..9e3c2097426a 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/Logs.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/Logs.ts @@ -5,5 +5,5 @@ export interface Logs { /** Last activity date */ lastActivity?: string; /** Logs lines */ - logs?: LogLine[]; + logs: LogLine[]; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/Resources.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/Resources.ts index 2fd1b82f3aa2..c6572e2c323b 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/Resources.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/Resources.ts @@ -1,13 +1,13 @@ /** AI Solutions Resource Object */ export interface Resources { /** Number of vCPU resources requested */ - cpu?: number; + cpu: number; /** The amount of ephemeral storage in bytes */ - ephemeralStorage?: number; + ephemeralStorage: number; /** Current instance flavor */ - flavor?: string; + flavor: string; /** Number of GPU resources requested */ - gpu?: number; + gpu: number; /** The GPU Brand */ gpuBrand?: string; /** The GPU Memory in bits */ @@ -15,9 +15,9 @@ export interface Resources { /** The GPU Model */ gpuModel?: string; /** The amount of memory in bytes */ - memory?: number; + memory: number; /** The guarantee private bandwidth in bytes per seconds */ - privateNetwork?: number; + privateNetwork: number; /** The guarantee public bandwidth in bytes per seconds */ - publicNetwork?: number; + publicNetwork: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/ResourcesInput.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/ResourcesInput.ts index 26672950b8ec..5266807a06ee 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/ResourcesInput.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/ResourcesInput.ts @@ -1,23 +1,23 @@ /** AI Solutions Resource Object */ export interface ResourcesInput { /** Number of vCPU resources requested */ - cpu: number; + cpu?: number; /** The amount of ephemeral storage in bytes */ - ephemeralStorage: number; + ephemeralStorage?: number; /** Instance flavor */ - flavor: string; + flavor?: string; /** Number of GPU resources requested */ - gpu: number; + gpu?: number; /** The GPU Brand */ - gpuBrand: string; + gpuBrand?: string; /** The GPU Memory in bytes */ - gpuMemory: number; + gpuMemory?: number; /** The GPU Model */ - gpuModel: string; + gpuModel?: string; /** The amount of memory in bytes */ - memory: number; + memory?: number; /** The private network bandwidth in bits per seconds */ - privateNetwork: number; + privateNetwork?: number; /** The public network bandwidth in bits per seconds */ - publicNetwork: number; + publicNetwork?: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/App.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/App.ts new file mode 100644 index 000000000000..e870a7f919ca --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/App.ts @@ -0,0 +1,18 @@ +import { AppSpec } from '@/types/cloud/project/ai/app/AppSpec'; +import { AppStatus } from '@/types/cloud/project/ai/app/AppStatus'; + +/** AI Solutions Platform App Object */ +export interface App { + /** App creation date */ + createdAt: string; + /** App Id */ + id: string; + /** App spec */ + spec: AppSpec; + /** App Container Status */ + status: AppStatus; + /** App last update date */ + updatedAt: string; + /** App user owner */ + user: string; +} diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/AppImageInput.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/AppImageInput.ts new file mode 100644 index 000000000000..60c2bec5484e --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/AppImageInput.ts @@ -0,0 +1,5 @@ +/** AI App Image object */ +export interface AppImageInput { + /** URL of the Docker image */ + url: string; +} diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/AppSpec.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/AppSpec.ts new file mode 100644 index 000000000000..0a120145afac --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/AppSpec.ts @@ -0,0 +1,42 @@ +import { DeploymentStrategy } from '@/types/cloud/project/ai/app/DeploymentStrategy'; +import { JobEnv } from '@/types/cloud/project/ai/job/JobEnv'; +import { Probe } from '@/types/cloud/project/ai/app/Probe'; +import { Resources } from '@/types/cloud/project/ai/Resources'; +import { ScalingStrategy } from '@/types/cloud/project/ai/app/ScalingStrategy'; +import { Volume } from '@/types/cloud/project/ai/volume/Volume'; + +/** AI Solutions App Spec Object to create an app */ +export interface AppSpec { + /** App command */ + command?: string[]; + /** Default port to access the http service inside the app */ + defaultHttpPort?: number; + /** AI App deployment strategy */ + deploymentStrategy?: DeploymentStrategy; + /** List of environment variable to be set inside the app */ + envVars?: JobEnv[]; + /** GRPC Port that we want to expose in case workload HTTP & gRPC servers cannot be multiplexed to listen on the same port */ + grpcPort?: number; + /** App image */ + image: string; + /** Labels for the app */ + labels?: { [key: string]: string }; + /** App liveness probe */ + livenessProbe?: Probe; + /** App name */ + name: string; + /** Partner ID */ + partnerId?: string; + /** App readiness probe */ + probe?: Probe; + /** Host region of the app */ + region: string; + /** App resources */ + resources: Resources; + /** App scaling strategy */ + scalingStrategy?: ScalingStrategy; + /** True if app api port can be accessed without any authentication token, false otherwise */ + unsecureHttp?: boolean; + /** App Data linked */ + volumes?: Volume[]; +} diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/AppSpecInput.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/AppSpecInput.ts new file mode 100644 index 000000000000..d3e8048d6834 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/AppSpecInput.ts @@ -0,0 +1,42 @@ +import { DeploymentStrategy } from '@/types/cloud/project/ai/app/DeploymentStrategy'; +import { JobEnv } from '@/types/cloud/project/ai/job/JobEnv'; +import { ProbeInput } from '@/types/cloud/project/ai/app/ProbeInput'; +import { ResourcesInput } from '@/types/cloud/project/ai/ResourcesInput'; +import { ScalingStrategyInput } from '@/types/cloud/project/ai/app/ScalingStrategyInput'; +import { Volume } from '@/types/cloud/project/ai/volume/Volume'; + +/** AI Solutions App Spec Object to create a app */ +export interface AppSpecInput { + /** App command */ + command?: string[]; + /** Default port to access http service inside the app */ + defaultHttpPort?: number; + /** AI App deployment strategy */ + deploymentStrategy?: DeploymentStrategy; + /** List of environment variable to be set inside the app */ + envVars?: JobEnv[]; + /** GRPC Port that we want to expose in case workload HTTP & gRPC servers cannot be multiplexed to listen on the same port */ + grpcPort?: number; + /** Docker or capability image to use in the app. App capability images must comply with the pattern 'image-id:version' */ + image: string; + /** Labels are used to scope tokens, labels prefixed by 'ovh/' are owned by the platform and overridden */ + labels?: { [key: string]: string }; + /** App liveness probe */ + livenessProbe?: ProbeInput; + /** App name */ + name: string; + /** Partner ID */ + partnerId?: string; + /** App readiness probe */ + probe?: ProbeInput; + /** Host region of the app */ + region: string; + /** App resources */ + resources: ResourcesInput; + /** App scaling strategy */ + scalingStrategy?: ScalingStrategyInput; + /** Whether if app api port can be accessed without any authentication token */ + unsecureHttp?: boolean; + /** App Data linked */ + volumes?: Volume[]; +} diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/AppStateEnum.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/AppStateEnum.ts new file mode 100644 index 000000000000..851c58f3b995 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/AppStateEnum.ts @@ -0,0 +1,13 @@ +/** State of the application */ +export enum AppStateEnum { + 'DELETED' = 'DELETED', + 'DELETING' = 'DELETING', + 'ERROR' = 'ERROR', + 'FAILED' = 'FAILED', + 'INITIALIZING' = 'INITIALIZING', + 'QUEUED' = 'QUEUED', + 'RUNNING' = 'RUNNING', + 'SCALING' = 'SCALING', + 'STOPPED' = 'STOPPED', + 'STOPPING' = 'STOPPING', +} diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/AppStateHistory.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/AppStateHistory.ts new file mode 100644 index 000000000000..2e450ac06a2e --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/AppStateHistory.ts @@ -0,0 +1,9 @@ +import { AppStateEnum } from '@/types/cloud/project/ai/app/AppStateEnum'; + +/** AI Solutions App State History Object */ +export interface AppStateHistory { + /** Date when the status occurred */ + date: string; + /** State of the app */ + state: AppStateEnum; +} diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/AppStatus.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/AppStatus.ts new file mode 100644 index 000000000000..db84a6b746b1 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/AppStatus.ts @@ -0,0 +1,34 @@ +import { DataSync } from '@/types/cloud/project/ai/volume/DataSync'; +import { AppStateHistory } from '@/types/cloud/project/ai/app/AppStateHistory'; +import { Info } from '@/types/cloud/project/ai/Info'; +import { Ip } from '@/types/Ip'; +import { AppStateEnum } from '@/types/cloud/project/ai/app/AppStateEnum'; +import { VolumeStatus } from '@/types/cloud/project/ai/volume/VolumeStatus'; + +/** AI Solutions App Status Object */ +export interface AppStatus { + /** Number of available replicas */ + availableReplicas: number; + /** Status about the datasync linked to the app */ + dataSync: DataSync[]; + /** Address to reach when you want to access the App's gRPC services */ + grpcAddress?: string; + /** Job state history */ + history: AppStateHistory[]; + /** Information about the app */ + info: Info; + /** App info url */ + infoUrl?: string; + /** Internal IP address of the app service */ + internalServiceIp?: Ip; + /** Date of the last app state change */ + lastTransitionDate?: string; + /** App resource usage url */ + monitoringUrl?: string; + /** State of the app */ + state?: AppStateEnum; + /** App access url */ + url?: string; + /** App Data linked */ + volumes?: VolumeStatus[]; +} diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/DeploymentStrategy.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/DeploymentStrategy.ts new file mode 100644 index 000000000000..37b88177c17c --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/DeploymentStrategy.ts @@ -0,0 +1,9 @@ +/** AI Solutions AI App deployment strategy object */ +export interface DeploymentStrategy { + /** Maximum number of replicas that can be created over the desired number of Pods (can be expressed as a percentage of the desired pods, suffixed with '%') */ + maxSurge?: string; + /** Maximum number of replicas that can be unavailable during the update process (can be expressed as a percentage of the desired pods, suffixed with '%') */ + maxUnavailable?: string; + /** Number of seconds you want to wait for your Deployment to progress before the system reports back that the Deployment has failed progressing */ + progressDeadlineSeconds?: number; +} diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/Probe.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/Probe.ts new file mode 100644 index 000000000000..5b62ac7c3de5 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/Probe.ts @@ -0,0 +1,17 @@ +/** AI Solutions App Probe Object */ +export interface Probe { + /** Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. */ + failureThreshold?: number; + /** Number of seconds after the container has started before liveness probes are initiated. */ + initialDelaySeconds?: number; + /** Path to access to check for readiness */ + path?: string; + /** How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. */ + periodSeconds?: number; + /** Port to access to check for readiness */ + port?: number; + /** Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. */ + successThreshold?: number; + /** Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. */ + timeoutSeconds?: number; +} diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/ProbeInput.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/ProbeInput.ts new file mode 100644 index 000000000000..776c93d25436 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/ProbeInput.ts @@ -0,0 +1,17 @@ +/** AI Solutions App Probe Object */ +export interface ProbeInput { + /** Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. */ + failureThreshold?: number; + /** Number of seconds after the container has started before liveness probes are initiated. */ + initialDelaySeconds?: number; + /** Path to access to check for readiness */ + path?: string; + /** How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. */ + periodSeconds?: number; + /** Port to access to check for readiness */ + port?: number; + /** Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. */ + successThreshold?: number; + /** Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. */ + timeoutSeconds?: number; +} diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/ScalingAutomaticStrategy.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/ScalingAutomaticStrategy.ts new file mode 100644 index 000000000000..ff83133039bd --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/ScalingAutomaticStrategy.ts @@ -0,0 +1,13 @@ +import { ScalingAutomaticStrategyResourceTypeEnum } from '@/types/cloud/project/ai/app/ScalingAutomaticStrategyResourceTypeEnum'; + +/** AI Solutions App automatic scaling strategy object */ +export interface ScalingAutomaticStrategy { + /** The average resource usage threshold that the app upscale or downscale will be triggered from, in percent */ + averageUsageTarget: number; + /** Maximum number of replicas */ + replicasMax: number; + /** Minimum number of replicas */ + replicasMin: number; + /** Type of the resource to base the automatic scaling on */ + resourceType: ScalingAutomaticStrategyResourceTypeEnum; +} diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/ScalingAutomaticStrategyInput.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/ScalingAutomaticStrategyInput.ts new file mode 100644 index 000000000000..e288cc24c5f7 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/ScalingAutomaticStrategyInput.ts @@ -0,0 +1,13 @@ +import { ScalingAutomaticStrategyResourceTypeEnum } from '@/types/cloud/project/ai/app/ScalingAutomaticStrategyResourceTypeEnum'; + +/** AI Solutions App automatic scaling strategy object */ +export interface ScalingAutomaticStrategyInput { + /** The average resource usage threshold that the app upscale or downscale will be triggered from, in percent */ + averageUsageTarget: number; + /** Maximum number of replicas */ + replicasMax: number; + /** Minimum number of replicas */ + replicasMin: number; + /** Type of the resource to base the automatic scaling on */ + resourceType: ScalingAutomaticStrategyResourceTypeEnum; +} diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/ScalingAutomaticStrategyResourceTypeEnum.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/ScalingAutomaticStrategyResourceTypeEnum.ts new file mode 100644 index 000000000000..ff9be05cd713 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/ScalingAutomaticStrategyResourceTypeEnum.ts @@ -0,0 +1,5 @@ +/** Resource type for App automatic scaling strategy */ +export enum ScalingAutomaticStrategyResourceTypeEnum { + 'CPU' = 'CPU', + 'RAM' = 'RAM', +} diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/ScalingFixedStrategy.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/ScalingFixedStrategy.ts new file mode 100644 index 000000000000..7906e423bc5e --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/ScalingFixedStrategy.ts @@ -0,0 +1,5 @@ +/** AI Solutions App Status Object */ +export interface ScalingFixedStrategy { + /** Number of wanted replicas */ + replicas: number; +} diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/ScalingFixedStrategyInput.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/ScalingFixedStrategyInput.ts new file mode 100644 index 000000000000..727e27f63b89 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/ScalingFixedStrategyInput.ts @@ -0,0 +1,5 @@ +/** AI Solutions App Status Object */ +export interface ScalingFixedStrategyInput { + /** Number of wanted replicas */ + replicas: number; +} diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/ScalingStrategy.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/ScalingStrategy.ts new file mode 100644 index 000000000000..9e17b5b941a5 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/ScalingStrategy.ts @@ -0,0 +1,10 @@ +import { ScalingAutomaticStrategy } from '@/types/cloud/project/ai/app/ScalingAutomaticStrategy'; +import { ScalingFixedStrategy } from '@/types/cloud/project/ai/app/ScalingFixedStrategy'; + +/** AI Solutions App Status Object */ +export interface ScalingStrategy { + /** Strategy setting a variable number of replicas, based on an average resource usage threshold */ + automatic?: ScalingAutomaticStrategy; + /** Strategy setting a fix number of replicas */ + fixed?: ScalingFixedStrategy; +} diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/ScalingStrategyInput.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/ScalingStrategyInput.ts new file mode 100644 index 000000000000..1ec0c0c12b83 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/ScalingStrategyInput.ts @@ -0,0 +1,10 @@ +import { ScalingAutomaticStrategyInput } from '@/types/cloud/project/ai/app/ScalingAutomaticStrategyInput'; +import { ScalingFixedStrategyInput } from '@/types/cloud/project/ai/app/ScalingFixedStrategyInput'; + +/** AI Solutions App Status Object */ +export interface ScalingStrategyInput { + /** Strategy setting a variable number of replicas, based on an average resource usage threshold (conflicts with 'fixed' property when both are not null) */ + automatic?: ScalingAutomaticStrategyInput; + /** Strategy setting a fix number of replicas (conflicts with 'automatic' property when both are not null) */ + fixed?: ScalingFixedStrategyInput; +} diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/UpdateInput.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/UpdateInput.ts new file mode 100644 index 000000000000..65357e64681d --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/UpdateInput.ts @@ -0,0 +1,24 @@ +import { DeploymentStrategy } from '@/types/cloud/project/ai/app/DeploymentStrategy'; +import { Env } from '@/types/cloud/project/ai/Env'; + +/** AI Solutions AI App update object */ +export interface UpdateInput { + /** App command and arguments */ + command?: string[]; + /** Number of CPU resources requested (applies to CPU flavors) */ + cpu?: number; + /** Default port to access http service inside the app */ + defaultHttpPort?: number; + /** Deployment strategy to use when updating this AI App */ + deploymentStrategy?: DeploymentStrategy; + /** Environment variables to be patched (empty/null value to remove) */ + envVars?: Env[]; + /** App instance flavor */ + flavor?: string; + /** Number of GPU resources requested (applies to GPU flavors) */ + gpu?: number; + /** GRPC Port that we want to expose in case workload HTTP & gRPC servers cannot be multiplexed to listen on the same port */ + grpcPort?: number; + /** URL of the Docker image for this AI deployment */ + url?: string; +} diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/index.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/index.ts new file mode 100644 index 000000000000..3c700db26f15 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/app/index.ts @@ -0,0 +1,18 @@ +export * from './App'; +export * from './AppImageInput'; +export * from './AppSpec'; +export * from './AppSpecInput'; +export * from './AppStateEnum'; +export * from './AppStateHistory'; +export * from './AppStatus'; +export * from './DeploymentStrategy'; +export * from './Probe'; +export * from './ProbeInput'; +export * from './ScalingAutomaticStrategy'; +export * from './ScalingAutomaticStrategyInput'; +export * from './ScalingAutomaticStrategyResourceTypeEnum'; +export * from './ScalingFixedStrategy'; +export * from './ScalingFixedStrategyInput'; +export * from './ScalingStrategy'; +export * from './ScalingStrategyInput'; +export * from './UpdateInput'; diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/Features.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/Features.ts index c885628ed134..c6e2280ae41f 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/Features.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/Features.ts @@ -1,7 +1,7 @@ /** AI Solutions Features */ export interface Features { /** Inform if the AI Solutions is in Lab mode or not */ - lab?: boolean; + lab: boolean; /** Capability to add registry */ - registry?: boolean; + registry: boolean; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/Flavor.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/Flavor.ts index 20c1a7aada72..9eb661a7327d 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/Flavor.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/Flavor.ts @@ -5,17 +5,17 @@ import { FlavorTypeEnum } from '@/types/cloud/project/ai/capabilities/FlavorType /** AI Solutions Flavor */ export interface Flavor { /** Is the flavor the default one for a flavor type */ - default?: boolean; + default: boolean; /** Flavor description */ - description?: string; + description: string; /** Describe GPU information */ gpuInformation?: GpuInformation; /** Flavor id */ - id?: string; + id: string; /** Maximum amount available for a job / notebook */ - max?: number; + max: number; /** Describe the amount of resources given per unit of the flavor */ - resourcesPerUnit?: ResourcesPerUnit; + resourcesPerUnit: ResourcesPerUnit; /** Flavor type */ - type?: FlavorTypeEnum; + type: FlavorTypeEnum; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/Preset.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/Preset.ts index d739db22dbe9..4b3f5def24e9 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/Preset.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/Preset.ts @@ -6,21 +6,21 @@ import { PresetTypeEnum } from '@/types/cloud/project/ai/capabilities/PresetType /** AI Solutions Preset image */ export interface Preset { /** Preset capabilities */ - capabilities?: PresetCapabilities; + capabilities: PresetCapabilities; /** Preset description */ - descriptions?: string[]; + descriptions: string[]; /** URL toward the preset image documentation */ - docUrl?: PresetDocumentationUrl[]; + docUrl: PresetDocumentationUrl[]; /** Preset id */ - id?: string; + id: string; /** URL toward the logo to illustrate the preset */ - logoUrl?: string; + logoUrl: string; /** Preset name */ - name?: string; + name: string; /** Partner name */ - partner?: Partner; + partner: Partner; /** Snippet example of the doc */ - snippet?: string; + snippet: string; /** Preset type */ - type?: PresetTypeEnum; + type: PresetTypeEnum; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/PresetCapabilities.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/PresetCapabilities.ts index 5ff64d322797..318d92fec29d 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/PresetCapabilities.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/PresetCapabilities.ts @@ -4,15 +4,15 @@ import { PresetResources } from '@/types/cloud/project/ai/capabilities/PresetRes /** AI Solutions Preset image enabled features */ export interface PresetCapabilities { /** Exec enabled */ - exec?: boolean; + exec: boolean; /** Flavor types */ - flavorTypes?: FlavorTypeEnum[]; + flavorTypes: FlavorTypeEnum[]; /** Log enabled */ - log?: boolean; + log: boolean; /** Resources requirements */ - resources?: PresetResources; + resources: PresetResources; /** SSH enabled */ - ssh?: boolean; + ssh: boolean; /** Volume enabled */ - volume?: boolean; + volume: boolean; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/PresetDocumentationUrl.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/PresetDocumentationUrl.ts index 736120d86984..132430d7e668 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/PresetDocumentationUrl.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/PresetDocumentationUrl.ts @@ -1,7 +1,7 @@ /** AI Solutions Preset image */ export interface PresetDocumentationUrl { /** Documentation Name */ - name?: string; + name: string; /** Documentation URL */ - url?: string; + url: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/PresetResources.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/PresetResources.ts index 5954bc7373c0..91fe21d28f41 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/PresetResources.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/PresetResources.ts @@ -1,5 +1,5 @@ /** AI Solutions Preset resources requirements */ export interface PresetResources { /** Maximum number of GPUs supported */ - maxGpu?: number; + maxGpu: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/ProjectQuotas.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/ProjectQuotas.ts index 0749bd3019ec..07c2dab4c0ef 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/ProjectQuotas.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/ProjectQuotas.ts @@ -1,7 +1,7 @@ /** AI Solutions Project Quotas */ export interface ProjectQuotas { /** Project's quotas per compute-type resource (e.g CPU/GPU) */ - resources?: { [key: string]: number }; + resources: { [key: string]: number }; /** Storage quota (in bits) that is allocated to the project */ - storage?: number; + storage: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/Region.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/Region.ts index a4ff6f1c2fe5..697206f16313 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/Region.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/Region.ts @@ -1,13 +1,13 @@ /** AI Solutions Region */ export interface Region { /** Client Install Url */ - cliInstallUrl?: string; + cliInstallUrl: string; /** Documentation Url */ - documentationUrl?: string; + documentationUrl: string; /** Region id */ - id?: string; + id: string; /** Region Registry Url */ - registryUrl?: string; + registryUrl: string; /** Region version */ - version?: string; + version: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/app/Image.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/app/Image.ts index 6a2985a2efb4..36f822316355 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/app/Image.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/app/Image.ts @@ -3,21 +3,21 @@ import { LicensingTypeEnum } from '@/types/cloud/project/ai/capabilities/Licensi /** AI Solutions App image object */ export interface Image { /** Short description of the image */ - description?: string; + description: string; /** URL of the image documentation */ - docUrl?: string; + docUrl: string; /** Unique identifier of the image */ - id?: string; + id: string; /** Type of licensing */ - licensing?: LicensingTypeEnum; + licensing: LicensingTypeEnum; /** URL of the logo of the image */ - logoUrl?: string; + logoUrl: string; /** Name of the image */ - name?: string; + name: string; /** ID of the partner providing the image */ - partnerId?: string; + partnerId: string; /** Name of the partner providing the image */ - partnerName?: string; + partnerName: string; /** List of available versions of this image */ - versions?: string[]; + versions: string[]; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/flavor/GpuInformation.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/flavor/GpuInformation.ts index aab9f0fd2a1c..db489c957f6b 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/flavor/GpuInformation.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/flavor/GpuInformation.ts @@ -1,9 +1,9 @@ /** AI Solutions Global GPU information */ export interface GpuInformation { /** The GPU Brand */ - gpuBrand?: string; + gpuBrand: string; /** The GPU Memory in bits */ - gpuMemory?: number; + gpuMemory: number; /** The GPU Model */ - gpuModel?: string; + gpuModel: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/flavor/ResourcesPerUnit.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/flavor/ResourcesPerUnit.ts index 0a67f41fd258..7de885b5390e 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/flavor/ResourcesPerUnit.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/flavor/ResourcesPerUnit.ts @@ -1,13 +1,13 @@ /** AI Solutions Global Resource per flavor unit */ export interface ResourcesPerUnit { /** The amount of cpu for one unit of the flavor */ - cpu?: number; + cpu: number; /** The amount of ephemeral storage in bytes */ - ephemeralStorage?: number; + ephemeralStorage: number; /** The amount of memory in bytes */ - memory?: number; + memory: number; /** The guarantee private bandwidth in bytes per seconds */ - privateNetwork?: number; + privateNetwork: number; /** The guarantee public bandwidth in bytes per seconds */ - publicNetwork?: number; + publicNetwork: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/job/Image.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/job/Image.ts index 319a3f4cc8b8..dd42150163c3 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/job/Image.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/job/Image.ts @@ -1,15 +1,15 @@ /** AI Solutions Job image object */ export interface Image { /** Short description of the image */ - description?: string; + description: string; /** URL of the image documentation */ - docUrl?: string; + docUrl: string; /** Unique identifier of the image */ - id?: string; + id: string; /** URL of the logo of the image */ - logoUrl?: string; + logoUrl: string; /** Name of the image */ - name?: string; + name: string; /** List of available versions of this image */ - versions?: string[]; + versions: string[]; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/notebook/Editor.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/notebook/Editor.ts index d6dcc7d343c0..365ceee9bb59 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/notebook/Editor.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/notebook/Editor.ts @@ -1,15 +1,15 @@ /** AI Solutions Notebook editor object */ export interface Editor { /** Short description of the editor */ - description?: string; + description: string; /** URL of the editor documentation */ - docUrl?: string; + docUrl: string; /** Unique identifier of the editor */ - id?: string; + id: string; /** URL of the logo of the editor */ - logoUrl?: string; + logoUrl: string; /** Name of the editor */ - name?: string; + name: string; /** List of available versions of this editor */ - versions?: string[]; + versions: string[]; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/notebook/Framework.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/notebook/Framework.ts index 613be0f21bdb..41ce6b1e86bd 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/notebook/Framework.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/capabilities/notebook/Framework.ts @@ -1,17 +1,17 @@ /** AI Solutions Notebook framework object */ export interface Framework { /** Short description of the framework */ - description?: string; + description: string; /** URL of the framework documentation */ - docUrl?: string; + docUrl: string; /** Unique identifier of the framework */ - id?: string; + id: string; /** URL of the logo of the framework */ - logoUrl?: string; + logoUrl: string; /** Name of the framework */ - name?: string; + name: string; /** List of paths that are automatically saved */ savedPaths?: string[]; /** List of available versions of this framework */ - versions?: string[]; + versions: string[]; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/index.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/index.ts index 3ad43a4404be..68b4941282e1 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/index.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/index.ts @@ -1,6 +1,9 @@ +import exp from 'constants'; +import * as app from './app/index'; import * as capabilities from './capabilities/index'; import * as job from './job/index'; import * as notebook from './notebook/index'; +import * as partner from './partner/index'; import * as registry from './registry/index'; import * as token from './token/index'; import * as volume from './volume/index'; @@ -31,9 +34,11 @@ export * from './ShutdownStrategyEnum'; export * from './SshCredentialsInput'; export * from './TokenRoleEnum'; export * from './VolumePermissionEnum'; +export { app }; export { capabilities }; export { job }; export { notebook }; +export { partner }; export { registry }; export { token }; export { volume }; diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/job/Job.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/job/Job.ts index 5f193c3dc9a6..ed59d7c5e2b7 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/job/Job.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/job/Job.ts @@ -4,15 +4,15 @@ import { JobStatus } from '@/types/cloud/project/ai/job/JobStatus'; /** AI Solutions Job Object */ export interface Job { /** Job creation date */ - createdAt?: string; + createdAt: string; /** Job Id */ - id?: string; + id: string; /** Job specifications */ - spec?: JobSpec; + spec: JobSpec; /** Job status */ - status?: JobStatus; + status: JobStatus; /** Job update date */ - updatedAt?: string; + updatedAt: string; /** Job user owner */ - user?: string; + user: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/job/JobSpec.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/job/JobSpec.ts index fdc676a2d193..6bb4034f4c24 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/job/JobSpec.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/job/JobSpec.ts @@ -14,19 +14,19 @@ export interface JobSpec { /** GRPC Port that we want to expose in case workload HTTP & gRPC servers cannot be multiplexed to listen on the same port */ grpcPort?: number; /** Job image */ - image?: string; + image: string; /** Labels for the job */ labels?: { [key: string]: string }; /** Job name */ - name?: string; + name: string; /** Partner ID */ partnerId?: string; /** User ID to use to access the job */ readUser?: string; /** Host region of the job */ - region?: string; + region: string; /** Job resources */ - resources?: Resources; + resources: Resources; /** Shutdown strategy (if any) */ shutdown?: ShutdownStrategyEnum; /** SSH keys authorized to access to the job container */ diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/job/JobSpecInput.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/job/JobSpecInput.ts index ca07444ed78e..43ad38364178 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/job/JobSpecInput.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/job/JobSpecInput.ts @@ -6,23 +6,23 @@ import { Volume } from '@/types/cloud/project/ai/volume/Volume'; /** AI Solutions Job Spec Object to create a job */ export interface JobSpecInput { /** Job command */ - command: string[]; + command?: string[]; /** Port use as the default one to access http service inside job */ - defaultHttpPort: number; + defaultHttpPort?: number; /** List of environment variable to be set inside job */ - envVars: JobEnv[]; + envVars?: JobEnv[]; /** GRPC Port that we want to expose in case workload HTTP & gRPC servers cannot be multiplexed to listen on the same port */ - grpcPort: number; + grpcPort?: number; /** Job image */ image: string; /** Labels are used to scope tokens, labels prefixed by 'ovh/' are owned by the platform and overridden */ - labels: { [key: string]: string }; + labels?: { [key: string]: string }; /** Job name */ name: string; /** Partner ID */ - partnerId: string; + partnerId?: string; /** User ID to use to access the job */ - readUser: string; + readUser?: string; /** Host region of the job */ region: string; /** Job resources */ @@ -30,13 +30,13 @@ export interface JobSpecInput { /** Shutdown strategy (if any) */ shutdown?: ShutdownStrategyEnum; /** SSH keys authorized to access to the job container */ - sshPublicKeys: string[]; + sshPublicKeys?: string[]; /** Maximum time to spend before killing the job */ - timeout: number; + timeout?: number; /** Whether job is set to be restarted after timeout */ - timeoutAutoRestart: boolean; + timeoutAutoRestart?: boolean; /** Whether job api port can be accessed without any authentication token */ - unsecureHttp: boolean; + unsecureHttp?: boolean; /** Job Data linked */ - volumes: Volume[]; + volumes?: Volume[]; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/job/JobStatus.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/job/JobStatus.ts index 234870390bd5..efa523bc537d 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/job/JobStatus.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/job/JobStatus.ts @@ -8,7 +8,7 @@ import { VolumeStatus } from '@/types/cloud/project/ai/volume/VolumeStatus'; /** AI Solutions Job Status Object */ export interface JobStatus { /** Status about the datasync linked to the job */ - dataSync?: DataSync[]; + dataSync: DataSync[]; /** Duration of the job */ duration?: number; /** Exit code of the job */ @@ -20,9 +20,9 @@ export interface JobStatus { /** Address to reach when you want to access the Job's gRPC services */ grpcAddress?: string; /** Job state history */ - history?: JobStatusHistory[]; + history: JobStatusHistory[]; /** Information about the job */ - info?: Info; + info: Info; /** Job info url */ infoUrl?: string; /** Date when the job was initialized */ diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/job/JobStatusHistory.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/job/JobStatusHistory.ts index 17633ecb0ee7..e3580635fdb8 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/job/JobStatusHistory.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/job/JobStatusHistory.ts @@ -3,7 +3,7 @@ import { JobStateEnum } from '@/types/cloud/project/ai/job/JobStateEnum'; /** AI Solutions Job Status History Object */ export interface JobStatusHistory { /** Date when the status occurred */ - date?: string; + date: string; /** State of the job */ - state?: JobStateEnum; + state: JobStateEnum; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/job/Partner.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/job/Partner.ts index 2a9bfc125e5e..b3caea966c73 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/job/Partner.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/job/Partner.ts @@ -1,9 +1,9 @@ /** AI Solutions Partner Object */ export interface Partner { /** Partner flavor */ - flavor?: string; + flavor: string; /** Partner ID */ - id?: string; + id: string; /** Partner name */ - name?: string; + name: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/job/PresetImage.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/job/PresetImage.ts index 21c924042afd..4804f01659da 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/job/PresetImage.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/job/PresetImage.ts @@ -1,13 +1,13 @@ /** A Image of a preset data science image */ export interface PresetImage { /** Model Image Description */ - description?: string; + description: string; /** Image id */ - id?: string; + id: string; /** Link to the Opensource Model */ link?: string; /** Framework logo */ logo?: string; /** Model Image Name */ - name?: string; + name: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/Backup.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/Backup.ts index 93e7169ae791..b4ccd9eb2049 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/Backup.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/Backup.ts @@ -1,9 +1,9 @@ /** AI Solutions Platform Notebook Backup Object */ export interface Backup { /** Backup creation date */ - createdAt?: string; + createdAt: string; /** Backup Id */ - id?: string; + id: string; /** Backup last update date */ - updatedAt?: string; + updatedAt: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/Editor.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/Editor.ts index a51e74c264d9..21abfa5017dc 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/Editor.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/Editor.ts @@ -1,15 +1,15 @@ /** AI Solutions Data Object */ export interface Editor { /** Short description of the code editor */ - description?: string; + description: string; /** URL toward the code editor documentation */ - docUrl?: string; + docUrl: string; /** Unique identifier of the code editor */ - id?: string; + id: string; /** URL toward the logo to illustrate the editor */ - logoUrl?: string; + logoUrl: string; /** Name of the code editor */ - name?: string; + name: string; /** Version of the code editor */ - version?: string; + version: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/Framework.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/Framework.ts index 06a11a694a2e..fcba65b89726 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/Framework.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/Framework.ts @@ -1,15 +1,15 @@ /** AI Solutions Data Object */ export interface Framework { /** Short description of the framework */ - description?: string; + description: string; /** URL toward the framework documentation */ - docUrl?: string; + docUrl: string; /** Unique identifier of the framework */ - id?: string; + id: string; /** URL toward the logo to illustrate the framework */ - logoUrl?: string; + logoUrl: string; /** Name of the framework */ - name?: string; + name: string; /** Available versions for the framework (default is the first one) */ - versions?: string[]; + versions: string[]; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/Notebook.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/Notebook.ts index 97a68004cfb3..3001ac4ec446 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/Notebook.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/Notebook.ts @@ -4,15 +4,15 @@ import { NotebookStatus } from '@/types/cloud/project/ai/notebook/NotebookStatus /** AI Solutions Platform Notebook Object */ export interface Notebook { /** Notebook creation date */ - createdAt?: string; + createdAt: string; /** Notebook Id */ - id?: string; + id: string; /** Notebook spec */ - spec?: NotebookSpec; + spec: NotebookSpec; /** Notebook Container Status */ - status?: NotebookStatus; + status: NotebookStatus; /** Notebook last update date */ - updatedAt?: string; + updatedAt: string; /** Notebook user owner */ - user?: string; + user: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/NotebookEnv.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/NotebookEnv.ts index a7bba89d5de5..e34b8233d6f7 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/NotebookEnv.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/NotebookEnv.ts @@ -5,5 +5,5 @@ export interface NotebookEnv { /** Framework name */ frameworkId: string; /** Framework version to use */ - frameworkVersion: string; + frameworkVersion?: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/NotebookSpec.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/NotebookSpec.ts index 81859678f73c..8a998a9704fa 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/NotebookSpec.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/NotebookSpec.ts @@ -7,19 +7,19 @@ import { Volume } from '@/types/cloud/project/ai/volume/Volume'; /** AI Solutions Notebook Spec Object to create a notebook */ export interface NotebookSpec { /** Environment to deploy in this notebook */ - env?: NotebookEnv; + env: NotebookEnv; /** List of environment variables to be set inside the notebook */ - envVars?: JobEnv[]; + envVars: JobEnv[]; /** Current notebook flavor */ flavor?: string; /** Labels for the notebook */ labels?: { [key: string]: string }; /** Notebook name */ - name?: string; + name: string; /** Host region of the notebook */ - region?: string; + region: string; /** Notebook resources */ - resources?: Resources; + resources: Resources; /** Shutdown strategy (if any) */ shutdown?: ShutdownStrategyEnum; /** SSH keys authorized to access the notebook */ diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/NotebookSpecInput.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/NotebookSpecInput.ts index 2b1e7f6dea80..ed5a7afde0b5 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/NotebookSpecInput.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/NotebookSpecInput.ts @@ -9,9 +9,9 @@ export interface NotebookSpecInput { /** Environment to deploy in this notebook */ env: NotebookEnv; /** List of environment variables to be set inside the notebook */ - envVars: JobEnv[]; + envVars?: JobEnv[]; /** Labels are used to scope tokens, labels prefixed by 'ovh/' are owned by the platform and overridden */ - labels: { [key: string]: string }; + labels?: { [key: string]: string }; /** Notebook name */ name: string; /** Host region of the notebook */ @@ -21,11 +21,11 @@ export interface NotebookSpecInput { /** Shutdown strategy (if any) */ shutdown?: ShutdownStrategyEnum; /** SSH keys authorized to access the notebook */ - sshPublicKeys: string[]; + sshPublicKeys?: string[]; /** Whether notebook is set to be restarted after timeout */ - timeoutAutoRestart: boolean; + timeoutAutoRestart?: boolean; /** Whether notebook api port can be accessed without any authentication token */ - unsecureHttp: boolean; + unsecureHttp?: boolean; /** Notebook Data linked */ - volumes: Volume[]; + volumes?: Volume[]; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/NotebookStatus.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/NotebookStatus.ts index ef40c2fac682..f8ebcdf26752 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/NotebookStatus.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/NotebookStatus.ts @@ -8,17 +8,17 @@ import { NotebookWorkspace } from '@/types/cloud/project/ai/notebook/NotebookWor /** AI Solutions Notebook Status Object */ export interface NotebookStatus { /** Status about the datasync linked to the job */ - dataSync?: DataSync[]; + dataSync: DataSync[]; /** Duration of the notebook in seconds */ duration?: number; /** Address to reach when you want to access the Notebook's gRPC services */ grpcAddress?: string; /** Information about the notebook */ - info?: Info; + info: Info; /** Notebook info url */ infoUrl?: string; /** Status for the last job run */ - lastJobStatus?: JobStatus; + lastJobStatus: JobStatus; /** Date when the notebook was last started */ lastStartedAt?: string; /** Date when the notebook was last stopped */ diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/NotebookUpdate.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/NotebookUpdate.ts index 716158c527b3..5180d9a89eb8 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/NotebookUpdate.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/NotebookUpdate.ts @@ -4,15 +4,15 @@ import { Volume } from '@/types/cloud/project/ai/volume/Volume'; /** AI Solutions Notebook Spec Object to update a notebook */ export interface NotebookUpdate { /** Labels for the notebook */ - labels: { [key: string]: string }; + labels?: { [key: string]: string }; /** Notebook resources */ - resources: ResourcesInput; + resources?: ResourcesInput; /** SSH keys authorized to access the notebook */ - sshPublicKeys: string[]; + sshPublicKeys?: string[]; /** Whether notebook is set to be restarted after timeout */ - timeoutAutoRestart: boolean; + timeoutAutoRestart?: boolean; /** Whether notebook api port can be accessed without any authentication token */ - unsecureHttp: boolean; + unsecureHttp?: boolean; /** Notebook Data linked */ - volumes: Volume[]; + volumes?: Volume[]; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/NotebookWorkspace.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/NotebookWorkspace.ts index 32052f5fa334..8fb8d28cdff8 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/NotebookWorkspace.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/notebook/NotebookWorkspace.ts @@ -1,7 +1,7 @@ /** AI Solutions Notebook Workspace Object */ export interface NotebookWorkspace { /** The number of storage bytes free of charges for notebook workspace */ - storageFree?: number; + storageFree: number; /** The number of storage bytes currently used to persist notebook workspace */ - storageUsed?: number; + storageUsed: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/partner/Contract.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/partner/Contract.ts new file mode 100644 index 000000000000..9f27ab6400fd --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/partner/Contract.ts @@ -0,0 +1,9 @@ +import { ContractTermsLocale } from '@/types/cloud/project/ai/partner/ContractTermsLocale'; + +/** Representation of a partner's contract with logged in user's tenant */ +export interface Contract { + /** Contract signature date for the logged in user's tenant */ + signedAt?: string; + /** Map of terms of service details per locale */ + termsOfService: { [key: string]: ContractTermsLocale }; +} diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/partner/ContractTermsLocale.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/partner/ContractTermsLocale.ts new file mode 100644 index 000000000000..4eda398874ae --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/partner/ContractTermsLocale.ts @@ -0,0 +1,5 @@ +/** Representation of a partner's contract on a given language */ +export interface ContractTermsLocale { + /** Contract file URL for a given language */ + url: string; +} diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/partner/Partner.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/partner/Partner.ts new file mode 100644 index 000000000000..7673c2de730a --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/partner/Partner.ts @@ -0,0 +1,15 @@ +import { Contract } from '@/types/cloud/project/ai/partner/Contract'; + +/** Representation of a partner */ +export interface Partner { + /** Partner contract with logged in user's tenant */ + contract?: Contract; + /** Partner creation date */ + createdAt: string; + /** Partner Description */ + description: string; + /** Partner Id */ + id: string; + /** Partner Name */ + name: string; +} diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/partner/index.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/partner/index.ts new file mode 100644 index 000000000000..5044aa8147c7 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/partner/index.ts @@ -0,0 +1,3 @@ +export * from './Contract'; +export * from './ContractTermsLocale'; +export * from './Partner'; diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/registry/Registry.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/registry/Registry.ts index fc1baf63aa24..f5abce26cdd4 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/registry/Registry.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/registry/Registry.ts @@ -1,19 +1,19 @@ /** Representation of a registry */ export interface Registry { /** Registry creation date */ - createdAt?: string; + createdAt: string; /** Registry Id */ - id?: string; + id: string; /** Docker registry password */ - password: string; + password?: string; /** Region where the registry is available */ region: string; /** Registry update date */ - updatedAt?: string; + updatedAt: string; /** Docker registry URL */ - url: string; + url?: string; /** Registry user creator */ - user?: string; + user: string; /** Docker registry username */ - username: string; + username?: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/registry/RegistryUpdateInput.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/registry/RegistryUpdateInput.ts index 7071c0491f21..0a822c485faf 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/registry/RegistryUpdateInput.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/registry/RegistryUpdateInput.ts @@ -1,9 +1,9 @@ /** Docker registry update object */ export interface RegistryUpdateInput { /** Docker registry password */ - password: string; + password?: string; /** Docker registry URL */ - url: string; + url?: string; /** Docker registry username */ - username: string; + username?: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/token/Token.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/token/Token.ts index 871e9e0c36c5..6565ef761285 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/token/Token.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/token/Token.ts @@ -4,13 +4,13 @@ import { TokenStatus } from '@/types/cloud/project/ai/token/TokenStatus'; /** AI Solutions Application Token */ export interface Token { /** Application token creation date */ - createdAt?: string; + createdAt: string; /** Application token Id */ - id?: string; + id: string; /** Application token spec */ - spec?: TokenSpec; + spec: TokenSpec; /** Application token status */ - status?: TokenStatus; + status: TokenStatus; /** Application token update date */ - updatedAt?: string; + updatedAt: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/token/TokenSpec.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/token/TokenSpec.ts index b661acd6df8c..ef6b7a49cad1 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/token/TokenSpec.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/token/TokenSpec.ts @@ -3,7 +3,7 @@ import { TokenRoleEnum } from '@/types/cloud/project/ai/TokenRoleEnum'; /** AI Solutions Application Token Spec Object to create a notebook */ export interface TokenSpec { /** Application token label selector */ - labelSelector: string; + labelSelector?: string; /** Application token name */ name: string; /** Public Cloud Storage Region */ diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/token/TokenStatus.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/token/TokenStatus.ts index bc5459a711bd..6deb641e1a2e 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/token/TokenStatus.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/token/TokenStatus.ts @@ -3,5 +3,5 @@ export interface TokenStatus { /** Application token value to use as a Bearer */ value?: string; /** Application token version */ - version?: number; + version: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/DataSync.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/DataSync.ts index 6f45121dd6db..abe664c302a8 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/DataSync.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/DataSync.ts @@ -4,13 +4,13 @@ import { DataSyncStatus } from '@/types/cloud/project/ai/volume/DataSyncStatus'; /** AI Solutions Data Sync */ export interface DataSync { /** Data Sync creation date */ - createdAt?: string; + createdAt: string; /** Data Sync Id */ - id?: string; + id: string; /** Data Sync specifications */ - spec?: DataSyncSpec; + spec: DataSyncSpec; /** Data Sync status */ - status?: DataSyncStatus; + status: DataSyncStatus; /** Data Sync update date */ - updatedAt?: string; + updatedAt: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/DataSyncSpec.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/DataSyncSpec.ts index 2db2dffa05e2..5b9b47b3088b 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/DataSyncSpec.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/DataSyncSpec.ts @@ -7,5 +7,5 @@ export interface DataSyncSpec { /** True if the user has created the object */ manual?: boolean; /** Only sync this volume */ - volume: string; + volume?: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/DataSyncStatus.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/DataSyncStatus.ts index 9413d2c1a28d..234d4a02574e 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/DataSyncStatus.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/DataSyncStatus.ts @@ -7,13 +7,13 @@ export interface DataSyncStatus { /** Date when the data sync ended */ endedAt?: string; /** Information about the data sync */ - info?: Info; + info: Info; /** Progress status of the data sync */ - progress?: Progress[]; + progress: Progress[]; /** Date when the data sync was queued */ - queuedAt?: string; + queuedAt: string; /** Date when the data sync was started */ startedAt?: string; /** State of the data sync */ - state?: DataSyncStateEnum; + state: DataSyncStateEnum; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/PrivateSwift.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/PrivateSwift.ts deleted file mode 100644 index 50312741bb3f..000000000000 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/PrivateSwift.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** AI Solutions private Swift container Volume Object. Deprecated: Use DataStore instead */ -export interface PrivateSwift { - /** Name of the tar archive that needs to be saved */ - archive: string; - /** Public Cloud Storage container to attach */ - container: string; - /** True if data is stored on OVHcloud AI's internal storage */ - internal?: boolean; - /** Prefix to fetch only part of the volume */ - prefix: string; - /** Public Cloud Storage Region */ - region: string; -} diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/Progress.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/Progress.ts index b9b76eddcdc4..3b63eb91d0cc 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/Progress.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/Progress.ts @@ -4,31 +4,31 @@ import { DataSyncProgressStateEnum } from '@/types/cloud/project/ai/volume/DataS /** AI Solutions Progress Object */ export interface Progress { /** Number of completed files */ - completed?: number; + completed: number; /** Progress creation date */ - createdAt?: string; + createdAt: string; /** Number of deleted files */ - deleted?: number; + deleted: number; /** Direction of the progress sync */ - direction?: DataSyncEnum; - /** ETA to finish in seconds. Deprecated */ + direction: DataSyncEnum; + /** @deprecated ETA to finish in seconds. Deprecated */ eta?: number; /** Number of failed files */ - failed?: number; + failed: number; /** Progress Id */ - id?: string; + id: string; /** Volume information */ - info?: string; + info: string; /** Number of processed files */ - processed?: number; + processed: number; /** Number of skipped files */ - skipped?: number; + skipped: number; /** State of the progress sync */ - state?: DataSyncProgressStateEnum; + state: DataSyncProgressStateEnum; /** Total number of files */ - total?: number; + total: number; /** Transferred size in bytes */ - transferredBytes?: number; + transferredBytes: number; /** Progress update date */ - updatedAt?: string; + updatedAt: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/Standalone.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/Standalone.ts index 159bcecce3d5..75bff343c18e 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/Standalone.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/Standalone.ts @@ -1,5 +1,5 @@ /** AI Solutions No Source Volume Object */ export interface Standalone { /** Name of the volume */ - name: string; + name?: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/Volume.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/Volume.ts index 3f38098a0341..5d2e36ca16b8 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/Volume.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/Volume.ts @@ -1,6 +1,5 @@ import { DataStore } from '@/types/cloud/project/ai/volume/DataStore'; import { VolumePermissionEnum } from '@/types/cloud/project/ai/VolumePermissionEnum'; -import { PrivateSwift } from '@/types/cloud/project/ai/volume/PrivateSwift'; import { PublicGit } from '@/types/cloud/project/ai/volume/PublicGit'; import { PublicSwift } from '@/types/cloud/project/ai/volume/PublicSwift'; import { Standalone } from '@/types/cloud/project/ai/volume/Standalone'; @@ -13,9 +12,9 @@ export interface Volume { cache: boolean; /** Public Cloud Storage container to attach */ container?: string; - /** Volume details for data store containers. Deprecated: Use volumeSource.dataStore instead */ - dataStore: DataStore; - /** Volume Id. Deprecated: moved to status.volumes[] */ + /** @deprecated Volume details for data store containers. Deprecated: Use volumeSource.dataStore instead */ + dataStore?: DataStore; + /** @deprecated Volume Id. Deprecated: moved to status.volumes[] */ id?: string; /** Path where to mount the data inside the container */ mountPath: string; @@ -23,20 +22,16 @@ export interface Volume { permission: VolumePermissionEnum; /** Prefix to fetch only part of the volume */ prefix?: string; - /** Volume details for private swift containers. Deprecated: Use volumeSource.dataStore instead */ - privateSwift?: PrivateSwift; - /** Volume details for public git repositories. Deprecated: Use volumeSource.publicGit instead */ + /** @deprecated Volume details for public git repositories. Deprecated: Use volumeSource.publicGit instead */ publicGit?: PublicGit; - /** Volume details for public swift containers. Deprecated: Use volumeSource.publicSwift instead */ + /** @deprecated Volume details for public swift containers. Deprecated: Use volumeSource.publicSwift instead */ publicSwift?: PublicSwift; /** Public Cloud Storage Region */ region?: string; - /** Volume details for volumes that do not have a datasource. Deprecated: Use volumeSource.standalone instead */ + /** @deprecated Volume details for volumes that do not have a datasource. Deprecated: Use volumeSource.standalone instead */ standalone?: Standalone; - /** Target volume details for data store containers. Deprecated: Use volumeTarget.targetDataStore instead */ + /** @deprecated Target volume details for data store containers. Deprecated: Use volumeTarget.targetDataStore instead */ targetDataStore?: DataStore; - /** Target volume details for private swift containers. Deprecated: Use volumeTarget.targetDataStore instead */ - targetPrivateSwift?: PrivateSwift; /** Source volume details */ volumeSource?: VolumeSource; /** Target volume details */ diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/VolumeSource.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/VolumeSource.ts index 35f7e9e73a42..b9a5887769e1 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/VolumeSource.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/VolumeSource.ts @@ -6,11 +6,11 @@ import { Standalone } from '@/types/cloud/project/ai/volume/Standalone'; /** AI Solutions VolumeSource Object. Describes a source (object store) volume */ export interface VolumeSource { /** Volume details for data store containers */ - dataStore: DataStore; + dataStore?: DataStore; /** Volume details for public git repositories */ - publicGit: PublicGit; + publicGit?: PublicGit; /** Volume details for public swift containers */ - publicSwift: PublicSwift; + publicSwift?: PublicSwift; /** Volume details for volumes that do not have a datasource */ - standalone: Standalone; + standalone?: Standalone; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/VolumeStatus.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/VolumeStatus.ts index dfe4269b3fbb..67d2425487e0 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/VolumeStatus.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/VolumeStatus.ts @@ -1,9 +1,9 @@ /** AI Solutions Volume Object */ export interface VolumeStatus { /** Volume Id */ - id?: string; + id: string; /** Path where the data is mounted inside the container */ - mountPath?: string; + mountPath: string; /** User volume Id */ - userVolumeId?: string; + userVolumeId: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/VolumeTarget.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/VolumeTarget.ts index a4fbee0da548..0138dc0cbfec 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/VolumeTarget.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/VolumeTarget.ts @@ -3,5 +3,5 @@ import { DataStore } from '@/types/cloud/project/ai/volume/DataStore'; /** AI Solutions VolumeTarget Object. Describes a target (object store) volume */ export interface VolumeTarget { /** Volume details for data store containers */ - targetDataStore: DataStore; + targetDataStore?: DataStore; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/index.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/index.ts index 150dae09e133..fc7ef1f35a11 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/index.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/project/ai/volume/index.ts @@ -5,7 +5,6 @@ export * from './DataSyncProgressStateEnum'; export * from './DataSyncSpec'; export * from './DataSyncStateEnum'; export * from './DataSyncStatus'; -export * from './PrivateSwift'; export * from './Progress'; export * from './PublicGit'; export * from './PublicSwift'; diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/role/Permission.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/role/Permission.ts index ac99cd5dda92..3314c5143e7a 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/role/Permission.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/role/Permission.ts @@ -1,7 +1,7 @@ /** Role permissions */ export interface Permission { /** Permission label */ - label?: string; + label: string; /** Roles having this permission */ - roles?: string[]; + roles: string[]; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/role/Role.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/role/Role.ts index 7f3d92f1e19f..777b5ada454b 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/role/Role.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/role/Role.ts @@ -1,11 +1,11 @@ /** Role */ export interface Role { /** Role Description */ - description?: string; + description: string; /** Role id */ - id?: string; + id: string; /** Role Name */ - name?: string; + name: string; /** Permissions granted by this role */ - permissions?: string[]; + permissions: string[]; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/role/Roles.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/role/Roles.ts index ebcf9cbdd390..8b8c3deeb073 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/role/Roles.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/role/Roles.ts @@ -4,7 +4,7 @@ import { Service } from '@/types/cloud/role/Service'; /** OpenStack role */ export interface Roles { /** OpenStack roles */ - roles?: Role[]; + roles: Role[]; /** OpenStack services */ - services?: Service[]; + services: Service[]; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/role/Service.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/role/Service.ts index 64ebdc56a687..951181f24aaf 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/role/Service.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/role/Service.ts @@ -3,7 +3,7 @@ import { Permission } from '@/types/cloud/role/Permission'; /** OpenStack service */ export interface Service { /** Name of the service */ - name?: string; + name: string; /** List of permissions */ - permissions?: Permission[]; + permissions: Permission[]; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/sshkey/SshKey.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/sshkey/SshKey.ts index 55920aa582f7..7e6514a676ad 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/sshkey/SshKey.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/sshkey/SshKey.ts @@ -3,9 +3,9 @@ export interface SshKey { /** SSH key id */ id?: string; /** SSH key name */ - name?: string; + name: string; /** SSH public key */ - publicKey?: string; + publicKey: string; /** SSH key regions */ regions?: string[]; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/sshkey/SshKeyDetail.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/sshkey/SshKeyDetail.ts index 6d764b294f82..143c3ef18b77 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/sshkey/SshKeyDetail.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/sshkey/SshKeyDetail.ts @@ -1,13 +1,13 @@ /** SshKeyDetail */ export interface SshKeyDetail { /** SSH key fingerprint */ - fingerPrint?: string; + fingerPrint: string; /** SSH key id */ - id?: string; + id: string; /** SSH key name */ - name?: string; + name: string; /** SSH public key */ - publicKey?: string; + publicKey: string; /** SSH key regions */ - regions?: string[]; + regions: string[]; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/ArchiveColdArchiveContainer.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/ArchiveColdArchiveContainer.ts index a9b265f3c931..8a0359964155 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/ArchiveColdArchiveContainer.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/ArchiveColdArchiveContainer.ts @@ -1,5 +1,5 @@ /** Archive a ColdArchiveContainer */ export interface ArchiveColdArchiveContainer { /** Archive is locked (cannot be deleted) for the given number of days */ - lockedUntilDays: number; + lockedUntilDays?: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/Container.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/Container.ts index 9908930fb60d..fde1d9f32027 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/Container.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/Container.ts @@ -7,13 +7,13 @@ export interface Container { /** Container type */ containerType?: TypeEnum; /** Storage id */ - id?: string; + id: string; /** Storage name */ - name?: string; + name: string; /** */ - region?: string; + region: string; /** Total bytes stored */ - storedBytes?: number; + storedBytes: number; /** Total objects stored */ - storedObjects?: number; + storedObjects: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/ContainerAccess.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/ContainerAccess.ts index 97320ef83db0..5debeaf3b248 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/ContainerAccess.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/ContainerAccess.ts @@ -3,7 +3,7 @@ import { Endpoint } from '@/types/cloud/storage/Endpoint'; /** ContainerAccess */ export interface ContainerAccess { /** Storage access endpoints */ - endpoints?: Endpoint[]; + endpoints: Endpoint[]; /** Storage access token */ - token?: string; + token: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/ContainerDetail.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/ContainerDetail.ts index 85be23a3ca1f..97b35d81fc01 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/ContainerDetail.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/ContainerDetail.ts @@ -4,23 +4,23 @@ import { ContainerObject } from '@/types/cloud/storage/ContainerObject'; /** ContainerDetail */ export interface ContainerDetail { /** Whether this is an archive container or not */ - archive?: boolean; + archive: boolean; /** Container type */ - containerType?: TypeEnum; + containerType: TypeEnum; /** Origins allowed to make Cross Origin Requests */ - cors?: string[]; + cors: string[]; /** Container name */ - name?: string; + name: string; /** Objects stored in container */ - objects?: ContainerObject[]; - /** Public container (DEPRECATED: see containerType) */ - public?: boolean; + objects: ContainerObject[]; + /** @deprecated Public container (DEPRECATED: see containerType) */ + public: boolean; /** Container region */ - region?: string; + region: string; /** Container static URL */ - staticUrl?: string; + staticUrl: string; /** Total bytes stored */ - storedBytes?: number; + storedBytes: number; /** Total objects stored */ - storedObjects?: number; + storedObjects: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/ContainerObject.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/ContainerObject.ts index 12f7b480ea72..3f9e078e1a32 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/ContainerObject.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/ContainerObject.ts @@ -3,15 +3,15 @@ import { RetrievalStateEnum } from '@/types/cloud/storage/RetrievalStateEnum'; /** ContainerObject */ export interface ContainerObject { /** Object content type */ - contentType?: string; + contentType: string; /** Last modification date */ - lastModified?: string; + lastModified: string; /** Object name */ - name?: string; + name: string; /** Object retrieval delay (when unsealing) */ - retrievalDelay?: number; + retrievalDelay: number; /** Object retrieval state */ - retrievalState?: RetrievalStateEnum; + retrievalState: RetrievalStateEnum; /** Object size */ - size?: number; + size: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/ContainerObjectTempURL.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/ContainerObjectTempURL.ts index 8cb2ef223f15..b290d42e844b 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/ContainerObjectTempURL.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/ContainerObjectTempURL.ts @@ -1,7 +1,7 @@ /** ContainerObjectTempURL */ export interface ContainerObjectTempURL { /** Temporary URL expiration date */ - expirationDate?: string; + expirationDate: string; /** Temporary URL to get object */ - getURL?: string; + getURL: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/Endpoint.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/Endpoint.ts index a9ac99c4dc30..f65edfb08100 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/Endpoint.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/Endpoint.ts @@ -1,7 +1,7 @@ /** Endpoint */ export interface Endpoint { /** Endpoint region */ - region?: string; + region: string; /** Endpoint URL */ - url?: string; + url: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/PresignedURL.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/PresignedURL.ts index 6352a180b3af..f4e1f5c2f989 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/PresignedURL.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/PresignedURL.ts @@ -3,9 +3,9 @@ import { PresignedURLMethodEnum } from '@/types/cloud/storage/PresignedURLMethod /** Presigned URL */ export interface PresignedURL { /** Presigned URL method */ - method?: PresignedURLMethodEnum; + method: PresignedURLMethodEnum; /** Signed headers */ - signedHeaders?: { [key: string]: string }; + signedHeaders: { [key: string]: string }; /** Presigned URL */ - url?: string; + url: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/Quota.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/Quota.ts index dd1fc1f2e434..6e4d852c4bcd 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/Quota.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/Quota.ts @@ -1,7 +1,7 @@ /** Cloud Storage Quota */ export interface Quota { /** Current number of buckets */ - buckets?: number; + buckets: number; /** Maximum number of buckets */ - maxBuckets?: number; + maxBuckets: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/ReplicationRule.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/ReplicationRule.ts new file mode 100644 index 000000000000..a6a8fb2d7d1a --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/ReplicationRule.ts @@ -0,0 +1,9 @@ +import { ReplicationRuleStatusEnum } from '@/types/cloud/storage/ReplicationRuleStatusEnum'; + +/** Object Storage replication configuration rule */ +export interface ReplicationRule { + /** Rule ID */ + id: string; + /** Rule status */ + status: ReplicationRuleStatusEnum; +} diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/ReplicationRuleStatusEnum.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/ReplicationRuleStatusEnum.ts new file mode 100644 index 000000000000..b381278f1d17 --- /dev/null +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/ReplicationRuleStatusEnum.ts @@ -0,0 +1,5 @@ +/** Replication rule status */ +export enum ReplicationRuleStatusEnum { + 'disabled' = 'disabled', + 'enabled' = 'enabled', +} diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/index.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/index.ts index be64eda7dfcc..26382f69826f 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/index.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/storage/index.ts @@ -13,6 +13,8 @@ export * from './PresignedURL'; export * from './PresignedURLInput'; export * from './PresignedURLMethodEnum'; export * from './Quota'; +export * from './ReplicationRule'; +export * from './ReplicationRuleStatusEnum'; export * from './RetrievalStateEnum'; export * from './RightEnum'; export * from './StorageClassEnum'; diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/usage/Period.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/usage/Period.ts index f8b2c7016f2a..b08142f5585d 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/usage/Period.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/usage/Period.ts @@ -1,7 +1,7 @@ /** Period */ export interface Period { /** Usage from */ - from?: string; + from: string; /** Usage to */ - to?: string; + to: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/usage/UsageBill.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/usage/UsageBill.ts index 6c748c9e0972..2eb91f0446b1 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/usage/UsageBill.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/usage/UsageBill.ts @@ -3,13 +3,13 @@ import { PaymentTypeEnum } from '@/types/cloud/usage/PaymentTypeEnum'; /** UsageBill */ export interface UsageBill { /** ID of the bill */ - bill_id?: string; + bill_id: string; /** Amount of credits used in this bill (not necessarily on part) */ - credit?: number; + credit: number; /** Amount of the bill that accounts for services for the usage period, credits not taken into account */ - part?: number; + part: number; /** Payment type */ - payment_type?: PaymentTypeEnum; + payment_type: PaymentTypeEnum; /** Total amount of the bill, credits not taken into account */ - total?: number; + total: number; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/usage/UsageCurrent.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/usage/UsageCurrent.ts index b41891cf927b..cd9ff62d1af9 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/usage/UsageCurrent.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/usage/UsageCurrent.ts @@ -8,11 +8,11 @@ export interface UsageCurrent { /** Hourly usage */ hourlyUsage?: HourlyResources; /** Entry last update */ - lastUpdate?: string; + lastUpdate: string; /** Monthly usage */ monthlyUsage?: MonthlyResources; /** Usage dates (from/to) */ - period?: Period; + period: Period; /** Resource usage (billed per hour/minute/second/unit) */ resourcesUsage?: TypedResources[]; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/usage/UsageCurrentBills.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/usage/UsageCurrentBills.ts index f73025f12435..825784bc7217 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/usage/UsageCurrentBills.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/usage/UsageCurrentBills.ts @@ -3,5 +3,5 @@ import { UsageBill } from '@/types/cloud/usage/UsageBill'; /** UsageCurrentBills */ export interface UsageCurrentBills { /** Bills related to the current usage */ - bills?: UsageBill[]; + bills: UsageBill[]; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/usage/UsageForecast.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/usage/UsageForecast.ts index eb138214342d..6aef801e989b 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/usage/UsageForecast.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/usage/UsageForecast.ts @@ -9,11 +9,11 @@ export interface UsageForecast { /** Hourly forecast */ hourlyUsage?: HourlyResources; /** Entry last update */ - lastUpdate?: string; + lastUpdate: string; /** Monthly forecast */ monthlyUsage?: MonthlyResources; /** Forecast dates (from/to) */ - period?: Period; + period: Period; /** Resource usage forecast (billed per hour/minute/second/unit) */ resourcesUsage?: TypedResources[]; /** Usable credit to pay next bill */ diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/usage/UsageHistory.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/usage/UsageHistory.ts index 8c486d2fdc10..6234ff0d0a56 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/usage/UsageHistory.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/usage/UsageHistory.ts @@ -3,9 +3,9 @@ import { Period } from '@/types/cloud/usage/Period'; /** UsageHistory */ export interface UsageHistory { /** Usage id */ - id?: string; + id: string; /** Entry last update */ - lastUpdate?: string; + lastUpdate: string; /** Usage dates (from/to) */ - period?: Period; + period: Period; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/usage/UsageHistoryDetail.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/usage/UsageHistoryDetail.ts index 04a147b6ec49..594fb658de2d 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/usage/UsageHistoryDetail.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/usage/UsageHistoryDetail.ts @@ -8,13 +8,13 @@ export interface UsageHistoryDetail { /** Hourly usage */ hourlyUsage?: HourlyResources; /** Usage id */ - id?: string; + id: string; /** Entry last update */ - lastUpdate?: string; + lastUpdate: string; /** Monthly usage */ monthlyUsage?: MonthlyResources; /** Usage dates (from/to) */ - period?: Period; + period: Period; /** Resource usage (billed per hour/minute/second/unit) */ resourcesUsage?: TypedResources[]; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/usage/UsageHistoryDetailBills.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/usage/UsageHistoryDetailBills.ts index ee6d49c8367b..4b2e060428d3 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/usage/UsageHistoryDetailBills.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/usage/UsageHistoryDetailBills.ts @@ -3,5 +3,5 @@ import { UsageBill } from '@/types/cloud/usage/UsageBill'; /** UsageHistoryDetailBills */ export interface UsageHistoryDetailBills { /** Bills related to the usage */ - bills?: UsageBill[]; + bills: UsageBill[]; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/Configuration.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/Configuration.ts index a4f403d62f00..a79467bb1f5f 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/Configuration.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/Configuration.ts @@ -1,5 +1,5 @@ /** Client Cloud Configuration */ export interface Configuration { /** Client configuration */ - content?: string; + content: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/Openrc.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/Openrc.ts index c668a84bc9b7..457f9d934533 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/Openrc.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/Openrc.ts @@ -1,5 +1,5 @@ /** Openrc */ export interface Openrc { /** openrc file */ - content?: string; + content: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/Rclone.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/Rclone.ts index ebc18766c048..26720b7387af 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/Rclone.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/Rclone.ts @@ -1,5 +1,5 @@ /** Rclone */ export interface Rclone { /** rclone configuration file */ - content?: string; + content: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/RoleEnum.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/RoleEnum.ts index 88d4831531a7..d7264fc83850 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/RoleEnum.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/RoleEnum.ts @@ -9,6 +9,9 @@ export enum RoleEnum { 'compute_operator' = 'compute_operator', 'image_operator' = 'image_operator', 'infrastructure_supervisor' = 'infrastructure_supervisor', + 'key-manager_operator' = 'key-manager_operator', + 'key-manager_read' = 'key-manager_read', + 'load-balancer_operator' = 'load-balancer_operator', 'network_operator' = 'network_operator', 'network_security_operator' = 'network_security_operator', 'objectstore_operator' = 'objectstore_operator', diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/S3Credentials.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/S3Credentials.ts index ebef8c12d472..ba6ceff72a42 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/S3Credentials.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/S3Credentials.ts @@ -1,9 +1,9 @@ /** S3Credentials */ export interface S3Credentials { /** S3 Access key */ - access?: string; + access: string; /** Tenant id */ - tenantId?: string; + tenantId: string; /** User id */ - userId?: string; + userId: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/S3CredentialsSecretOnly.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/S3CredentialsSecretOnly.ts index 00c0985adb57..821eab8b9d21 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/S3CredentialsSecretOnly.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/S3CredentialsSecretOnly.ts @@ -1,5 +1,5 @@ /** S3CredentialsSecretOnly */ export interface S3CredentialsSecretOnly { /** S3 Access key secret */ - secret?: string; + secret: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/S3CredentialsWithSecret.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/S3CredentialsWithSecret.ts index cc500c338466..8a728c3311c4 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/S3CredentialsWithSecret.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/S3CredentialsWithSecret.ts @@ -1,11 +1,11 @@ /** S3CredentialsWithSecret */ export interface S3CredentialsWithSecret { /** S3 Access key */ - access?: string; + access: string; /** S3 Access key secret */ - secret?: string; + secret: string; /** Tenant id */ - tenantId?: string; + tenantId: string; /** User id */ - userId?: string; + userId: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/User.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/User.ts index 15e051293366..0c8d68f3ba0e 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/User.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/User.ts @@ -4,17 +4,17 @@ import { UserStatusEnum } from '@/types/cloud/user/UserStatusEnum'; /** User */ export interface User { /** User creation date */ - creationDate?: string; + creationDate: string; /** User description */ - description?: string; + description: string; /** User id */ - id?: number; + id: number; /** User id on openstack */ openstackId?: string; /** User roles */ - roles?: Role[]; + roles: Role[]; /** User status */ - status?: UserStatusEnum; + status: UserStatusEnum; /** Username */ - username?: string; + username: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/UserDetail.ts b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/UserDetail.ts index 38e0f1d43f61..5b764765422f 100644 --- a/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/UserDetail.ts +++ b/packages/manager/apps/pci-ai-notebooks/src/types/cloud/user/UserDetail.ts @@ -4,19 +4,19 @@ import { UserStatusEnum } from '@/types/cloud/user/UserStatusEnum'; /** UserDetail */ export interface UserDetail { /** User creation date */ - creationDate?: string; + creationDate: string; /** User description */ - description?: string; + description: string; /** User id */ - id?: number; + id: number; /** User id on openstack */ openstackId?: string; /** User password */ - password?: string; + password: string; /** User roles */ - roles?: Role[]; + roles: Role[]; /** User status */ - status?: UserStatusEnum; + status: UserStatusEnum; /** Username */ - username?: string; + username: string; } diff --git a/packages/manager/apps/pci-ai-notebooks/tailwind.config.ts b/packages/manager/apps/pci-ai-notebooks/tailwind.config.ts index 02171b216088..7ddbb19fec15 100644 --- a/packages/manager/apps/pci-ai-notebooks/tailwind.config.ts +++ b/packages/manager/apps/pci-ai-notebooks/tailwind.config.ts @@ -252,6 +252,102 @@ module.exports = { '900': 'var(--ods-color-pink-900)', '900-contrasted': 'var(--ods-color-pink-900-contrasted)', }, + warning: { + '000': 'var(--ods-color-warning-000)', + '000-contrasted': 'var(--ods-color-warning-000-contrasted)', + '050': 'var(--ods-color-warning-050)', + '050-contrasted': 'var(--ods-color-warning-050-contrasted)', + '100': 'var(--ods-color-warning-100)', + '100-contrasted': 'var(--ods-color-warning-100-contrasted)', + '200': 'var(--ods-color-warning-200)', + '200-contrasted': 'var(--ods-color-warning-200-contrasted)', + '300': 'var(--ods-color-warning-300)', + '300-contrasted': 'var(--ods-color-warning-300-contrasted)', + '400': 'var(--ods-color-warning-400)', + '400-contrasted': 'var(--ods-color-warning-400-contrasted)', + '500': 'var(--ods-color-warning-500)', + '500-contrasted': 'var(--ods-color-warning-500-contrasted)', + '600': 'var(--ods-color-warning-600)', + '600-contrasted': 'var(--ods-color-warning-600-contrasted)', + '700': 'var(--ods-color-warning-700)', + '700-contrasted': 'var(--ods-color-warning-700-contrasted)', + '800': 'var(--ods-color-warning-800)', + '800-contrasted': 'var(--ods-color-warning-800-contrasted)', + '900': 'var(--ods-color-warning-900)', + '900-contrasted': 'var(--ods-color-warning-900-contrasted)', + }, + error: { + '000': 'var(--ods-color-error-000)', + '000-contrasted': 'var(--ods-color-error-000-contrasted)', + '050': 'var(--ods-color-error-050)', + '050-contrasted': 'var(--ods-color-error-050-contrasted)', + '100': 'var(--ods-color-error-100)', + '100-contrasted': 'var(--ods-color-error-100-contrasted)', + '200': 'var(--ods-color-error-200)', + '200-contrasted': 'var(--ods-color-error-200-contrasted)', + '300': 'var(--ods-color-error-300)', + '300-contrasted': 'var(--ods-color-error-300-contrasted)', + '400': 'var(--ods-color-error-400)', + '400-contrasted': 'var(--ods-color-error-400-contrasted)', + '500': 'var(--ods-color-error-500)', + '500-contrasted': 'var(--ods-color-error-500-contrasted)', + '600': 'var(--ods-color-error-600)', + '600-contrasted': 'var(--ods-color-error-600-contrasted)', + '700': 'var(--ods-color-error-700)', + '700-contrasted': 'var(--ods-color-error-700-contrasted)', + '800': 'var(--ods-color-error-800)', + '800-contrasted': 'var(--ods-color-error-800-contrasted)', + '900': 'var(--ods-color-error-900)', + '900-contrasted': 'var(--ods-color-error-900-contrasted)', + }, + success: { + '000': 'var(--ods-color-success-000)', + '000-contrasted': 'var(--ods-color-success-000-contrasted)', + '050': 'var(--ods-color-success-050)', + '050-contrasted': 'var(--ods-color-success-050-contrasted)', + '100': 'var(--ods-color-success-100)', + '100-contrasted': 'var(--ods-color-success-100-contrasted)', + '200': 'var(--ods-color-success-200)', + '200-contrasted': 'var(--ods-color-success-200-contrasted)', + '300': 'var(--ods-color-success-300)', + '300-contrasted': 'var(--ods-color-success-300-contrasted)', + '400': 'var(--ods-color-success-400)', + '400-contrasted': 'var(--ods-color-success-400-contrasted)', + '500': 'var(--ods-color-success-500)', + '500-contrasted': 'var(--ods-color-success-500-contrasted)', + '600': 'var(--ods-color-success-600)', + '600-contrasted': 'var(--ods-color-success-600-contrasted)', + '700': 'var(--ods-color-success-700)', + '700-contrasted': 'var(--ods-color-success-700-contrasted)', + '800': 'var(--ods-color-success-800)', + '800-contrasted': 'var(--ods-color-success-800-contrasted)', + '900': 'var(--ods-color-success-900)', + '900-contrasted': 'var(--ods-color-success-900-contrasted)', + }, + info: { + '000': 'var(--ods-color-info-000)', + '000-contrasted': 'var(--ods-color-info-000-contrasted)', + '050': 'var(--ods-color-info-050)', + '050-contrasted': 'var(--ods-color-info-050-contrasted)', + '100': 'var(--ods-color-info-100)', + '100-contrasted': 'var(--ods-color-info-100-contrasted)', + '200': 'var(--ods-color-info-200)', + '200-contrasted': 'var(--ods-color-info-200-contrasted)', + '300': 'var(--ods-color-info-300)', + '300-contrasted': 'var(--ods-color-info-300-contrasted)', + '400': 'var(--ods-color-info-400)', + '400-contrasted': 'var(--ods-color-info-400-contrasted)', + '500': 'var(--ods-color-info-500)', + '500-contrasted': 'var(--ods-color-info-500-contrasted)', + '600': 'var(--ods-color-info-600)', + '600-contrasted': 'var(--ods-color-info-600-contrasted)', + '700': 'var(--ods-color-info-700)', + '700-contrasted': 'var(--ods-color-info-700-contrasted)', + '800': 'var(--ods-color-info-800)', + '800-contrasted': 'var(--ods-color-info-800-contrasted)', + '900': 'var(--ods-color-info-900)', + '900-contrasted': 'var(--ods-color-info-900-contrasted)', + }, secondary: { DEFAULT: 'var(--ods-color-secondary-500))', foreground: 'hsl(var(--secondary-foreground))', diff --git a/yarn.lock b/yarn.lock index 2d1df861560d..713c885efc47 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5259,6 +5259,11 @@ dependencies: "@babel/runtime" "^7.13.10" +"@radix-ui/primitive@1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@radix-ui/primitive/-/primitive-1.1.0.tgz#42ef83b3b56dccad5d703ae8c42919a68798bbe2" + integrity sha512-4Z8dn6Upk0qk4P74xBhZ6Hd/w0mPEzOOLxy4xiPXOXqjF7jZS0VAKk7/x/H6FyY2zCkYJqePf1G5KmkmNJ4RBA== + "@radix-ui/react-accordion@^1.1.2": version "1.1.2" resolved "https://registry.yarnpkg.com/@radix-ui/react-accordion/-/react-accordion-1.1.2.tgz#738441f7343e5142273cdef94d12054c3287966f" @@ -5296,6 +5301,20 @@ "@babel/runtime" "^7.13.10" "@radix-ui/react-primitive" "1.0.3" +"@radix-ui/react-checkbox@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@radix-ui/react-checkbox/-/react-checkbox-1.1.2.tgz#6465b800420923ecc39cbeaa8f357b5f09dbfd52" + integrity sha512-/i0fl686zaJbDQLNKrkCbMyDm6FQMt4jg323k7HuqitoANm9sE23Ql8yOK3Wusk34HSLKDChhMux05FnP6KUkw== + dependencies: + "@radix-ui/primitive" "1.1.0" + "@radix-ui/react-compose-refs" "1.1.0" + "@radix-ui/react-context" "1.1.1" + "@radix-ui/react-presence" "1.1.1" + "@radix-ui/react-primitive" "2.0.0" + "@radix-ui/react-use-controllable-state" "1.1.0" + "@radix-ui/react-use-previous" "1.1.0" + "@radix-ui/react-use-size" "1.1.0" + "@radix-ui/react-collapsible@1.0.3", "@radix-ui/react-collapsible@^1.0.3": version "1.0.3" resolved "https://registry.yarnpkg.com/@radix-ui/react-collapsible/-/react-collapsible-1.0.3.tgz#df0e22e7a025439f13f62d4e4a9e92c4a0df5b81" @@ -5336,6 +5355,11 @@ dependencies: "@babel/runtime" "^7.13.10" +"@radix-ui/react-compose-refs@1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.0.tgz#656432461fc8283d7b591dcf0d79152fae9ecc74" + integrity sha512-b4inOtiaOnYf9KWyO3jAeeCG6FeyfY6ldiEPanbUjWd+xIk5wZeHa8yVwmrJ2vderhu/BQvzCrJI0lHd+wIiqw== + "@radix-ui/react-context@1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@radix-ui/react-context/-/react-context-1.0.0.tgz#f38e30c5859a9fb5e9aa9a9da452ee3ed9e0aee0" @@ -5350,6 +5374,11 @@ dependencies: "@babel/runtime" "^7.13.10" +"@radix-ui/react-context@1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-context/-/react-context-1.1.1.tgz#82074aa83a472353bb22e86f11bcbd1c61c4c71a" + integrity sha512-UASk9zi+crv9WteK/NU4PLvOoL3OuE6BWVKNF6hPRBtYBDXQ2u5iu3O59zUlJiTVvkyuycnqrztsHVJwcK9K+Q== + "@radix-ui/react-dialog@1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@radix-ui/react-dialog/-/react-dialog-1.0.0.tgz#997e97cb183bc90bd888b26b8e23a355ac9fe5f0" @@ -5640,6 +5669,14 @@ "@radix-ui/react-compose-refs" "1.0.1" "@radix-ui/react-use-layout-effect" "1.0.1" +"@radix-ui/react-presence@1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-presence/-/react-presence-1.1.1.tgz#98aba423dba5e0c687a782c0669dcd99de17f9b1" + integrity sha512-IeFXVi4YS1K0wVZzXNrbaaUvIJ3qdY+/Ih4eHFhWA9SwGR9UDX7Ck8abvL57C4cv3wwMvUE0OG69Qc3NCcTe/A== + dependencies: + "@radix-ui/react-compose-refs" "1.1.0" + "@radix-ui/react-use-layout-effect" "1.1.0" + "@radix-ui/react-primitive@1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@radix-ui/react-primitive/-/react-primitive-1.0.0.tgz#376cd72b0fcd5e0e04d252ed33eb1b1f025af2b0" @@ -5656,6 +5693,13 @@ "@babel/runtime" "^7.13.10" "@radix-ui/react-slot" "1.0.2" +"@radix-ui/react-primitive@2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@radix-ui/react-primitive/-/react-primitive-2.0.0.tgz#fe05715faa9203a223ccc0be15dc44b9f9822884" + integrity sha512-ZSpFm0/uHa8zTvKBDjLFWLo8dkr4MBsiDLz0g3gMUwqgLHz9rTaRRGYDgvZPtBJgYCBKXkS9fzmoySgr8CO6Cw== + dependencies: + "@radix-ui/react-slot" "1.1.0" + "@radix-ui/react-progress@^1.0.3": version "1.0.3" resolved "https://registry.yarnpkg.com/@radix-ui/react-progress/-/react-progress-1.0.3.tgz#8380272fdc64f15cbf263a294dea70a7d5d9b4fa" @@ -5812,6 +5856,13 @@ "@babel/runtime" "^7.13.10" "@radix-ui/react-compose-refs" "1.0.1" +"@radix-ui/react-slot@1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@radix-ui/react-slot/-/react-slot-1.1.0.tgz#7c5e48c36ef5496d97b08f1357bb26ed7c714b84" + integrity sha512-FUCf5XMfmW4dtYl69pdS4DbxKy8nj4M7SafBgPllysxmdachynNflAdp/gCsnYWNDnge6tI9onzMp5ARYc1KNw== + dependencies: + "@radix-ui/react-compose-refs" "1.1.0" + "@radix-ui/react-switch@^1.0.3": version "1.0.3" resolved "https://registry.yarnpkg.com/@radix-ui/react-switch/-/react-switch-1.0.3.tgz#6119f16656a9eafb4424c600fdb36efa5ec5837e" @@ -5931,6 +5982,11 @@ dependencies: "@babel/runtime" "^7.13.10" +"@radix-ui/react-use-callback-ref@1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.1.0.tgz#bce938ca413675bc937944b0d01ef6f4a6dc5bf1" + integrity sha512-CasTfvsy+frcFkbXtSJ2Zu9JHpN8TYKxkgJGWbjiZhFivxaeW7rMeZt7QELGVLaYVfFMsKHjb7Ak0nMEe+2Vfw== + "@radix-ui/react-use-controllable-state@1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.0.0.tgz#a64deaafbbc52d5d407afaa22d493d687c538b7f" @@ -5947,6 +6003,13 @@ "@babel/runtime" "^7.13.10" "@radix-ui/react-use-callback-ref" "1.0.1" +"@radix-ui/react-use-controllable-state@1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.1.0.tgz#1321446857bb786917df54c0d4d084877aab04b0" + integrity sha512-MtfMVJiSr2NjzS0Aa90NPTnvTSg6C/JLCV7ma0W6+OMV78vd8OyRpID+Ng9LxzsPbLeuBnWBA1Nq30AtBIDChw== + dependencies: + "@radix-ui/react-use-callback-ref" "1.1.0" + "@radix-ui/react-use-escape-keydown@1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@radix-ui/react-use-escape-keydown/-/react-use-escape-keydown-1.0.0.tgz#aef375db4736b9de38a5a679f6f49b45a060e5d1" @@ -5977,6 +6040,11 @@ dependencies: "@babel/runtime" "^7.13.10" +"@radix-ui/react-use-layout-effect@1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.1.0.tgz#3c2c8ce04827b26a39e442ff4888d9212268bd27" + integrity sha512-+FPE0rOdziWSrH9athwI1R0HDVbWlEhd+FR+aSDk4uWGmSJ9Z54sdZVDQPZAinJhJXwfT+qnj969mCsT2gfm5w== + "@radix-ui/react-use-previous@1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@radix-ui/react-use-previous/-/react-use-previous-1.0.1.tgz#b595c087b07317a4f143696c6a01de43b0d0ec66" @@ -5984,6 +6052,11 @@ dependencies: "@babel/runtime" "^7.13.10" +"@radix-ui/react-use-previous@1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@radix-ui/react-use-previous/-/react-use-previous-1.1.0.tgz#d4dd37b05520f1d996a384eb469320c2ada8377c" + integrity sha512-Z/e78qg2YFnnXcW88A4JmTtm4ADckLno6F7OXotmkQfeuCVaKuYzqAATPhVzl3delXE7CxIV8shofPn3jPc5Og== + "@radix-ui/react-use-rect@1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@radix-ui/react-use-rect/-/react-use-rect-1.0.1.tgz#fde50b3bb9fd08f4a1cd204572e5943c244fcec2" @@ -6000,6 +6073,13 @@ "@babel/runtime" "^7.13.10" "@radix-ui/react-use-layout-effect" "1.0.1" +"@radix-ui/react-use-size@1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@radix-ui/react-use-size/-/react-use-size-1.1.0.tgz#b4dba7fbd3882ee09e8d2a44a3eed3a7e555246b" + integrity sha512-XW3/vWuIXHa+2Uwcc2ABSfcCledmXhhQPlGbfcRXbiUQI5Icjcg19BGCZVKKInYbvUCut/ufbbLLPFC5cbb1hw== + dependencies: + "@radix-ui/react-use-layout-effect" "1.1.0" + "@radix-ui/react-visually-hidden@1.0.3": version "1.0.3" resolved "https://registry.yarnpkg.com/@radix-ui/react-visually-hidden/-/react-visually-hidden-1.0.3.tgz#51aed9dd0fe5abcad7dee2a234ad36106a6984ac"