From 856d1fa7cd2a507a335a221725648aab865ce08b Mon Sep 17 00:00:00 2001 From: nxtcoder36 Date: Mon, 4 Mar 2024 13:14:11 +0530 Subject: [PATCH] implementated if tls need to be enabled or not while creating or updating routers. --- .../$environment+/routers/handle-router.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/apps/console/routes/_main+/$account+/$project+/$environment+/routers/handle-router.tsx b/src/apps/console/routes/_main+/$account+/$project+/$environment+/routers/handle-router.tsx index 9218c2a68..1c4085369 100644 --- a/src/apps/console/routes/_main+/$account+/$project+/$environment+/routers/handle-router.tsx +++ b/src/apps/console/routes/_main+/$account+/$project+/$environment+/routers/handle-router.tsx @@ -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>; @@ -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(), @@ -81,7 +84,7 @@ const Root = (props: IDialog) => { spec: { domains: val.domains, https: { - enabled: true, + enabled: val.isTlsEnabled, }, }, }, @@ -103,7 +106,7 @@ const Root = (props: IDialog) => { ...props.data.spec, domains: val.domains, https: { - enabled: true, + enabled: val.isTlsEnabled, }, }, }, @@ -198,6 +201,13 @@ const Root = (props: IDialog) => { loading={domainLoading} disableWhileLoading /> + { + handleChange('isTlsEnabled')(dummyEvent(val)); + }} + />