Skip to content

Commit

Permalink
Updated REST API.
Browse files Browse the repository at this point in the history
Updated REST API Design.
  • Loading branch information
dlabaj committed Mar 23, 2022
1 parent 660f6a3 commit 75333e9
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 8 deletions.
18 changes: 10 additions & 8 deletions backend/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,24 +220,26 @@ export type BuildStatus = {
timestamp?: string;
};

export enum NotebookStatus {
VALIDITING,
SUCCESS,
FAILED
export type NotebookError = {
severity: string;
message: string;
}

export type NotebookStatus = "Importing" | "Validating" | "Success" | "Failed";

export type Notebook = {
name: string;
repo: string;
url: string;
description?: string;
status?: NotebookStatus;
phase?: NotebookStatus;
user?: string;
uploaded?: Date;
visible?: boolean;
packages?: NotebookPackage[];
error?: NotebookError;
}

export type NotebookPackage = {
name: string;
version :string;
}
version: string;
}
71 changes: 71 additions & 0 deletions frontend/src/pages/notebookImages/NotebookImages.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import * as React from 'react';
import * as _ from 'lodash-es';
import {
Button,
ButtonVariant,
Flex,
FlexItem,
Form,
FormGroup,
InputGroup,
InputGroupText,
InputGroupTextVariant,
PageSection,
PageSectionVariants,
Text,
TextInput,
} from '@patternfly/react-core';
import ApplicationsPage from '../ApplicationsPage';
import { Notebook } from '../../types';
import { useDispatch } from 'react-redux';
import { addNotification } from '../../redux/actions/actions';
import './NotebookImages.scss';

const description = `Update global settings for all users.`;

const NotebookImages: React.FC = () => {
const isEmpty = true;
const [loaded, setLoaded] = React.useState<boolean>(false);
const [loadError, setLoadError] = React.useState<Error>();
const [NotebookImages, setNoteImages] = React.useState(Array<Notebook>());
const dispatch = useDispatch();

React.useEffect(() => {
// fetchClusterSettings()
// .then((NotebookImages: NotebookImages) => {
// setLoaded(true);
// setLoadError(undefined);
// setClusterSettings(NotebookImages);
// setPvcSize(NotebookImages.pvcSize);
// })
// .catch((e) => {
// setLoadError(e);
// });
}, []);


return (
<ApplicationsPage
title="Notebook image settings"
description={description}
loaded={loaded}
empty={isEmpty}
loadError={loadError}
errorMessage="Unable to load Notebook images."
emptyMessage="No custom notebook images found."
>
{!isEmpty ? (
<div className="odh-cluster-settings">
<PageSection variant={PageSectionVariants.light} padding={{ default: 'noPadding' }}>
<Flex direction={{ default: 'column' }}>
<FlexItem>
</FlexItem>
</Flex>
</PageSection>
</div>
) : null}
</ApplicationsPage>
);
};

export default NotebookImages;

0 comments on commit 75333e9

Please sign in to comment.