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,WAAW,IAAKC,GAAU,IAAU,SAASA,CAAK,CAAC,EAC1E,kBAAmB,QAAwC,OAAO,SAA4C,EAAAD,EAAW,oBAAX,OAAgC,CAAC,CAAC,EAAE,IAChJ,CAAC,CAACE,EAAWC,CAAY,IAAO,CAACD,EAAW,IAAiB,SAASC,CAAY,CAAC,CACrF,CAAC,CACH,CAEJ,CAEA,MAAO,CAAE,WAAY,OAAW,kBAAmB,MAAU,CAC/D,EAAG,CAACL,CAAS,CAAC,CAChB,EAWA,EATsB,IAAM,CAC1B,KAAM,CAAE,WAAAP,EAAY,kBAAAa,CAAkB,EAAIP,EAAuB,EAC3D,CAAE,UAAAR,EAAW,YAAAC,EAAa,QAAAe,CAAQ,KAAI,KAAwB,EAC9DnB,KAAc,KAAqB,CAAE,SAAUmB,EAAS,UAAAhB,EAAW,YAAAC,EAAa,WAAAC,CAAW,CAAC,EAC5FK,KAAO,KAAgBV,CAAW,EAExC,OAAO,gBAAC,IAAU,CAAC,KAAAU,EAAY,eAAgB,KAAqB,OAAOQ,CAAiB,EAAG,MAAK,GAAC,CACvG,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/NewSearchPage.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 Immutable from 'immutable';\nimport { useMemo } from 'react';\n\nimport useCreateSavedSearch from 'views/logic/views/UseCreateSavedSearch';\nimport { useSearchURLQueryParams } from 'views/logic/NormalizeSearchURLQueryParams';\nimport useCreateSearch from 'views/hooks/useCreateSearch';\nimport useQuery from 'routing/useQuery';\nimport Store from 'logic/local-storage/Store';\nimport Parameter from 'views/logic/parameters/Parameter';\nimport type { ParameterBindingJsonRepresentation } from 'views/logic/parameters/ParameterBinding';\nimport ParameterBinding from 'views/logic/parameters/ParameterBinding';\nimport SearchExecutionState from 'views/logic/search/SearchExecutionState';\n\nimport SearchPage from './SearchPage';\n\nconst useParametersFromStore = () => {\n const { 'session-id': sessionId } = useQuery();\n\n return useMemo(() => {\n if (sessionId) {\n const searchDataFromStore = Store.get(sessionId);\n Store.delete(sessionId);\n\n const searchData = searchDataFromStore ? JSON.parse(searchDataFromStore) : undefined;\n\n if (searchData?.parameters) {\n return {\n parameters: searchData.parameters.map((param) => Parameter.fromJSON(param)),\n parameterBindings: Immutable.Map(Object.entries(searchData.parameterBindings ?? {}).map(\n ([paramName, paramBinding]) => ([paramName, ParameterBinding.fromJSON(paramBinding)]),\n )),\n };\n }\n }\n\n return { parameters: undefined, parameterBindings: undefined };\n }, [sessionId]);\n};\n\nconst NewSearchPage = () => {\n const { parameters, parameterBindings } = useParametersFromStore();\n const { timeRange, queryString, streams } = useSearchURLQueryParams();\n const viewPromise = useCreateSavedSearch({ streamId: streams, timeRange, queryString, parameters });\n const view = useCreateSearch(viewPromise);\n\n return ;\n};\n\nexport default NewSearchPage;\n"],"names":["viewPromise","_view","streamId","timeRange","queryString","parameters","type","query","search","viewState","view","useParametersFromStore","sessionId","searchDataFromStore","searchData","param","paramName","paramBinding","parameterBindings","streams"],"sourceRoot":""}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy