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

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

There is a newer version: 6.1.4
Show newest version
{"version":3,"file":"StreamSearchPage.756ebeb7b78a13bd63d8.js","mappings":"uMA2BA,QANyBA,MAA+B,WAAQ,IAAMA,EAAY,KAAK,MAAOC,IAC5F,QAAM,KAAaA,EAAM,MAAM,EAExBA,EACR,EAAG,CAACD,CAAW,CAAC,C,0FCcjB,QAhB6B,CAAC,CAC5B,SAAAE,EACA,UAAAC,EACA,YAAAC,EACA,WAAAC,CACF,OAKM,WACJ,OAAM,KAAc,CAAE,KAAM,IAAK,KAAK,OAAQ,SAAAH,EAAU,UAAAC,EAAW,YAAAC,EAAa,WAAAC,CAAW,CAAC,EAE5F,CAAC,CACH,C,0HCVA,QAAe,MAAO,CACpB,KAAAC,EACA,SAAAJ,EACA,UAAAC,EACA,YAAAC,EACA,WAAAC,CACF,IAOK,CACH,MAAME,KAAQ,KAAeL,EAAU,OAAWC,EAAWC,CAAW,EAClEI,EAAS,IAAO,OAAO,EAAE,UAAU,EAAE,QAAQ,CAACD,CAAK,CAAC,EAAE,WAAWF,CAAU,EAC9E,MAAM,EACHI,EAAY,QAAM,KAAmBH,EAAMJ,CAAQ,EAEnDQ,EAAO,IAAK,OAAO,EACtB,UAAU,EACV,MAAM,EACN,KAAKJ,CAAI,EACT,MAAM,CAAE,CAACC,EAAM,EAAE,EAAGE,CAAU,CAAC,EAC/B,OAAOD,CAAM,EACb,MAAM,EAET,SAAO,KAAuBE,CAAI,CACpC,C,yLCVA,QAjByB,IAAM,CAC7B,KAAM,CAAE,SAAAR,CAAS,KAAI,KAAiC,EAChDS,KAAU,KAAW,EAE3B,GAAI,CAACT,EACH,MAAM,IAAI,MAAM,yBAAyB,EAG3C,KAAM,CAAE,UAAAC,EAAW,YAAAC,CAAY,KAAI,KAAwB,EACrDJ,KAAc,KAAqB,CAAE,SAAAE,EAAU,UAAAC,EAAW,YAAAC,CAAY,CAAC,EACvEM,KAAO,KAAgBV,CAAW,EAElCY,KAAe,eAAY,OAAM,MAAqBD,EAAST,CAAQ,EAAG,CAACS,EAAST,CAAQ,CAAC,EAEnG,OAAO,gBAAC,IAAU,CAAC,YAAaU,EAAc,KAAAF,EAAY,MAAK,GAAC,CAClE,C","sources":["webpack://graylog-web-interface/./src/views/hooks/useCreateSearch.tsx","webpack://graylog-web-interface/./src/views/logic/views/UseCreateSavedSearch.ts","webpack://graylog-web-interface/./src/views/logic/views/ViewGenerator.ts","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 createSearch from 'views/logic/slices/createSearch';\nimport type View from 'views/logic/views/View';\n\nconst useCreateSearch = (viewPromise: Promise) => useMemo(() => viewPromise.then(async (_view) => {\n  await createSearch(_view.search);\n\n  return _view;\n}), [viewPromise]);\n\nexport default useCreateSearch;\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 { useMemo } from 'react';\n\nimport View from 'views/logic/views/View';\nimport type { ElasticsearchQueryString, TimeRange } from 'views/logic/queries/Query';\nimport ViewGenerator from 'views/logic/views/ViewGenerator';\nimport type Parameter from 'views/logic/parameters/Parameter';\n\nconst useCreateSavedSearch = ({\n  streamId,\n  timeRange,\n  queryString,\n  parameters,\n}:{\n  streamId?: string | string[],\n  timeRange?: TimeRange,\n  queryString?: ElasticsearchQueryString,\n  parameters?: Array,\n}) => useMemo(\n  () => ViewGenerator({ type: View.Type.Search, streamId, timeRange, queryString, parameters }),\n  // eslint-disable-next-line react-hooks/exhaustive-deps\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 type { TimeRange, ElasticsearchQueryString } from 'views/logic/queries/Query';\nimport UpdateSearchForWidgets from 'views/logic/views/UpdateSearchForWidgets';\nimport type Parameter from 'views/logic/parameters/Parameter';\n\nimport View from './View';\nimport ViewStateGenerator from './ViewStateGenerator';\nimport type { ViewType } from './View';\n\nimport Search from '../search/Search';\nimport QueryGenerator from '../queries/QueryGenerator';\n\nexport default async ({\n  type,\n  streamId,\n  timeRange,\n  queryString,\n  parameters,\n}: {\n  type: ViewType,\n  streamId?: string | string[],\n  timeRange?: TimeRange,\n  queryString?: ElasticsearchQueryString,\n  parameters?: Array,\n},\n) => {\n  const query = QueryGenerator(streamId, undefined, timeRange, queryString);\n  const search = Search.create().toBuilder().queries([query]).parameters(parameters)\n    .build();\n  const viewState = await ViewStateGenerator(type, streamId);\n\n  const view = View.create()\n    .toBuilder()\n    .newId()\n    .type(type)\n    .state({ [query.id]: viewState })\n    .search(search)\n    .build();\n\n  return UpdateSearchForWidgets(view);\n};\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 useCreateSavedSearch from 'views/logic/views/UseCreateSavedSearch';\nimport { loadNewViewForStream } from 'views/logic/views/Actions';\nimport { useSearchURLQueryParams } from 'views/logic/NormalizeSearchURLQueryParams';\nimport useParams from 'routing/useParams';\nimport useHistory from 'routing/useHistory';\nimport useCreateSearch from 'views/hooks/useCreateSearch';\n\nimport SearchPage from './SearchPage';\n\nconst StreamSearchPage = () => {\n  const { streamId } = useParams<{ streamId?: string }>();\n  const history = useHistory();\n\n  if (!streamId) {\n    throw new Error('No stream id specified!');\n  }\n\n  const { timeRange, queryString } = useSearchURLQueryParams();\n  const viewPromise = useCreateSavedSearch({ streamId, timeRange, queryString });\n  const view = useCreateSearch(viewPromise);\n\n  const _loadNewView = useCallback(() => loadNewViewForStream(history, streamId), [history, streamId]);\n\n  return ;\n};\n\nexport default StreamSearchPage;\n"],"names":["viewPromise","_view","streamId","timeRange","queryString","parameters","type","query","search","viewState","view","history","_loadNewView"],"sourceRoot":""}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy