-
Notifications
You must be signed in to change notification settings - Fork 593
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Kanika Murarka <kmurarka@redhat.com>
- Loading branch information
Kanika Murarka
committed
Nov 8, 2020
1 parent
56098b4
commit 6de77aa
Showing
9 changed files
with
268 additions
and
8 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
frontend/packages/ceph-storage-plugin/src/components/kms-config/kms-config.scss
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,14 @@ | ||
.ocs-install-kms { | ||
&__form-url { | ||
display: inline-flex; | ||
width: 100%; | ||
} | ||
|
||
&__form-address { | ||
width: 80%; | ||
} | ||
|
||
&__form-port { | ||
width: 20%; | ||
} | ||
} |
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
5 changes: 5 additions & 0 deletions
5
...ages/ceph-storage-plugin/src/components/modals/advanced-kms-modal/advanced-kms-modal.scss
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,5 @@ | ||
.ceph-advanced-kms { | ||
&__form-body { | ||
padding: var(--pf-global--spacer--md) 0; | ||
} | ||
} |
133 changes: 133 additions & 0 deletions
133
...kages/ceph-storage-plugin/src/components/modals/advanced-kms-modal/advanced-kms-modal.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,133 @@ | ||
import * as React from 'react'; | ||
import * as _ from 'lodash'; | ||
|
||
import { | ||
createModalLauncher, | ||
ModalTitle, | ||
ModalBody, | ||
ModalSubmitFooter, | ||
ModalComponentProps, | ||
} from '@console/internal/components/factory/modal'; | ||
import { | ||
HandlePromiseProps, | ||
withHandlePromise, | ||
} from '@console/internal/components/utils/promise-component'; | ||
import './advanced-kms-modal.scss'; | ||
import { State, Action } from '../../ocs-install/attached-devices/create-sc/state'; | ||
import { | ||
InternalClusterState, | ||
InternalClusterAction, | ||
} from '../../ocs-install/internal-mode/reducer'; | ||
import { FormGroup, TextInput } from '@patternfly/react-core'; | ||
import { DroppableFileInput } from '@console/internal/components/utils/file-input'; | ||
import { FieldLevelHelp } from '@console/internal/components/utils'; | ||
import { vaultNamespaceTooltip } from '../../../constants'; | ||
|
||
export const AdvancedKMSModal = withHandlePromise((props: AdvancedKMSModalProps) => { | ||
const { close, cancel, handlePromise, errorMessage, inProgress, state, dispatch } = props; | ||
|
||
const { kms } = state; | ||
|
||
// React.useEffect(() => { | ||
|
||
// }, []); | ||
|
||
const [backendPath, setBackendPath] = React.useState(kms.backend || 'path/'); | ||
const [caCertificate, setCACertificate] = React.useState(kms.caCert || ''); | ||
const [tlsName, setTLSName] = React.useState(kms.tls || ''); | ||
const [clientCertificate, setClientCertificate] = React.useState(kms.clientCert || ''); | ||
const [clientKey, setClientKey] = React.useState(kms.clientKey || ''); | ||
const [providerNS, setProvideNS] = React.useState(kms.providerNamespace || ''); | ||
const submit = (event: React.FormEvent<EventTarget>) => {}; | ||
|
||
return ( | ||
<form | ||
onSubmit={submit} | ||
className="modal-content modal-content--no-inner-scroll" | ||
key="pool-form-modal" | ||
> | ||
<ModalTitle>Key Management Service Advanced Settings</ModalTitle> | ||
<ModalBody> | ||
<FormGroup | ||
fieldId="kms-service-backend-path" | ||
label="Backend Path" | ||
className="ceph-advanced-kms__form-body" | ||
> | ||
<TextInput | ||
value={backendPath} | ||
onChange={setBackendPath} | ||
type="text" | ||
id="kms-service-backend-path" | ||
name="kms-service-backend-path" | ||
/> | ||
</FormGroup> | ||
<DroppableFileInput | ||
className="ceph-advanced-kms__form-body" | ||
onChange={setCACertificate} | ||
inputFileData={caCertificate} | ||
id="kms-service-ca-cert" | ||
hideContents | ||
label="CA Certificate" | ||
inputFieldHelpText="Upload a .PEM file here" | ||
/> | ||
<FormGroup | ||
fieldId="kms-service-tls" | ||
label="TLS Server Name" | ||
className="ceph-advanced-kms__form-body" | ||
> | ||
<TextInput | ||
value={tlsName} | ||
onChange={setTLSName} | ||
type="text" | ||
id="kms-service-tls" | ||
name="kms-service-tls" | ||
/> | ||
</FormGroup> | ||
<FormGroup | ||
fieldId="kms-service-namespace" | ||
label="Vault Enterprise Namespace" | ||
className="ceph-advanced-kms__form-body" | ||
labelIcon={<FieldLevelHelp>{vaultNamespaceTooltip}</FieldLevelHelp>} | ||
helperText="The name must be accurate and must match the service namespace" | ||
> | ||
<TextInput | ||
value={providerNS} | ||
onChange={setProvideNS} | ||
type="text" | ||
id="kms-service-namespace" | ||
name="kms-service-namespace" | ||
|
||
/> | ||
</FormGroup> | ||
<DroppableFileInput | ||
className="ceph-advanced-kms__form-body" | ||
onChange={setClientCertificate} | ||
inputFileData={clientCertificate} | ||
id="kms-service-cert" | ||
hideContents | ||
label="Client Certificate" | ||
inputFieldHelpText="Upload a .PEM file here" | ||
/> | ||
<DroppableFileInput | ||
className="ceph-advanced-kms__form-body" | ||
onChange={setClientKey} | ||
inputFileData={clientKey} | ||
id="kms-service-key" | ||
hideContents | ||
label="Client Private Key" | ||
inputFieldHelpText="Upload a .PEM file here" | ||
/> | ||
|
||
</ModalBody> | ||
<ModalSubmitFooter errorMessage={errorMessage} inProgress={inProgress} submitText="Save" cancel={cancel} /> | ||
</form> | ||
); | ||
}); | ||
|
||
export type AdvancedKMSModalProps = { | ||
state: State | InternalClusterState; | ||
dispatch: React.Dispatch<Action | InternalClusterAction>; | ||
} & HandlePromiseProps & | ||
ModalComponentProps; | ||
|
||
export const advancedKMSModal = createModalLauncher(AdvancedKMSModal); |
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
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