Skip to content

Commit

Permalink
Merge pull request #113 from kloudlite/impl/router-tls
Browse files Browse the repository at this point in the history
implementated if tls need to be enabled or not while creating or
  • Loading branch information
abdheshnayak authored Mar 4, 2024
2 parents 6bbcb77 + 531db05 commit 79c5757
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { NameIdView } from '~/console/components/name-id-view';
import Select from '~/components/atoms/select';
import useCustomSwr from '~/root/lib/client/hooks/use-custom-swr';
import { useAppend, useMapper } from '~/components/utils';
import { Checkbox } from '~/components/atoms/checkbox';
import { IAppContext } from '../app+/$app+/_layout';

type IDialog = IDialogBase<ExtractNodeType<IRouters>>;
Expand Down Expand Up @@ -49,12 +50,14 @@ const Root = (props: IDialog) => {
displayName: props.data.displayName,
domains: [],
isNameError: false,
isTlsEnabled: props.data.spec.https?.enabled || false,
}
: {
name: '',
displayName: '',
domains: [],
isNameError: false,
isTlsEnabled: false,
},
validationSchema: Yup.object({
displayName: Yup.string().required(),
Expand All @@ -81,7 +84,7 @@ const Root = (props: IDialog) => {
spec: {
domains: val.domains,
https: {
enabled: true,
enabled: val.isTlsEnabled,
},
},
},
Expand All @@ -103,7 +106,7 @@ const Root = (props: IDialog) => {
...props.data.spec,
domains: val.domains,
https: {
enabled: true,
enabled: val.isTlsEnabled,
},
},
},
Expand Down Expand Up @@ -198,6 +201,13 @@ const Root = (props: IDialog) => {
loading={domainLoading}
disableWhileLoading
/>
<Checkbox
label="enable TLS"
checked={values.isTlsEnabled}
onChange={(val) => {
handleChange('isTlsEnabled')(dummyEvent(val));
}}
/>
</Popup.Content>
<Popup.Footer>
<Popup.Button content="Cancel" variant="basic" closable />
Expand Down

0 comments on commit 79c5757

Please sign in to comment.