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

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

There is a newer version: 6.0.5
Show newest version
{"version":3,"file":"StreamSearchPage.b043f32647b23f30f1f9.js","mappings":"iNAsBA,MAYA,EAZ6B,CAC3BA,EACAC,EACAC,KAEOC,EAAAA,EAAAA,UACL,IAAMC,EAAAA,EAAAA,OAAmBC,EAAAA,EAAAA,KAAAA,OAAkBL,EAAUC,EAAWC,GAAaI,MAAK,QAAGC,KAAMC,GAAT,SAAiBA,CAAjB,KAElF,CAACR,G,4GCJL,MAAMS,EAAgB,QAAC,MAAEC,GAAH,SACpB,gBAAC,IAAD,CAAWC,MAAM,uBACNC,YAAa,yJACtB,2BACGF,aADH,EACGA,EAAOG,SAJQ,EA0CtB,EAjCoB,CAACN,EAAqBO,KACxC,MAAMC,GAAmBC,EAAAA,EAAAA,GAAkB,2BACrCC,GAAqBD,EAAAA,EAAAA,GAAkB,8BAEtCE,EAAQC,IAAaC,EAAAA,EAAAA,WAAS,IAC9BC,EAAeC,IAAoBF,EAAAA,EAAAA,eAASG,GAyBnD,OAvBAC,EAAAA,EAAAA,YAAU,MACRC,EAAAA,EAAAA,GACElB,EACAQ,EACAE,EACAH,GACA,KACEK,GAAU,GACVG,OAAiBC,EAAjB,IAEFG,OAAOC,IACHA,aAAaC,MACfN,EAAiB,gBAACb,EAAD,CAAeC,MAAOiB,KAKzCL,EAAiBK,EAAjB,GAhBF,GAoBF,CAACV,EAAoBF,EAAkBR,IAEhC,CAACW,EAAQG,EAAhB,C,yMC3BF,MAwBA,GAAeQ,EAAAA,EAAAA,IAAWC,EAAAA,EAAAA,IAxBD,IAA0D,IAAvDC,QAAQ,SAAE/B,GAAYgC,UAAU,MAAElB,IAAqB,EACjF,MAAM,UAAEb,EAAF,YAAaC,IAAgB+B,EAAAA,EAAAA,GAA8BnB,GAC3DoB,GAAUC,EAAAA,EAAAA,GAAqBnC,EAAUC,EAAWC,IACnDgB,EAAQkB,IAAiBC,EAAAA,EAAAA,GAAYH,EAASpB,GAE/CwB,GAAeC,EAAAA,EAAAA,cAAY,KAC/B,GAAIvC,EACF,OAAOwC,EAAAA,EAAAA,IAAqBxC,GAG9B,MAAM,IAAI4B,MAAM,0BAAhB,GACC,CAAC5B,IAEJ,OAAIoC,IAIClB,EAIE,gBAAC,IAAD,CAAYuB,YAAaH,IAHvB,gBAAC,IAAD,MAGT,I","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 '../../../hooks/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","v","LoadViewError","error","title","description","message","query","loadingViewHooks","usePluginEntities","executingViewHooks","loaded","setLoaded","useState","hookComponent","setHookComponent","undefined","useEffect","processHooks","catch","e","Error","withParams","withLocation","params","location","normalizeSearchURLQueryParams","newView","useCreateSavedSearch","HookComponent","useLoadView","_loadNewView","useCallback","loadNewViewForStream","loadNewView"],"sourceRoot":""}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy