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

web-interface.assets.NewDashboardPage.e2dff605f99b5c75b393.js.map Maven / Gradle / Ivy

{"version":3,"file":"NewDashboardPage.e2dff605f99b5c75b393.js","mappings":"orCA0BA,IAAMA,EAAgB,SAAC,GAAD,IAAGC,EAAH,EAAGA,MAAH,OACpB,gBAAC,IAAD,CAAWC,MAAM,uBACNC,YAAa,yJACtB,2BACGF,MAAAA,OADH,EACGA,EAAOG,WAsCd,QAjCoB,SAACC,EAAqBC,GACxC,IAAMC,GAAmBC,EAAAA,EAAAA,GAAkB,2BACrCC,GAAqBD,EAAAA,EAAAA,GAAkB,6BAE7C,KAA4BE,EAAAA,EAAAA,WAAS,GAArC,GAAOC,EAAP,KAAeC,EAAf,KACA,KAA0CF,EAAAA,EAAAA,eAASG,GAAnD,GAAOC,EAAP,KAAsBC,EAAtB,KAyBA,OAvBAC,EAAAA,EAAAA,YAAU,YACRC,EAAAA,EAAAA,GACEZ,EACAE,EACAE,EACAH,GACA,WACEM,GAAU,GACVG,OAAiBF,MAPrB,OASQ,SAACK,GACHA,aAAaC,MACfJ,EAAiB,gBAACf,EAAD,CAAeC,MAAOiB,KAKzCH,EAAiBG,QAIrB,CAACT,EAAoBF,EAAkBF,IAEhC,CAACM,EAAQG,K,4zBCFlB,QArCwB,SAACM,GACvB,IAAMC,GAAgCC,EAAAA,EAAAA,KAAIF,EAAWG,OAAOC,QAAQC,KAAI,SAACC,GAAD,MAAO,CAACA,EAAEC,GAAID,OAChFE,GAAiCR,EAAWS,QAASP,EAAAA,EAAAA,QAAOG,KAAI,SAACK,EAAsBC,GAC3F,MAA6CV,EAASW,IAAID,GAAlDE,EAAR,EAAQA,UAAW3B,EAAnB,EAAmBA,MAAnB,IAA0B4B,OAAAA,OAA1B,OAAmCZ,EAAAA,EAAAA,OAAnC,EAEMa,GAAWD,EAASA,EAAOF,IAAI,WAAWI,EAAAA,EAAAA,UAAUA,EAAAA,EAAAA,SACvDF,QAAO,SAACG,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-web-interface/./src/views/logic/views/UseLoadView.tsx","webpack://graylog-web-interface/./src/views/logic/views/ViewTransformer.ts","webpack://graylog-web-interface/./src/views/pages/NewDashboardPage.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 { useEffect, useState } from 'react';\nimport * as React from 'react';\n\nimport ErrorPage from 'components/errors/ErrorPage';\n\nimport type View from './View';\nimport { processHooks } from './ViewLoader';\n\nimport usePluginEntities from '../usePluginEntities';\n\nconst LoadViewError = ({ error }: { error: Error }) => (\n  An unknown error has occurred. Please have a look at the following message and the graylog server log for more information.

}>\n
\n      {error?.message}\n    
\n
\n);\n\nconst useLoadView = (view: Promise, query: { [key: string]: any }) => {\n const loadingViewHooks = usePluginEntities('views.hooks.loadingView');\n const executingViewHooks = usePluginEntities('views.hooks.executingView');\n\n const [loaded, setLoaded] = useState(false);\n const [hookComponent, setHookComponent] = useState(undefined);\n\n useEffect(() => {\n processHooks(\n view,\n loadingViewHooks,\n executingViewHooks,\n query,\n () => {\n setLoaded(true);\n setHookComponent(undefined);\n },\n ).catch((e) => {\n if (e instanceof Error) {\n setHookComponent();\n\n return;\n }\n\n setHookComponent(e);\n });\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [executingViewHooks, loadingViewHooks, view]);\n\n return [loaded, hookComponent];\n};\n\nexport default useLoadView;\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 { List, Map } from 'immutable';\n\nimport type Widget from 'views/logic/widgets/Widget';\nimport type { QueryId } from 'views/logic/queries/Query';\nimport type Query from 'views/logic/queries/Query';\n\nimport type { ViewStateMap } from './View';\nimport View from './View';\nimport type ViewState from './ViewState';\n\nconst ViewTransformer = (searchView: View): View => {\n const queryMap: Map = Map(searchView.search.queries.map((q) => [q.id, q]));\n const newViewStateMap: ViewStateMap = (searchView.state || Map()).map((viewState: ViewState, queryId: string) => {\n const { timerange, query, filter = Map() } = queryMap.get(queryId);\n\n const streams = (filter ? filter.get('filters', List()) : List())\n .filter((value) => Map.isMap(value) && value.get('type') === 'stream')\n .map((value) => value.get('id'))\n .toList()\n .toArray();\n\n const widgets: List = viewState.widgets.map((widget: Widget) => {\n return widget.toBuilder()\n .timerange(timerange)\n .query(query)\n .streams(streams)\n .build();\n }).toList();\n\n return viewState.toBuilder()\n .widgets(widgets)\n .build();\n }).toMap();\n // Remove query string attached to the existing search query\n const newQueries = searchView.search.queries.map(\n (query) => query.toBuilder().query({ ...query.query, query_string: '' }).build(),\n ).toSet();\n const newSearch = searchView.search.toBuilder().queries(newQueries).build();\n\n return searchView.toBuilder()\n .newId()\n .type(View.Type.Dashboard)\n .state(newViewStateMap)\n .search(newSearch)\n .build();\n};\n\nexport default ViewTransformer;\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 } from 'react';\n\nimport withLocation from 'routing/withLocation';\nimport type { Location } from 'routing/withLocation';\nimport Spinner from 'components/common/Spinner';\nimport viewTransformer from 'views/logic/views/ViewTransformer';\nimport { ViewActions } from 'views/stores/ViewStore';\nimport View from 'views/logic/views/View';\nimport { IfPermitted } from 'components/common';\nimport useLoadView from 'views/logic/views/UseLoadView';\n\nimport SearchPage from './SearchPage';\n\ntype Props = {\n location: Location & {\n state?: {\n view?: View,\n },\n },\n};\n\nconst NewDashboardPage = ({ location }: Props) => {\n const { state = {} } = location;\n const { view: searchView } = state;\n const loadedView = useMemo(() => {\n if (searchView?.search) {\n const dashboardView = viewTransformer(searchView);\n\n return ViewActions.load(dashboardView, true).then(() => dashboardView);\n }\n\n return ViewActions.create(View.Type.Dashboard).then(({ view }) => view);\n // This should be run only once upon mount on purpose.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const [loaded, HookComponent] = useLoadView(loadedView, location.query);\n\n if (HookComponent) {\n return HookComponent;\n }\n\n return loaded\n ? \n : ;\n};\n\nNewDashboardPage.propTypes = {};\nexport default withLocation(NewDashboardPage);\n"],"names":["LoadViewError","error","title","description","message","view","query","loadingViewHooks","usePluginEntities","executingViewHooks","useState","loaded","setLoaded","undefined","hookComponent","setHookComponent","useEffect","processHooks","e","Error","searchView","queryMap","Map","search","queries","map","q","id","newViewStateMap","state","viewState","queryId","get","timerange","filter","streams","List","value","toList","toArray","widgets","widget","toBuilder","build","toMap","newQueries","query_string","toSet","newSearch","newId","type","View","NewDashboardPage","location","loadedView","useMemo","dashboardView","viewTransformer","ViewActions","then","useLoadView","HookComponent","permissions","SearchPage","Spinner","propTypes","withLocation"],"sourceRoot":""}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy