-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Accelerator section in Admin Panel and feature flag
- Loading branch information
Showing
6 changed files
with
94 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
frontend/src/pages/acceleratorProfile/AcceleratorProfile.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import * as React from 'react'; | ||
import { | ||
Button, | ||
ButtonVariant, | ||
Flex, | ||
FlexItem, | ||
EmptyState, | ||
EmptyStateIcon, | ||
EmptyStateVariant, | ||
EmptyStateBody, | ||
PageSection, | ||
PageSectionVariants, | ||
Title, | ||
} from '@patternfly/react-core'; | ||
import { PlusCircleIcon } from '@patternfly/react-icons'; | ||
import ApplicationsPage from '~/pages/ApplicationsPage'; | ||
import useAccelerators from '~/pages/notebookController/screens/server/useAccelerators'; | ||
import { useDashboardNamespace } from '~/redux/selectors'; | ||
|
||
const description = `Manage accelerator profile settings for users in your organization`; | ||
|
||
const AcceleratorProfile: React.FC = () => { | ||
const { dashboardNamespace } = useDashboardNamespace(); | ||
const [accelerators, loaded, loadError] = useAccelerators(dashboardNamespace); | ||
|
||
const isEmpty = !accelerators || accelerators.length === 0; | ||
|
||
const noAcceleratorProfilePageSection = ( | ||
<PageSection isFilled> | ||
<EmptyState variant={EmptyStateVariant.full} data-id="empty-empty-state"> | ||
<EmptyStateIcon icon={PlusCircleIcon} /> | ||
<Title headingLevel="h5" size="lg"> | ||
No available accelerator profiles yet | ||
</Title> | ||
<EmptyStateBody> | ||
{/* eslint-disable-next-line react/no-unescaped-entities */} | ||
You don't have any accelerator profiles yet. To get started, please ask your cluster | ||
administrator about | ||
<br /> the accelerator availability in your cluster and create corresponding profiles in | ||
Openshift Data Science. | ||
</EmptyStateBody> | ||
<Button | ||
data-id="display-accelerator-modal-button" | ||
variant={ButtonVariant.primary} | ||
// eslint-disable-next-line @typescript-eslint/no-empty-function | ||
onClick={() => {}} | ||
> | ||
Add new accelerator profile | ||
</Button> | ||
</EmptyState> | ||
</PageSection> | ||
); | ||
|
||
return ( | ||
<ApplicationsPage | ||
title="Accelerator profiles" | ||
description={description} | ||
loaded={loaded} | ||
empty={isEmpty} | ||
loadError={loadError} | ||
errorMessage="Unable to load accelerator profiles." | ||
emptyStatePage={noAcceleratorProfilePageSection} | ||
> | ||
<PageSection variant={PageSectionVariants.light} padding={{ default: 'noPadding' }}> | ||
<Flex direction={{ default: 'column' }}> | ||
<FlexItem>{/* Todo: Create accelerator table */}</FlexItem> | ||
</Flex> | ||
</PageSection> | ||
</ApplicationsPage> | ||
); | ||
}; | ||
|
||
export default AcceleratorProfile; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters