All Downloads are FREE. Search and download functionalities are using the official Maven repository.

web-interface.assets.bb8c8232-290.21ce9471c62feeb912e9.js.map Maven / Gradle / Ivy

There is a newer version: 6.1.4
Show newest version
{"version":3,"file":"bb8c8232-290.21ce9471c62feeb912e9.js","mappings":"uQA2BA,MAAMA,KAAY,WAAO,eAAa;AAAA;AAAA,EAIhCC,KAAe,WAAO,QAAM,EAAE,CAAC,CAAE,MAAAC,CAAM,OAAM;AAAA,iBAClCA,EAAM,MAAM,OAAO,UAAU;AAAA,eAC/BA,EAAM,MAAM,KAAK,UAAU;AAAA,WAC/BA,EAAM,OAAO,QAAQ,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAUxC,MAAqBA,CAAK,CAAC;AAAA;AAAA;AAAA;AAAA,aAIpBA,EAAM,OAAO,OAAO,WAAW;AAAA;AAAA,SAEtC,MAAsBA,CAAK,CAAC;AAAA;AAAA;AAAA;AAAA,WAI1B,MAAsBA,CAAK,CAAC;AAAA;AAAA,CAEnC,EAEDD,EAAa,YAAc,SAyC3B,QAtBuB,CAAC,CAAE,MAAAE,CAAM,IAC9B,gBAACH,EAAA,KACEG,EAAM,IAAI,CAAC,CAAE,KAAAC,EAAM,MAAAC,EAAO,YAAAC,EAAa,eAAAC,CAAe,IAChDH,EAKH,gBAAC,KAAW,CAAC,YAAaE,GAAA,KAAAA,EAAe,CAAC,EAAG,IAAKF,CAAA,EAChD,gBAAC,IAAa,CAAC,GAAIA,EAAM,eAAgB,CAACG,CAAA,EACxC,gBAACN,EAAA,CAAa,QAAQ,QACpB,gBAAC,KAAqB,KACnBI,CACH,CACF,CACF,CACF,EAZO,IAcV,CACH,C,4VCrDF,MAAMG,EADa,CAAC,QAAS,OAAQ,SAAU,OAAO,EAClB,IAAKC,GAASA,EAAK,kBAAkB,CAAC,EAQpEC,EAAgB,UAAO,GAAG,MAAM,CACpC,UAAW,SACb,CAAC,EAAE,CAAC,CAAE,MAAAR,C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AAI,GAAG,6BAEhF,EACCD,GACC,gBAAC,yBAAsB,UAAWA,EACX,OAAQ,IAAMP,EAAS,EACvB,OAAO,MAE5B,gBAAC,EAAc,CAAC,SAAAA,CAAA,CAAoB,CACtC,CAEJ,CAEJ,ECbA,EAPgC,IAC9B,gBAAC,WACC,gBAAC,UAAG,oBAAkB,EACtB,gBAAC,SAAE,iDAA+C,EAClD,gBAAC,EAA6B,IAAC,CACjC,E,oBCFF,MAAMlE,EAAY,UAAO;AAAA;AAAA;AAAA;AAAA,EAazB,EAP8B,IAC5B,gBAACA,EAAA,KACC,gBAACwB,EAAA,EAA8B,IAAC,EAChC,gBAAC,EAAuB,IAAC,CAC3B,E,oBCWF,QApB0C,IACxC,gBAAC,KAAa,CAAC,MAAM,oCACnB,gBAAC,IAAuB,IAAC,EACzB,gBAAC,MAAW,MAAM,mCACN,kBAAmB,CACjB,MAAO,2BACP,KAAMmD,EAAA,EAAW,MAAM,iBACzB,GACV,gBAAC,YAAK,uLAEN,CACF,EACA,gBAAC,MAAG,CAAC,UAAU,WACb,gBAAC,MAAG,CAAC,GAAI,IACP,gBAAC,EAAqB,IAAC,CACzB,CACF,CACF,C","sources":["webpack://graylog-web-interface/./src/components/common/PageNavigation.tsx","webpack://graylog-web-interface/./src/components/datanode/DataNodeConfiguration/CertificateRenewalPolicyConfig.tsx","webpack://graylog-web-interface/./src/components/datanode/DataNodePageNavigation.tsx","webpack://graylog-web-interface/./src/components/datanode/hooks/useMigrationState.ts","webpack://graylog-web-interface/./src/components/datanode/hooks/useCreateDataNodeClientCert.ts","webpack://graylog-web-interface/./src/components/datanode/client-certificate/ClientCertificateView.tsx","webpack://graylog-web-interface/./src/components/datanode/client-certificate/ClientCertForm.tsx","webpack://graylog-web-interface/./src/components/datanode/client-certificate/CreateClientCertificateButton.tsx","webpack://graylog-web-interface/./src/components/datanode/client-certificate/ClientCertificateConfig.tsx","webpack://graylog-web-interface/./src/components/datanode/DataNodeConfiguration/DataNodeConfiguration.tsx","webpack://graylog-web-interface/./src/pages/DataNodesClusterConfigurationPage.tsx"],"sourcesContent":["/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport * as React from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Button, ButtonToolbar } from 'components/bootstrap';\nimport { LinkContainer } from 'components/common/router';\nimport { IfPermitted } from 'components/common';\nimport NavItemStateIndicator, {\n  hoverIndicatorStyles,\n  activeIndicatorStyles,\n} from 'components/common/NavItemStateIndicator';\n\nconst Container = styled(ButtonToolbar)`\n  margin-bottom: 10px;\n`;\n\nconst StyledButton = styled(Button)(({ theme }) => css`\n  font-family: ${theme.fonts.family.navigation};\n  font-size: ${theme.fonts.size.navigation};\n  color: ${theme.colors.variant.darker.default};\n  \n  &:hover,\n  &:focus {\n    background: inherit;\n    text-decoration: none;\n  }\n\n  &:hover {\n    color: inherit;\n    ${hoverIndicatorStyles(theme)}\n  }\n\n  &.active {\n    color: ${theme.colors.global.textDefault};\n\n    ${activeIndicatorStyles(theme)}\n\n    &:hover,\n    &:focus {\n      ${activeIndicatorStyles(theme)}\n    }\n`);\n\nStyledButton.displayName = 'Button';\n\ntype Props = {\n  /**\n   * List of nav items. Define permissions, if the item should only be displayed for users with specific permissions.\n   * By default, an item is active if the current URL starts with the item URL.\n   * If you only want to display an item as active only when its path matches exactly, set `exactPathMatch` to true.\n   */\n  items: Array<{\n    title: string,\n    path: string,\n    permissions?: string | Array\n    exactPathMatch?: boolean,\n  }>\n}\n\n/**\n * Simple tab navigation to allow navigating to subareas of a page.\n */\nconst PageNavigation = ({ items }: Props) => (\n  \n    {items.map(({ path, title, permissions, exactPathMatch }) => {\n      if (!path) {\n        return null;\n      }\n\n      return (\n        \n          \n            \n              \n                {title}\n              \n            \n          \n        \n      );\n    })}\n  \n);\n\nexport default PageNavigation;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport * as React from 'react';\nimport { useMemo, useState } from 'react';\nimport { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';\nimport { Field, Form, Formik } from 'formik';\nimport type { DefaultTheme } from 'styled-components';\nimport styled, { css } from 'styled-components';\nimport capitalize from 'lodash/capitalize';\nimport moment from 'moment';\n\nimport ModalSubmit from 'components/common/ModalSubmit';\nimport UserNotification from 'util/UserNotification';\nimport { Input, Button, Col, Modal, Row } from 'components/bootstrap';\nimport { ConfigurationsActions } from 'stores/configurations/ConfigurationsStore';\nimport { ConfigurationType } from 'components/configurations/ConfigurationTypes';\nimport { IfPermitted, TimeUnitInput, Spinner } from 'components/common';\nimport useSendTelemetry from 'logic/telemetry/useSendTelemetry';\nimport Select from 'components/common/Select';\nimport useLocation from 'routing/useLocation';\nimport { getPathnameWithoutId } from 'util/URLUtils';\nimport { TELEMETRY_EVENT_TYPE } from 'logic/telemetry/Constants';\nimport { MIGRATION_STATE_QUERY_KEY } from 'components/datanode/hooks/useMigrationState';\n\ntype RenewalPolicy = {\n  mode: 'AUTOMATIC' | 'MANUAL',\n  certificate_lifetime: string,\n}\nconst TIME_UNITS = ['hours', 'days', 'months', 'years'] as const;\nconst TIME_UNITS_UPPER = TIME_UNITS.map((unit) => unit.toLocaleUpperCase());\n\ntype FormConfig = {\n  mode: RenewalPolicy['mode'],\n  lifetimeUnit: typeof TIME_UNITS[number],\n  lifetimeValue: number,\n}\n\nconst StyledDefList = styled.dl.attrs({\n  className: 'deflist',\n})(({ theme }: { theme: DefaultTheme }) => css`\n  &&.deflist {\n    dt {\n      float: left;\n    }\n\n    dd {\n      padding-left: ${theme.spacings.md};\n      margin-left: 200px;\n    }\n  }\n`);\n\nconst handleSaveConfig = async (configToSave: RenewalPolicy) => (\n  ConfigurationsActions.update(ConfigurationType.CERTIFICATE_RENEWAL_POLICY_CONFIG, configToSave)\n);\n\nconst smallestUnit = (duration: string) => {\n  if (duration.endsWith('H')) {\n    return 'hours';\n  }\n\n  if (duration.endsWith('D')) {\n    return 'days';\n  }\n\n  if (duration.endsWith('M')) {\n    return 'months';\n  }\n\n  if (duration.endsWith('Y')) {\n    return 'years';\n  }\n\n  throw new Error(`Invalid duration specified: ${duration}`);\n};\n\nconst fetchCurrentConfig = () => ConfigurationsActions.list(ConfigurationType.CERTIFICATE_RENEWAL_POLICY_CONFIG) as Promise;\n\nconst NoExistingPolicy = ({ createPolicy }: { createPolicy: () => void }) => (\n  There is no Certificate Renewal Policy yet. Click \n     to create one.\n  \n);\n\nconst certicateRenewalModes = ['AUTOMATIC', 'MANUAL'].map((mode) => ({ label: capitalize(mode), value: mode }));\n\nconst DEFAULT_CONFIG = {\n  mode: 'AUTOMATIC',\n  lifetimeUnit: 'days',\n  lifetimeValue: 30,\n} as const;\n\nconst queryKey = ['config', 'certificate-renewal-policy'];\n\nconst renewalModeExplanation = 'Setting the renewal policy to \"Automatic\" will '\n  + 'renew all expiring certificates without any user interaction. Setting it to \"Manual\" will create a system '\n  + 'notification when one or more certificates are about to expire, allowing you to confirm their renewal.';\nconst lifetimeExplanation = 'The certificate lifetime will be used for the length of the validity of newly created certificates.';\n\ntype Props = {\n  className?: string\n}\n\nconst CertificateRenewalPolicyConfig = ({ className }: Props) => {\n  const [showModal, setShowModal] = useState(false);\n  const { data: currentConfig, isLoading } = useQuery(queryKey, fetchCurrentConfig);\n\n  const sendTelemetry = useSendTelemetry();\n  const { pathname } = useLocation();\n  const queryClient = useQueryClient();\n\n  const { mutateAsync: updateConfig } = useMutation(handleSaveConfig, {\n    onSuccess: () => {\n      queryClient.invalidateQueries(queryKey);\n      queryClient.invalidateQueries(MIGRATION_STATE_QUERY_KEY);\n      setShowModal(false);\n    },\n    onError: (err: Error) => {\n      UserNotification.error(`Error Updating Detector Definition: ${err.toString()}`, 'Unable to update detector definition');\n    },\n  });\n\n  const formConfig: FormConfig | undefined = useMemo(() => {\n    if (isLoading) {\n      return undefined;\n    }\n\n    if (!currentConfig) {\n      return DEFAULT_CONFIG;\n    }\n\n    const { mode, certificate_lifetime } = currentConfig;\n    const lifetimeUnit = smallestUnit(certificate_lifetime);\n    const lifetimeValue = moment.duration(certificate_lifetime).as(lifetimeUnit);\n\n    return {\n      mode,\n      lifetimeUnit,\n      lifetimeValue,\n    };\n  }, [currentConfig, isLoading]);\n\n  if (isLoading) {\n    return ;\n  }\n\n  const modalTitle = 'Configure Certificate Renewal Policy';\n\n  const resetConfig = () => {\n    setShowModal(false);\n  };\n\n  const saveConfig = (values: FormConfig) => {\n    sendTelemetry(TELEMETRY_EVENT_TYPE.CONFIGURATIONS.CERTIFICATE_RENEWAL_POLICY_UPDATED, {\n      app_pathname: getPathnameWithoutId(pathname),\n      app_section: 'certificate-renewal-policy',\n      app_action_value: 'configuration-save',\n    });\n\n    const newConfig = {\n      mode: values.mode,\n      certificate_lifetime: moment.duration(values.lifetimeValue, values.lifetimeUnit).toJSON(),\n    };\n\n    return updateConfig(newConfig);\n  };\n\n  return (\n    
\n

Certificate Renewal Policy Configuration

\n

\n These settings will be used when detecting expiration of certificates and/or when renewing them.\n

\n {!currentConfig ? setShowModal(true)} /> : (\n <>\n \n
Renewal Mode:
\n
{capitalize(currentConfig.mode)}
\n
{renewalModeExplanation}
\n
Certificate Lifetime:
\n
{formConfig.lifetimeValue} {formConfig.lifetimeUnit}
\n
{lifetimeExplanation}
\n
\n\n

\n \n \n \n

\n \n )}\n\n \n onSubmit={saveConfig} initialValues={formConfig}>\n {({ values, setFieldValue, isSubmitting, isValid, isValidating }) => (\n
\n \n {modalTitle}\n \n\n \n
\n \n \n \n {({ field: { name, value, onChange } }) => (\n \n