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

web-interface.assets.ViewManagementPage.11b9f72925818240e61d.js.map Maven / Gradle / Ivy

There is a newer version: 6.0.2
Show newest version
{"version":3,"sources":["webpack:///./src/views/components/views/View.tsx","webpack:///./src/views/components/views/ViewList.tsx","webpack:///./src/views/pages/ViewManagementPage.tsx"],"names":["formatTitle","title","id","disabled","to","Routes","pluginRoute","OwnerTag","owner","currentUser","useContext","CurrentUserContext","username","propTypes","PropTypes","string","isRequired","Description","description","createdAt","style","color","UserTimezoneTimestamp","dateTime","missingRequirements","requires","requirementsProvided","Object","entries","filter","require","includes","reduce","prev","key","value","isMissingRequirements","keys","length","MissingRequirement","plugin","href","url","target","rel","name","Requirements","missing","values","map","View","children","summary","titleSuffix","actions","node","objectOf","shape","arrayOf","defaultProps","withPluginEntities","reducer","state","action","payload","newQuery","newPage","newPerPage","type","query","page","perPage","ViewList","pagination","handleSearch","handleViewDelete","views","useReducer","dispatch","useState","viewToShare","setViewToShare","execSearch","useCallback","useEffect","onViewDelete","view","then","text","items","created_at","entityId","entityType","onClick","pullRight","permissions","anyPermissions","onSelect","itemActionsFactory","EntityShareModal","ViewTypeLabel","entityTitle","onClose","undefined","onChange","activePage","totalItems","total","pageSize","pageSizes","marginBottom","onSearch","queryHelpComponent","QueryHelper","entityName","commonFields","onReset","topMargin","bsNoItemsStyle","noItemsText","object","number","func","ViewManagementActions","search","window","confirm","ViewManagementPage","useStore","ViewManagementStore","list","EXTENDEDSEARCH","bsStyle","bsSize","className","md"],"mappings":"i7DA0BA,IAAMA,EAAc,SAACC,EAAOC,GAAR,IAAYC,EAAZ,+DAAkCA,EAClD,4BAAKF,GACL,kBAAC,IAAD,CAAMG,GAAIC,IAAOC,YAAY,oBAAnBD,CAAwCH,IAAMD,IAEtDM,EAAW,SAAC,GAAc,IAAZC,EAAY,EAAZA,MACZC,EAAcC,qBAAWC,KAE/B,OAAKH,GAASA,KAAUC,aAAL,EAAKA,EAAaG,UAI9B,2CAA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MAoCMyC,UAjCY,WAAM,MACFC,YAASC,KAA9BC,EADuB,EACvBA,KAAMzD,EADiB,EACjBA,WAEd,OACE,gBAAC,IAAD,CAAexE,MAAM,SACnB,4BACE,gBAAC,IAAD,CAAYA,MAAM,SAChB,wDAIC,KAED,4BACE,gBAAC,IAAD,CAAeG,GAAIC,IAAO8H,gBACxB,gBAAC,IAAD,CAAQC,QAAQ,UAAUC,OAAO,MAAjC,sBAKN,gBAAC,IAAD,CAAKC,UAAU,WACb,gBAAC,IAAD,CAAKC,GAAI,IACP,gBAAC,IAAD,CAAU3D,MAAOsD,EACPzD,WAAYA,EACZC,aAAcA,EACdC,iBAAkBA","file":"ViewManagementPage.11b9f72925818240e61d.js","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 React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { Link } from 'components/graylog/router';\nimport Routes from 'routing/Routes';\nimport { EntityListItem } from 'components/common';\nimport CurrentUserContext from 'contexts/CurrentUserContext';\nimport UserTimezoneTimestamp from 'views/components/common/UserTimezoneTimestamp';\nimport withPluginEntities from 'views/logic/withPluginEntities';\n\nconst formatTitle = (title, id, disabled = false) => (disabled\n  ? 

{title}

\n : {title});\n\nconst OwnerTag = ({ owner }) => {\n const currentUser = useContext(CurrentUserContext);\n\n if (!owner || owner === currentUser?.username) {\n return Last saved;\n }\n\n return Shared by {owner}, last saved;\n};\n\nOwnerTag.propTypes = {\n owner: PropTypes.string.isRequired,\n};\n\n// eslint-disable-next-line react/prop-types\nconst Description = ({ description, owner, createdAt }) => (\n <>\n
{description || No description given.}
\n
at
\n \n);\n\ntype Plugin = {\n name: string,\n url: string,\n};\n\ntype RequirementsList = { [key: string]: Plugin };\n\nconst missingRequirements = (requires, requirementsProvided): RequirementsList => Object.entries(requires)\n .filter(([require]) => !requirementsProvided.includes(require))\n .reduce((prev, [key, value]) => ({ ...prev, [key]: value }), {});\n\nconst isMissingRequirements = (requires, requirementsProvided) => Object.keys(missingRequirements(requires, requirementsProvided)).length > 0;\n\ntype RequirementsProps = {\n requires: RequirementsList,\n requirementsProvided: Array,\n};\n\ntype MissingRequirementProps = {\n plugin: Plugin,\n};\n\nconst MissingRequirement = ({ plugin }: MissingRequirementProps) => (\n {plugin.name}\n);\n\nconst Requirements = ({ requires, requirementsProvided }: RequirementsProps) => {\n const missing = missingRequirements(requires, requirementsProvided);\n\n return Object.keys(missing).length > 0\n ? (\n
\n Missing requirement(s): {Object.values(missing)\n .map((plugin: Plugin) => )}\n
\n )\n : null;\n};\n\nconst View = ({ children, id, title, summary, description, owner, requires, createdAt, requirementsProvided }) => (\n \n \n \n \n )}\n actions={children} />\n);\n\nView.propTypes = {\n children: PropTypes.node,\n id: PropTypes.string.isRequired,\n title: PropTypes.string,\n summary: PropTypes.string,\n description: PropTypes.string,\n owner: PropTypes.string.isRequired,\n createdAt: PropTypes.string.isRequired,\n requires: PropTypes.objectOf(PropTypes.shape({\n name: PropTypes.string.isRequired,\n url: PropTypes.string.isRequired,\n })).isRequired,\n requirementsProvided: PropTypes.arrayOf(PropTypes.string).isRequired,\n};\n\nView.defaultProps = {\n children: null,\n title: 'Unnamed View',\n summary: null,\n description: null,\n};\n\nexport default withPluginEntities(View, { requirementsProvided: 'views.requires.provided' });\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, { useEffect, useReducer, useState, useCallback } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { ButtonToolbar, DropdownButton, MenuItem } from 'components/graylog';\nimport { IfPermitted, PaginatedList, SearchForm, Spinner, EntityList, ShareButton } from 'components/common';\nimport EntityShareModal from 'components/permissions/EntityShareModal';\nimport QueryHelper from 'components/common/QueryHelper';\nimport ViewClass from 'views/logic/views/View';\n\nimport View from './View';\n\nimport ViewTypeLabel from '../ViewTypeLabel';\n\nconst itemActionsFactory = (view, onViewDelete, setViewToShare) => {\n return (\n \n setViewToShare(view)} />\n \n \n Delete\n \n \n \n );\n};\n\nconst reducer = (state, action) => {\n const { payload = {} } = action;\n const { newQuery, newPage, newPerPage } = payload;\n\n switch (action.type) {\n case 'search':\n return { ...state, query: newQuery, page: 1 };\n case 'searchReset':\n return { ...state, query: '', page: 1 };\n case 'pageChange':\n return { ...state, page: newPage, perPage: newPerPage };\n case 'viewDelete':\n return { ...state, page: 1 };\n default:\n return state;\n }\n};\n\nconst ViewList = ({ pagination, handleSearch, handleViewDelete, views }) => {\n const [{ query, page, perPage }, dispatch] = useReducer(reducer, { query: '', page: 1, perPage: 10 });\n const [viewToShare, setViewToShare] = useState();\n\n const execSearch = useCallback(() => handleSearch(query, page, perPage), [handleSearch, page, perPage, query]);\n\n useEffect(() => {\n execSearch();\n }, [query, page, perPage, execSearch]);\n\n const onViewDelete = (view) => () => {\n handleViewDelete(view).then(() => {\n dispatch({ type: 'viewDelete' });\n execSearch();\n });\n };\n\n if (!views) {\n return ;\n }\n\n const items = views.map((view) => (\n \n {itemActionsFactory(view, onViewDelete, setViewToShare)}\n \n ));\n\n return (\n <>\n {viewToShare && (\n setViewToShare(undefined)} />\n )}\n dispatch({ type: 'pageChange', payload: { newPage, newPerPage } })}\n activePage={pagination.page}\n totalItems={pagination.total}\n pageSize={pagination.perPage}\n pageSizes={[10, 50, 100]}>\n
\n dispatch({ type: 'search', payload: { newQuery } })}\n queryHelpComponent={}\n onReset={() => dispatch({ type: 'searchReset' })}\n topMargin={0} />\n
\n \n
\n \n );\n};\n\nViewList.propTypes = {\n views: PropTypes.arrayOf(PropTypes.object),\n pagination: PropTypes.shape({\n total: PropTypes.number.isRequired,\n page: PropTypes.number.isRequired,\n perPage: PropTypes.number.isRequired,\n }).isRequired,\n handleSearch: PropTypes.func.isRequired,\n handleViewDelete: PropTypes.func.isRequired,\n};\n\nViewList.defaultProps = {\n views: undefined,\n};\n\nexport default ViewList;\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';\n\nimport { useStore } from 'stores/connect';\nimport { LinkContainer } from 'components/graylog/router';\nimport Routes from 'routing/Routes';\nimport { Col, Row, Button } from 'components/graylog';\nimport { DocumentTitle, PageHeader } from 'components/common';\nimport { ViewManagementStore, ViewManagementActions } from 'views/stores/ViewManagementStore';\nimport ViewList from 'views/components/views/ViewList';\n\nconst handleSearch = (query, page, perPage) => {\n return ViewManagementActions.search(query, page, perPage);\n};\n\nconst handleViewDelete = (view) => {\n // eslint-disable-next-line no-alert\n if (window.confirm(`Are you sure you want to delete \"${view.title}\"?`)) {\n return ViewManagementActions.delete(view);\n }\n\n return null;\n};\n\nconst ViewManagementPage = () => {\n const { list, pagination } = useStore(ViewManagementStore);\n\n return (\n \n \n \n \n Graylog view management.\n \n\n {null}\n\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n );\n};\n\nexport default ViewManagementPage;\n"],"sourceRoot":""}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy