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

web-interface.assets.StreamSearchPage.9669727fff253ffe7cf4.js.map Maven / Gradle / Ivy

{"version":3,"file":"StreamSearchPage.9669727fff253ffe7cf4.js","mappings":"iNAkCA,QAZ6B,SAC3BA,EACAC,EACAC,GAEA,OAAOC,EAAAA,EAAAA,UACL,kBAAMC,EAAAA,EAAAA,OAAmBC,EAAAA,EAAAA,KAAAA,OAAkBL,EAAUC,EAAWC,GAAaI,MAAK,qBAAGC,UAErF,CAACP,M,0jCCJL,IAAMQ,EAAgB,SAAC,GAAD,IAAGC,EAAH,EAAGA,MAAH,OACpB,gBAAC,IAAD,CAAWC,MAAM,uBACNC,YAAa,yJACtB,2BACGF,MAAAA,OADH,EACGA,EAAOG,WAsCd,QAjCoB,SAACL,EAAqBM,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,GACEjB,EACAO,EACAE,EACAH,GACA,WACEM,GAAU,GACVG,OAAiBF,MAPrB,OASQ,SAACK,GACHA,aAAaC,MACfJ,EAAiB,gBAACd,EAAD,CAAeC,MAAOgB,KAKzCH,EAAiBG,QAIrB,CAACT,EAAoBF,EAAkBP,IAEhC,CAACW,EAAQG,K,upCCHlB,SAAeM,EAAAA,EAAAA,IAAWC,EAAAA,EAAAA,IAxBD,SAAC,GAAyD,IAA7C5B,EAA6C,EAAvD6B,OAAU7B,SAAwBa,EAAqB,EAAjCiB,SAAYjB,MAC5D,GAAmCkB,EAAAA,EAAAA,GAA8BlB,GAAzDZ,EAAR,EAAQA,UAAWC,EAAnB,EAAmBA,YACb8B,GAAUC,EAAAA,EAAAA,GAAqBjC,EAAUC,EAAWC,GAC1D,KAAgCgC,EAAAA,EAAAA,GAAYF,EAASnB,GAArD,GAAOK,EAAP,KAAeiB,EAAf,KAEMC,GAAeC,EAAAA,EAAAA,cAAY,WAC/B,GAAIrC,EACF,OAAOsC,EAAAA,EAAAA,IAAqBtC,GAG9B,MAAM,IAAI0B,MAAM,6BACf,CAAC1B,IAEJ,OAAImC,IAICjB,EAIE,gBAAC,IAAD,CAAYqB,YAAaH,IAHvB,gBAAC,IAAD","sources":["webpack://graylog-web-interface/./src/views/logic/views/UseCreateSavedSearch.ts","webpack://graylog-web-interface/./src/views/logic/views/UseLoadView.tsx","webpack://graylog-web-interface/./src/views/pages/StreamSearchPage.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 { useMemo } from 'react';\n\nimport { ViewActions } from 'views/stores/ViewStore';\nimport View from 'views/logic/views/View';\nimport type { ElasticsearchQueryString, TimeRange } from 'views/logic/queries/Query';\n\nconst useCreateSavedSearch = (\n  streamId?: string,\n  timeRange?: TimeRange,\n  queryString?: ElasticsearchQueryString,\n) => {\n  return useMemo(\n    () => ViewActions.create(View.Type.Search, streamId, timeRange, queryString).then(({ view: v }) => v),\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n    [streamId],\n  );\n};\n\nexport default useCreateSavedSearch;\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 { 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 * as React from 'react';\nimport { useCallback } from 'react';\n\nimport Spinner from 'components/common/Spinner';\nimport withParams from 'routing/withParams';\nimport useLoadView from 'views/logic/views/UseLoadView';\nimport useCreateSavedSearch from 'views/logic/views/UseCreateSavedSearch';\nimport withLocation from 'routing/withLocation';\nimport type { Location } from 'routing/withLocation';\nimport { loadNewViewForStream } from 'views/logic/views/Actions';\nimport type { RawQuery } from 'views/logic/NormalizeSearchURLQueryParams';\nimport normalizeSearchURLQueryParams from 'views/logic/NormalizeSearchURLQueryParams';\n\nimport SearchPage from './SearchPage';\n\ntype Props = {\n location: Location,\n params: {\n streamId?: string,\n },\n};\n\nconst StreamSearchPage = ({ params: { streamId }, location: { query } }: Props) => {\n const { timeRange, queryString } = normalizeSearchURLQueryParams(query);\n const newView = useCreateSavedSearch(streamId, timeRange, queryString);\n const [loaded, HookComponent] = useLoadView(newView, query);\n\n const _loadNewView = useCallback(() => {\n if (streamId) {\n return loadNewViewForStream(streamId);\n }\n\n throw new Error('No stream id specified!');\n }, [streamId]);\n\n if (HookComponent) {\n return HookComponent;\n }\n\n if (!loaded) {\n return ;\n }\n\n return ;\n};\n\nexport default withParams(withLocation(StreamSearchPage));\n"],"names":["streamId","timeRange","queryString","useMemo","ViewActions","View","then","view","LoadViewError","error","title","description","message","query","loadingViewHooks","usePluginEntities","executingViewHooks","useState","loaded","setLoaded","undefined","hookComponent","setHookComponent","useEffect","processHooks","e","Error","withParams","withLocation","params","location","normalizeSearchURLQueryParams","newView","useCreateSavedSearch","useLoadView","HookComponent","_loadNewView","useCallback","loadNewViewForStream","loadNewView"],"sourceRoot":""}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy