Skip to content

Commit

Permalink
ZKUI-396 // Veeam Configuration Summary Page
Browse files Browse the repository at this point in the history
Update Veeam UI elements and package dependencies

Update dependencies and fix minor code issues

Add Veeam constants and update Veeam configuration
UI
  • Loading branch information
hervedombya committed Nov 10, 2023
1 parent 6b54d20 commit 242a280
Show file tree
Hide file tree
Showing 10 changed files with 778 additions and 154 deletions.
582 changes: 509 additions & 73 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"@hookform/resolvers": "^2.8.8",
"@js-temporal/polyfill": "^0.4.3",
"@monaco-editor/react": "^4.4.5",
"@scality/core-ui": "github:scality/core-ui#0.93.0",
"@scality/core-ui": "github:scality/core-ui#0.101.0",
"@scality/module-federation": "github:scality/module-federation#1.1.0",
"@types/react-table": "^7.7.10",
"@types/react-virtualized": "^9.21.20",
Expand Down
39 changes: 19 additions & 20 deletions src/react/Routes.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { EmptyStateContainer } from './ui-elements/Container';
import { AppContainer, ErrorPage401, Icon, Sidebar } from '@scality/core-ui';
import { useCallback, useEffect, useMemo, useState } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import {
Redirect,
Route,
Expand All @@ -9,36 +10,34 @@ import {
useHistory,
useLocation,
} from 'react-router-dom';
import { useTheme } from 'styled-components';
import makeMgtClient from '../js/managementClient';
import type { AppState } from '../types/state';
import DataServiceRoleProvider, {
useCurrentAccount,
} from './DataServiceRoleProvider';
import ManagementProvider from './ManagementProvider';
import NoMatch from './NoMatch';
import AccountContent from './account/AccountContent';
import AccountCreate from './account/AccountCreate';
import Accounts from './account/Accounts';
import {
loadClients,
loadInstanceLatestStatus,
setManagementClient,
} from './actions';
import { useDispatch, useSelector } from 'react-redux';
import AccountCreate from './account/AccountCreate';
import Accounts from './account/Accounts';
import AccountContent from './account/AccountContent';
import type { AppState } from '../types/state';
import DataBrowser from './databrowser/DataBrowser';
import BucketCreate from './databrowser/buckets/BucketCreate';
import EndpointCreate from './endpoint/EndpointCreate';
import Endpoints from './endpoint/Endpoints';
import Loader from './ui-elements/Loader';
import LocationEditor from './locations/LocationEditor';
import NoMatch from './NoMatch';
import ManagementProvider from './ManagementProvider';
import DataServiceRoleProvider, {
useCurrentAccount,
} from './DataServiceRoleProvider';
import BucketCreate from './databrowser/buckets/BucketCreate';
import makeMgtClient from '../js/managementClient';
import { ErrorPage401, Icon, Sidebar } from '@scality/core-ui';
import { Warning } from './ui-elements/Warning';
import { AppContainer } from '@scality/core-ui';
import { Locations } from './locations/Locations';
import { EmptyStateContainer } from './ui-elements/Container';
import Loader from './ui-elements/Loader';
import ReauthDialog from './ui-elements/ReauthDialog';
import VeeamSteppers from './ui-elements/Veeam/VeeamSteps';
import { Warning } from './ui-elements/Warning';
import { useAuthGroups } from './utils/hooks';
import { useTheme } from 'styled-components';
import Configuration from './ui-elements/Veeam/VeeamConfiguration';

export const RemoveTrailingSlash = ({ ...rest }) => {
const location = useLocation();
Expand Down Expand Up @@ -182,7 +181,7 @@ function PrivateRoutes() {
<Route exact path="/create-dataservice" component={EndpointCreate} />
<Route exact path="/dataservices" component={Endpoints} />
<Route exact path="/locations" component={Locations} />
<Route path="/veeam/configuration" component={Configuration} />
<Route path="/veeam/configuration" component={VeeamSteppers} />
<Route path="*" component={NoMatch} />
</Switch>
);
Expand Down
4 changes: 2 additions & 2 deletions src/react/ui-elements/Veeam/ArtescaLogo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export const ArtescaLogo = () => {
xmlns="http://www.w3.org/2000/svg"
>
<path
fill-rule="evenodd"
clip-rule="evenodd"
fillRule="evenodd"
clipRule="evenodd"
d="M17.6841 12.0043C18.9179 15.115 21.4233 17.564 24.5848 18.6921V5.2782C21.4233 6.40586 18.9179 8.85528 17.6841 12.0043ZM5.16101 5.2782V18.6921C8.32214 17.564 10.8664 15.115 12.0613 12.0043C10.8664 8.85528 8.32214 6.40586 5.16101 5.2782ZM26.7714 24C21.9525 24 17.6693 21.7202 14.8727 18.18C12.1067 21.7202 7.79337 24 2.97448 24H0V0H2.97448C7.79337 0 12.1067 2.24984 14.8727 5.79C17.6693 2.24984 21.9525 0 26.7714 0H29.7458V24H26.7714Z"
fill="#0AADA6"
/>
Expand Down
32 changes: 14 additions & 18 deletions src/react/ui-elements/Veeam/VeeamConfiguration.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import Joi from '@hapi/joi';
import { joiResolver } from '@hookform/resolvers/joi';
import { Form, FormGroup, FormSection, Stack, Toggle } from '@scality/core-ui';
import { useStepper } from '@scality/core-ui/dist/components/steppers/Stepper.component';
import { Button, Input, Select } from '@scality/core-ui/dist/next';
import { useRef, useState } from 'react';
import { useRef } from 'react';
import { Controller, useForm } from 'react-hook-form';
import VeeamTable from './VeeamTable';

const VEEAMVERSION11 = 'Veeam 11';
const VEEAMVERSION12 = 'Veeam 12';
import { VEEAM_STEPS, VeeamStepsIndexes } from './VeeamSteps';
import { VEEAMVERSION11, VEEAMVERSION12 } from './VeeamConstants';

const schema = Joi.object({
name: Joi.string().required(),
Expand Down Expand Up @@ -56,11 +55,7 @@ const Configuration = () => {
//TODO: Create account
};
const formRef = useRef(null);
const [openVeeamTable, setOpenVeeamTable] = useState(false);

if (openVeeamTable) {
return <VeeamTable />;
}
const { next } = useStepper(VeeamStepsIndexes.Configuration, VEEAM_STEPS);

return (
<Form
Expand All @@ -86,7 +81,7 @@ const Configuration = () => {
label="Continue"
disabled={!isValid}
onClick={() => {
setOpenVeeamTable(true);
next({});
}}
/>
</Stack>
Expand Down Expand Up @@ -116,10 +111,10 @@ const Configuration = () => {
}}
></Controller>
}
></FormGroup>
/>
<FormGroup
id="name"
label="Repository name"
label="Bucket name"
direction="vertical"
required
labelHelpTooltip="TODO"
Expand All @@ -129,16 +124,16 @@ const Configuration = () => {
id="name"
type="text"
autoComplete="off"
placeholder="Veeam-repository name"
placeholder="Veeam bucket name"
{...register('name')}
/>
}
></FormGroup>
/>
<FormGroup
id="enableImmutableBackup"
label="Immutable backup"
direction="vertical"
help="Enables permanent, unchangeable backups of objects in bucket."
help="It enables object-lock on the bucket which means backups will be permanent and unchangeable."
helpErrorPosition="bottom"
labelHelpTooltip="TODO"
content={
Expand All @@ -158,13 +153,14 @@ const Configuration = () => {
}}
></Controller>
}
></FormGroup>
/>
{isVeeam12 ? (
<FormGroup
id="capacity"
label="Repository capacity"
label="Max repository capacity"
direction="vertical"
error={errors.capacity?.message ?? ''}
help="The recommended value is 80% of the platform's total capacity."
helpErrorPosition="bottom"
labelHelpTooltip="TODO"
content={
Expand Down
3 changes: 3 additions & 0 deletions src/react/ui-elements/Veeam/VeeamConstants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const BUCKET_TAG_USECASE = 'X-Scality-Usecase';
export const VEEAMVERSION11 = 'Veeam 11';
export const VEEAMVERSION12 = 'Veeam 12';
33 changes: 33 additions & 0 deletions src/react/ui-elements/Veeam/VeeamSteps.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import VeeamTable from './VeeamTable';
import VeeamConfiguration from './VeeamConfiguration';
import { VeeamSummary } from './VeeamSummary';
import { Stepper } from '@scality/core-ui';

export const VEEAM_STEPS = [
{
label: 'Configuration',
Component: VeeamConfiguration,
},
{
label: 'Repository Table',
Component: VeeamTable,
},
{
label: 'Repository Summary',
Component: VeeamSummary,
},
] as const;

export enum VeeamStepsIndexes {
Configuration,
Table,
Summary,
}

export default function VeeamSteppers() {
return (
<div style={{ paddingTop: '2rem', paddingBottom: '2rem' }}>
<Stepper steps={VEEAM_STEPS} />
</div>
);
}
159 changes: 159 additions & 0 deletions src/react/ui-elements/Veeam/VeeamSummary.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
import { Banner, Form, Icon, Text } from '@scality/core-ui';
import { Button, CopyButton } from '@scality/core-ui/dist/next';
import { Stack } from '@scality/core-ui/dist/spacing';
import { spacing } from '@scality/core-ui/dist/style/theme';
import { useHistory } from 'react-router-dom';
import { Clipboard } from '../Clipboard';
import { HideCredential } from '../Hide';
import { ModalBody } from '../Modal';
import Table, * as T from '../TableKeyValue';

type VeeamSummaryProps = Record<string, never>;

export const VeeamSummary = (_: VeeamSummaryProps) => {
const history = useHistory();

return (
<Form
layout={{
title: 'Veeam Repository preparation summary',
kind: 'page',
}}
rightActions={
<Stack gap="r16">
<p></p>
<Button
variant="primary"
label={'Continue'}
onClick={() => {
history.push('/');
}}
/>
</Stack>
}
>
<ModalBody>
<Text isEmphazed>
The following configuration has been applied in order to make ARTESCA
ready for Veeam. <br />
You can now use this information to set up the Veeam Server.
</Text>{' '}
<CopyButton
textToCopy={`Username\tveeam\nAccess key ID\tJLVWC9DX45XLY0K9PVEX\nSecret Access key\tEPJGOdLwTK`}
label="all"
variant="outline"
tooltip={{
overlay:
'Copy all the information below and paste it in a safe place. You will not be able to retrieve the Secret Access key afterwards.',
placement: 'right',
}}
size="inline"
/>
<br />
<Table style={{ marginTop: spacing.sp16 }}>
<T.Body>
<T.Row>
<T.Key> Account name </T.Key>
<T.Value> veeam </T.Value>
</T.Row>
<T.Row>
<T.Key> Certificate </T.Key>
<T.Value>
<Button
label="Artesca-CA Root"
variant="outline"
size="inline"
icon={<Icon name="Download" />}
tooltip={{
overlay:
'Download the Artesca-CA root certificate and add it to your Veeam Server.',
placement: 'right',
}}
></Button>{' '}
</T.Value>
</T.Row>
<T.Row>
<T.Key> Service point </T.Key>
<T.Value> https://s3.pod-choco.local </T.Value>
<T.ExtraCell>
{' '}
<Clipboard text={'https://s3.pod-choco.local'} />{' '}
</T.ExtraCell>
</T.Row>
<T.Row>
<T.Key> Region </T.Key>
<T.Value> us-east-1 </T.Value>
<T.ExtraCell>
{' '}
<Clipboard text={'us-east-1'} />{' '}
</T.ExtraCell>
</T.Row>
</T.Body>
</Table>
<br />
<b>Credentials</b>
<br />
<br />
<Banner icon={<Icon name="Exclamation-triangle" />} variant="warning">
The Secret Access key cannot be retrieved afterwards, so make sure to
keep and secure it now. <br />
You will be able to create new Access keys at any time.
</Banner>
<Table
style={{
marginTop: spacing.sp16,
}}
>
<T.Body>
<T.Row>
<T.Key> Access key ID </T.Key>
<T.Value>JLVWC9DX45XLY0K9PVEX</T.Value>
<T.ExtraCell>
{' '}
<Clipboard text={'JLVWC9DX45XLY0K9PVEX'} />{' '}
</T.ExtraCell>
</T.Row>
<T.Row>
<T.Key> Secret Access key </T.Key>
<T.Value>
{' '}
<HideCredential credentials={'EPJGOdLwTK'} />{' '}
</T.Value>
<T.ExtraCell>
{' '}
<Clipboard text={'EPJGOdLwTK'} />{' '}
</T.ExtraCell>
</T.Row>
</T.Body>
</Table>
<br />
<b>Bucket</b>
<br />
<br />
<Table>
<T.Body>
<T.Row>
<T.Key> Name </T.Key>
<T.Value> veeam-bucket </T.Value>
<T.ExtraCell>
{' '}
<Clipboard text={'veeam-repository'} />{' '}
</T.ExtraCell>
</T.Row>
<T.Row>
<T.Key> Immutable backup </T.Key>
<T.Value>
Active
<br />
<Text variant="Smaller" color="textSecondary">
Make sure to check the "Make recent backups immutable"
checkbox when configuring the bucket in the Veeam Server.
</Text>
</T.Value>
</T.Row>
</T.Body>
</Table>
</ModalBody>
</Form>
);
};
Loading

0 comments on commit 242a280

Please sign in to comment.