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

web-interface.assets.325e2d4b-4389.7e9be03fc3b19076060b.js.map Maven / Gradle / Ivy

There is a newer version: 6.0.1
Show newest version
{"version":3,"file":"325e2d4b-4389.7e9be03fc3b19076060b.js","mappings":"4OA8BA,MAAMA,EAASC,EAAAA,QAAAA,IAAAA,WAAH,mEAAGA,CAAH,8GAUCC,EAAWD,EAAAA,QAAAA,GAAAA,WAAH,qEAAGA,CAAH,wCAKfE,GAAiBF,EAAAA,EAAAA,SAAOG,EAAAA,GAAV,sFAAGH,EAAgB,QAAC,MAAEI,GAAH,SAAeC,EAAAA,EAAAA,KAAd,CAAD,mCAExBD,EAAME,MAAMC,KAAKC,GAFO,IAKjCC,EAAmB,QAAC,SAAEC,EAAF,MAAYC,EAAZ,YAAmBC,GAAc,EAAjC,cAAwCC,EAAxC,UAAuDC,GAAxD,SACvB,gBAAC,KAAD,CAAKA,UAAY,WAAUA,KACzB,gBAAC,KAAD,CAAKC,GAAI,IACP,gBAAChB,EAAD,KACE,gBAACE,EAAD,KACGU,EACAC,GAAe,gBAACV,EAAD,CAAgBc,KAAK,GAAGC,MAAO,KAEhDJ,GAEFH,GAVkB,EAezBD,EAAiBS,aAAe,CAC9BJ,UAAW,GACXF,aAAa,EACbC,mBAAeM,GAGjB,S,0GC1CA,MAsBA,EAtBwB,QAAC,OAAEC,EAAF,eAAUC,GAAX,SACtB,gBAAC,KAAD,KACE,gBAAC,IAAD,CAAeC,GAAIC,EAAAA,GAAAA,OAAAA,MAAAA,KAAyBH,IAC1C,gBAAC,KAAD,CAAQI,QAAQ,WAAhB,kBAIAH,GACA,gBAAC,IAAD,CAAeC,GAAIC,EAAAA,GAAAA,OAAAA,MAAAA,KAAyBH,IAC1C,gBAAC,KAAD,CAAQI,QAAQ,WAAhB,cAKJ,gBAAC,IAAD,CAAeF,GAAIC,EAAAA,GAAAA,OAAAA,MAAAA,OAAAA,KAAgCH,IACjD,gBAAC,KAAD,CAAQI,QAAQ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hG,EAAQS,GAIhD,OAFAiF,GAAiB,GAEVkB,EAAQ9C,MAAMH,IACnBgC,IACAD,GAAiB,GAEV/B,IAJT,EAmB0CmD,CAAarG,EAAWT,EAAQ2F,EAAYD,GA6BjEnF,cAAeA,EACfgC,cAAeiD,IAE1B,gBAAC,KAAD,KACE,gBAAC,KAAD,CAAK7F,GAAI,IACP,gBAAC,KAAD,UA7Bd,G,2FC5EK,SAAS6D,EAAWuD,EAAYC,GAA0C,IAA9BC,EAA8B,uDAAP,MACxE,MAAMC,EAASC,IAAOJ,GAChBK,EAASD,IAAOH,GAEtB,MAAkB,QAAdC,EACMC,EAAOG,SAASD,IAAW,EAAIA,EAAOC,SAASH,GAAU,EAAI,EAG/DE,EAAOC,SAASH,IAAW,EAAIA,EAAOG,SAASD,GAAU,EAAI,CACtE,CAEM,SAASE,EAAsBC,EAAYC,GAA0C,IAA9BP,EAA8B,uDAAP,MACnF,MAAsB,QAAdA,GAAsBQ,EAAAA,EAAAA,GAAYF,EAAGG,cAAeF,EAAGE,gBAAiBD,EAAAA,EAAAA,GAAYD,EAAGE,cAAeH,EAAGG,cAClH,C","sources":["webpack://graylog-web-interface/./src/components/common/Section/SectionComponent.tsx","webpack://graylog-web-interface/./src/components/users/navigation/UserActionLinks.tsx","webpack://graylog-web-interface/./src/components/users/CreateTokenForm.tsx","webpack://graylog-web-interface/./src/components/users/TokenList.tsx","webpack://graylog-web-interface/./src/pages/UserTokensEditPage.tsx","webpack://graylog-web-interface/./src/util/SortUtils.ts"],"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 Spinner from 'components/common/Spinner';\nimport { Row, Col } from 'components/bootstrap';\n\ntype Props = {\n  children: React.ReactNode,\n  title: string,\n  showLoading?: boolean,\n  headerActions?: React.ReactElement,\n  className?: string,\n};\n\nconst Header = styled.div`\n  display: flex;\n  justify-content: space-between;\n  align-items: flex-start;\n\n  *:not(:first-child) {\n    margin-left: 10px;\n  }\n`;\n\nexport const Headline = styled.h2`\n  margin-bottom: 15px;\n  display: inline;\n`;\n\nconst LoadingSpinner = styled(Spinner)(({ theme }) => css`\n  margin-left: 10px;\n  font-size: ${theme.fonts.size.h3};\n`);\n\nconst SectionComponent = ({ children, title, showLoading = false, headerActions, className }: Props) => (\n  \n    \n      
\n \n {title}\n {showLoading && }\n \n {headerActions}\n
\n {children}\n \n
\n);\n\nSectionComponent.defaultProps = {\n className: '',\n showLoading: false,\n headerActions: undefined,\n};\n\nexport default SectionComponent;\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 type { $PropertyType } from 'utility-types';\n\nimport { LinkContainer } from 'components/common/router';\nimport type User from 'logic/users/User';\nimport Routes from 'routing/Routes';\nimport { ButtonToolbar, Button } from 'components/bootstrap';\n\ntype Props = {\n userId: $PropertyType,\n userIsReadOnly: boolean,\n};\n\nconst UserActionLinks = ({ userId, userIsReadOnly }: Props) => (\n \n \n \n \n {!userIsReadOnly && (\n \n \n \n )}\n \n \n \n \n);\n\nexport default UserActionLinks;\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 React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport type { StyledComponent } from 'styled-components';\nimport styled from 'styled-components';\n\nimport { Button, ControlLabel, FormControl, FormGroup } from 'components/bootstrap';\nimport { Spinner } from 'components/common';\n\nconst StyledForm: StyledComponent<'form', {}> = styled.form`\n margin-top: 10px;\n &.form-inline > .form-group {\n margin-right: 10px;\n > input {\n width: 300px;\n }\n }\n`;\n\ntype Props = {\n creatingToken: boolean,\n onCreate: (tokenName: string) => void,\n};\n\nconst CreateTokenForm = ({ creatingToken, onCreate }: Props) => {\n const [tokenName, setTokenName] = useState('');\n\n const createToken = (event) => {\n event.preventDefault();\n onCreate(tokenName);\n setTokenName('');\n };\n\n return (\n \n \n Token Name\n setTokenName(event.target.value)} />\n \n \n \n );\n};\n\nCreateTokenForm.propTypes = {\n creatingToken: PropTypes.bool,\n onCreate: PropTypes.func.isRequired,\n};\n\nCreateTokenForm.defaultProps = {\n creatingToken: false,\n};\n\nexport default CreateTokenForm;\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 PropTypes from 'prop-types';\nimport React, { useMemo, useState } from 'react';\nimport styled from 'styled-components';\n\nimport { ClipboardButton, ControlledTableList, Icon, RelativeTime, SearchForm, Spinner } from 'components/common';\nimport { Button, Col, Panel, Row } from 'components/bootstrap';\nimport type { Token, TokenSummary } from 'stores/users/UsersStore';\nimport { sortByDate } from 'util/SortUtils';\n\nimport CreateTokenForm from './CreateTokenForm';\n\nconst StyledTokenPanel = styled(Panel)`\n &.panel {\n margin: 10px 0;\n background-color: ${(props) => props.theme.colors.global.contentBackground};\n\n .panel-heading {\n color: ${(props) => props.theme.colors.gray[30]};\n }\n }\n`;\n\nconst StyledCopyTokenButton = styled(ClipboardButton)`\n vertical-align: baseline;\n margin-left: 1em;\n`;\n\nconst StyledSearchForm = styled(SearchForm)`\n margin-bottom: 10px;\n`;\n\nconst StyledLastAccess = styled.div`\n color: ${(props) => props.theme.colors.gray[60]};\n font-size: ${(props) => props.theme.fonts.size.small};\n margin-bottom: 5px;\n`;\n\ntype Props = {\n creatingToken: boolean,\n deletingToken?: string,\n onCreate: (tokenName: string) => Promise,\n onDelete: (tokenId: string, tokenName: string) => void,\n tokens: TokenSummary[],\n};\n\nconst TokenList = ({ creatingToken, deletingToken, onCreate, onDelete, tokens }: Props) => {\n const [createdToken, setCreatedToken] = useState();\n const [query, setQuery] = useState('');\n\n const effectiveTokens = useMemo(() => {\n const queryRegex = new RegExp(query, 'i');\n\n return tokens\n .filter(({ name }) => queryRegex.test(name))\n .sort((token1, token2) => sortByDate(token1.last_access, token2.last_access, 'desc'));\n }, [query, tokens]);\n\n const handleTokenCreation = (tokenName) => {\n const promise = onCreate(tokenName);\n\n promise.then((token) => {\n setCreatedToken(token);\n\n return token;\n });\n };\n\n const deleteToken = (token) => {\n return () => {\n onDelete(token.id, token.name);\n };\n };\n\n const updateQuery = (nextQuery?: string) => setQuery(nextQuery || '');\n\n return (\n \n \n {createdToken && (\n \n \n Token {createdToken.name} created!\n \n \n

This is your new token. Make sure to copy it now, you will not be able to see it again.

\n
\n              {createdToken.token}\n              } text={createdToken.token} bsSize=\"xsmall\" />\n            
\n \n
\n
\n )}\n
\n \n\n \n \n {effectiveTokens.length === 0 && (\n \n

{query === '' ? 'No tokens to display.' : 'No tokens match the filter.'}

\n
\n )}\n {effectiveTokens.map((token) => {\n const tokenNeverUsed = Date.parse(token.last_access) === 0;\n\n return (\n \n \n \n {token.name}\n \n {tokenNeverUsed ? 'Never used' : <>Last used }\n \n \n \n \n \n \n \n );\n })}\n
\n
\n );\n};\n\nTokenList.propTypes = {\n tokens: PropTypes.arrayOf(PropTypes.object),\n onDelete: PropTypes.func,\n onCreate: PropTypes.func,\n creatingToken: PropTypes.bool,\n deletingToken: PropTypes.string,\n};\n\nTokenList.defaultProps = {\n tokens: [],\n onDelete: () => {},\n onCreate: () => {},\n creatingToken: false,\n deletingToken: undefined,\n};\n\nexport default TokenList;\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 { useEffect, useState, useCallback } from 'react';\n\nimport type User from 'logic/users/User';\nimport withParams from 'routing/withParams';\nimport { Row, Col } from 'components/bootstrap';\nimport { isPermitted } from 'util/PermissionsMixin';\nimport DocsHelper from 'util/DocsHelper';\nimport UsersDomain from 'domainActions/users/UsersDomain';\nimport { PageHeader, DocumentTitle, Spinner } from 'components/common';\nimport { Headline } from 'components/common/Section/SectionComponent';\nimport TokenList from 'components/users/TokenList';\nimport UsersPageNavigation from 'components/users/navigation/UsersPageNavigation';\nimport UserActionLinks from 'components/users/navigation/UserActionLinks';\nimport useCurrentUser from 'hooks/useCurrentUser';\n\ntype Props = {\n params: {\n userId: string,\n },\n};\n\nconst PageTitle = ({ fullName }: { fullName: string | null | undefined }) => (\n <>\n Edit Tokens Of User {fullName && (\n <>\n - {fullName}\n \n )}\n \n);\n\nconst _loadTokens = (loadedUser, currentUser, setTokens) => {\n if (loadedUser) {\n if (isPermitted(currentUser?.permissions, [`users:tokenlist:${loadedUser.username}`])) {\n UsersDomain.loadTokens(loadedUser.id).then(setTokens);\n } else {\n setTokens([]);\n }\n }\n};\n\nconst _deleteToken = (tokenId, tokenName, userId, loadTokens, setDeletingTokenId) => {\n const promise = UsersDomain.deleteToken(userId, tokenId, tokenName);\n\n setDeletingTokenId(tokenId);\n\n promise.then(() => {\n loadTokens();\n setDeletingTokenId(undefined);\n });\n};\n\nconst _createToken = (tokenName, userId, loadTokens, setCreatingToken) => {\n const promise = UsersDomain.createToken(userId, tokenName);\n\n setCreatingToken(true);\n\n return promise.then((token) => {\n loadTokens();\n setCreatingToken(false);\n\n return token;\n });\n};\n\nconst UserEditPage = ({ params }: Props) => {\n const currentUser = useCurrentUser();\n const [loadedUser, setLoadedUser] = useState();\n const [tokens, setTokens] = useState([]);\n const [deletingTokenId, setDeletingTokenId] = useState();\n const [creatingToken, setCreatingToken] = useState(false);\n\n const userId = params?.userId;\n\n const loadTokens = useCallback(() => _loadTokens(loadedUser, currentUser, setTokens), [currentUser, loadedUser]);\n const _handleTokenDelete = (tokenId, tokenName) => _deleteToken(tokenId, tokenName, userId, loadTokens, setDeletingTokenId);\n const _handleTokenCreate = (tokenName) => _createToken(tokenName, userId, loadTokens, setCreatingToken);\n\n useEffect(() => { loadTokens(); }, [loadTokens, loadedUser]);\n useEffect(() => { UsersDomain.load(userId).then(setLoadedUser); }, [userId]);\n\n return (\n \n \n }\n actions={(\n \n )}\n documentationLink={{\n title: 'Permissions documentation',\n path: DocsHelper.PAGES.USERS_ROLES,\n }}>\n \n You can create new tokens or delete old ones.\n \n \n\n \n \n Create And Edit Tokens\n {loadedUser ? (\n \n ) : (\n \n \n \n \n \n )}\n \n \n \n );\n};\n\nexport default withParams(UserEditPage);\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 moment from 'moment';\n\nimport { defaultCompare as naturalSort } from 'logic/DefaultCompare';\n\ntype SortOrder = 'asc' | 'desc';\n\nexport function sortByDate(d1: string, d2: string, sortOrder: SortOrder = 'asc') {\n const d1Time = moment(d1);\n const d2Time = moment(d2);\n\n if (sortOrder === 'asc') {\n return (d1Time.isBefore(d2Time) ? -1 : d2Time.isBefore(d1Time) ? 1 : 0);\n }\n\n return (d2Time.isBefore(d1Time) ? -1 : d1Time.isBefore(d2Time) ? 1 : 0);\n}\n\nexport function naturalSortIgnoreCase(s1: string, s2: string, sortOrder: SortOrder = 'asc') {\n return (sortOrder === 'asc' ? naturalSort(s1.toLowerCase(), s2.toLowerCase()) : naturalSort(s2.toLowerCase(), s1.toLowerCase()));\n}\n"],"names":["Header","styled","Headline","LoadingSpinner","Spinner","theme","css","fonts","size","h3","SectionComponent","children","title","showLoading","headerActions","className","xs","text","delay","defaultProps","undefined","userId","userIsReadOnly","to","Routes","bsStyle","StyledForm","CreateTokenForm","creatingToken","onCreate","tokenName","setTokenName","useState","onSubmit","event","preventDefault","controlId","type","placeholder","value","onChange","target","id","disabled","propTypes","PropTypes","StyledTokenPanel","Panel","props","colors","global","contentBackground","gray","StyledCopyTokenButton","ClipboardButton","StyledSearchForm","SearchForm","StyledLastAccess","small","TokenList","deletingToken","onDelete","tokens","createdToken","setCreatedToken","query","setQuery","effectiveTokens","useMemo","queryRegex","RegExp","filter","name","test","sort","token1","token2","sortByDate","last_access","deleteToken","token","updateQuery","nextQuery","then","fixedWidth","bsSize","onClick","onSearch","onReset","searchButtonLabel","label","useLoadingState","length","map","tokenNeverUsed","Date","parse","key","md","dateTime","PageTitle","fullName","withParams","params","currentUser","useCurrentUser","loadedUser","setLoadedUser","setTokens","deletingTokenId","setDeletingTokenId","setCreatingToken","loadTokens","useCallback","isPermitted","permissions","username","UsersDomain","_loadTokens","useEffect","UsersPageNavigation","actions","UserActionLinks","readOnly","documentationLink","path","DocsHelper","lg","tokenId","promise","_deleteToken","_createToken","d1","d2","sortOrder","d1Time","moment","d2Time","isBefore","naturalSortIgnoreCase","s1","s2","naturalSort","toLowerCase"],"sourceRoot":""}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy