Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ai.notebooks): logs tab #14313

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/manager/apps/pci-ai-notebooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"createNewNotebook": "Créer un notebook",
"tableHeaderName": "Name",
"tableHeaderLocation": "Région",
"tableHeaderEnvironment": "Environnement",
"tableHeaderFramework": "Framework",
"tableHeaderEditor": "Editeur",
"tableHeaderResources": "Ressources",
"tableHeaderPrivacy": "Confidentialité ",
"networkSecureTitle": "Privé",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,8 @@
"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": "Commande CLI",
"cliEquivalentModalToastMessage": "Le code a été copié"
"cliEquivalentModalToastMessage": "Le code a été copié",
"errorCreatingNotebook": "Erreur",
"successCreatingNotebookTitle": "Succès",
"successCreatingNotebookDescription": "Votre notebook a été créé avec succès"
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"dashboardTab": "Dashboard",
"dataTab": "Données attachées",
"backupTab": "Backup",
"backupTab": "Backups",
"logsTab": "Logs",
"publicAccessLabel": "Public",
"privateAccessLabel": "Privé",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"attachedDataTitle": "Attacher des conteneurs de données",
"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",
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"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",
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ 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',
};

Expand All @@ -10,7 +11,35 @@ export const mockedDataSync: ai.volume.DataSync = {
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',
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as ai from '@/types/cloud/project/ai';
import { mockedDataSync } from './datasync';

export const mockedJobSpec: ai.job.JobSpec = {
image: 'image',
Expand All @@ -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',
Expand Down
Original file line number Diff line number Diff line change
@@ -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',
},
],
};
Original file line number Diff line number Diff line change
@@ -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: {
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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'],
};
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
};
Original file line number Diff line number Diff line change
@@ -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 (
<Dialog defaultOpen onOpenChange={onOpenChange}>
{isLoading ? (
<DialogContent>
<DialogHeader>
<Skeleton className="w-3/5 h-5" />
</DialogHeader>
<DialogDescription className="flex flex-col gap-2">
<Skeleton className="w-4/5 h-4" />
<Skeleton className="w-100 h-4" />
<Skeleton className="w-2/3 h-4" />
<Skeleton className="w-4/5 h-4" />
<Skeleton className="w-1/3 h-4" />
<Skeleton className="w-4/5 h-4" />
</DialogDescription>
<DialogFooter className="flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 flex justify-end mt-2">
<Skeleton className="w-20 h-10" />
<Skeleton className="w-20 h-10" />
</DialogFooter>
</DialogContent>
) : (
children
)}
</Dialog>
);
};

export default RouteModal;
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ DataTable.Skeleton = function DataTableSkeleton({
{Array.from({ length: columns }).map((col, iCol) => (
<TableCell key={`${col}${iCol}`}>
<Skeleton
style={{ width: `${width}px`, height: `${height}px` }}
className='block'
style={{ width: `${width}px`, height: `${height}px`}}
/>
</TableCell>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Skeleton({
...props
}: React.HTMLAttributes<HTMLDivElement>) {
return (
<div
<span
className={cn("animate-pulse rounded-md bg-muted", className)}
{...props}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +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;
export const TIMELINE_MAX = -7;
Original file line number Diff line number Diff line change
@@ -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}`,
},
};
Loading
Loading