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,CAAC,4DAA4D,WAAa,MAE/U4G,EAAwBE,OAAS,CAChC,YAAe,wBAEhB,S,mFCPIF,E,MAA0B,GAA4B,KAE1DA,EAAwBF,KAAK,CAACG,EAAO7G,GAAI,uDAAwD,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,kEAAkE,MAAQ,GAAG,SAAW,yBAAyB,eAAiB,CAAC,qDAAqD,WAAa,MAEjU4G,EAAwBE,OAAS,CAChC,UAAa,wBAEd,S","sources":["webpack://graylog-web-interface/./src/components/common/withPaginationQueryParameter.tsx","webpack://graylog-web-interface/./src/components/sidecars/common/OperatingSystemIcon.tsx","webpack://graylog-web-interface/./src/components/sidecars/common/SidecarSearchForm.css?d4e1","webpack://graylog-web-interface/./src/components/sidecars/common/SidecarSearchForm.jsx","webpack://graylog-web-interface/./src/components/sidecars/common/StatusIndicator.css?5fd8","webpack://graylog-web-interface/./src/components/sidecars/common/StatusIndicator.tsx","webpack://graylog-web-interface/./src/logic/sidecar/SidecarStatusEnum.js","webpack://graylog-web-interface/./src/stores/sidecars/SidecarsStore.js","webpack://graylog-web-interface/./src/components/sidecars/common/SidecarSearchForm.css","webpack://graylog-web-interface/./src/components/sidecars/common/StatusIndicator.css"],"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 * as React from 'react';\n\nimport usePaginationQueryParameter from 'hooks/usePaginationQueryParameter';\n\nexport type PaginationQueryParameterObject = {\n pageSizes?: number[];\n};\n\nfunction withPaginationQueryParameter(Component: React.ComponentType, obj?: PaginationQueryParameterObject) {\n return function WrappedComponent(props) {\n const result = usePaginationQueryParameter(obj?.pageSizes);\n\n return ;\n };\n}\n\nexport default withPaginationQueryParameter;\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 PropTypes from 'prop-types';\nimport styled from 'styled-components';\n\nimport { Icon } from 'components/common';\n\nconst SidecarIcon = styled(Icon)`\n margin-right: 5px;\n margin-left: 2px;\n`;\n\ntype Props = {\n operatingSystem: string,\n};\n\nconst matchIcon = (os: string) => {\n if (os.includes('darwin') || os.includes('mac os')) {\n return {\n iconName: 'apple',\n iconType: 'brand',\n } as const;\n }\n\n if (os.includes('linux')) {\n return {\n iconName: 'linux',\n iconType: 'brand',\n } as const;\n }\n\n if (os.includes('win')) {\n return {\n iconName: 'windows',\n iconType: 'brand',\n } as const;\n }\n\n if (os.includes('freebsd')) {\n return {\n iconName: 'freebsd',\n iconType: 'brand',\n } as const;\n }\n\n return {\n iconName: 'question-circle',\n iconType: 'solid',\n } as const;\n};\n\nconst OperatingSystemIcon = ({ operatingSystem }: Props) => {\n const { iconName, iconType } = matchIcon(operatingSystem.trim().toLowerCase());\n\n return (\n \n );\n};\n\nOperatingSystemIcon.propTypes = {\n operatingSystem: PropTypes.string,\n};\n\nOperatingSystemIcon.defaultProps = {\n operatingSystem: undefined,\n};\n\nexport default OperatingSystemIcon;\n","\n import API from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[6].use[1]!./SidecarSearchForm.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[6].use[1]!./SidecarSearchForm.css\";\n export default content && content.locals ? content.locals : undefined;\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 React from 'react';\nimport PropTypes from 'prop-types';\n\nimport { OverlayTrigger, SearchForm, Icon } from 'components/common';\nimport { Popover, Table, Button } from 'components/bootstrap';\n\nimport style from './SidecarSearchForm.css';\n\nclass SidecarSearchForm extends React.Component {\n static propTypes = {\n query: PropTypes.string.isRequired,\n onSearch: PropTypes.func.isRequired,\n onReset: PropTypes.func.isRequired,\n children: PropTypes.element,\n };\n\n static defaultProps = {\n children: undefined,\n };\n\n render() {\n const { query, onSearch, onReset, children } = this.props;\n\n const queryHelpPopover = (\n \n Available search fields
\n \n \n \n Field \n Description \n \n \n \n \n name \n Sidecar name \n \n \n status \n Status of the sidecar as it appears in the list, i.e. running, failing, or unknown \n \n \n operating_system \n Operating system the sidecar is running on \n \n \n last_seen \n Date and time when the sidecar last communicated with Graylog \n \n \n node_id \n Identifier of the sidecar \n \n \n sidecar_version \n Sidecar version \n \n \n
\n Examples
\n \n Find sidecars that did not communicate with Graylog since a date:
\n {'last_seen:<=2018-04-10'}
\n
\n \n Find sidecars with failing
or unknown
status:
\n status:failing status:unknown
\n
\n \n );\n\n const queryHelp = (\n \n \n \n );\n\n return (\n \n {children}\n \n );\n }\n}\n\nexport default SidecarSearchForm;\n","\n import API from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[6].use[1]!./StatusIndicator.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[6].use[1]!./StatusIndicator.css\";\n export default content && content.locals ? content.locals : undefined;\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 React from 'react';\nimport PropTypes from 'prop-types';\nimport lodash from 'lodash';\n\nimport { Popover } from 'components/bootstrap';\nimport { OverlayTrigger, Icon } from 'components/common';\nimport SidecarStatusEnum from 'logic/sidecar/SidecarStatusEnum';\nimport { relativeDifference } from 'util/DateTime';\nimport useUserDateTime from 'hooks/useUserDateTime';\n\nimport style from './StatusIndicator.css';\n\ntype Props = {\n message: string,\n status: number,\n lastSeen: string,\n id: string,\n}\n\nconst StatusIndicator = ({ message: messageProp, status, lastSeen, id }: Props) => {\n const { toUserTimezone } = useUserDateTime();\n let message = messageProp;\n const text = lodash.upperFirst(SidecarStatusEnum.toString(status));\n const lastSeenDateTime = toUserTimezone(lastSeen);\n\n let icon;\n let className;\n\n switch (status) {\n case SidecarStatusEnum.RUNNING:\n className = 'text-success';\n icon = 'play';\n break;\n case SidecarStatusEnum.FAILING:\n className = 'text-danger';\n icon = 'exclamation-triangle';\n break;\n case SidecarStatusEnum.STOPPED:\n className = 'text-danger';\n icon = 'stop';\n break;\n default:\n className = 'text-info';\n icon = 'question-circle';\n message += ` (${relativeDifference(lastSeenDateTime)})`;\n }\n\n if (message && id) {\n const popover = (\n \n {message}\n \n );\n\n return (\n \n \n {text}\n \n \n );\n }\n\n return (\n \n {text}\n \n );\n};\n\nStatusIndicator.propTypes = {\n id: PropTypes.string,\n lastSeen: PropTypes.string,\n message: PropTypes.string,\n status: PropTypes.number,\n};\n\nStatusIndicator.defaultProps = {\n id: '',\n lastSeen: undefined,\n message: '',\n status: -1,\n};\n\nexport default StatusIndicator;\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 lodash from 'lodash';\n\nconst SidecarStatusEnum = {\n RUNNING: 0,\n UNKNOWN: 1,\n FAILING: 2,\n STOPPED: 3,\n properties: {\n 0: { name: 'running' },\n 1: { name: 'unknown' },\n 2: { name: 'failing' },\n 3: { name: 'stopped' },\n },\n\n isValidStatusCode(statusCode) {\n return Object.keys(this.properties).includes(String(statusCode));\n },\n\n toStatusCode(stringStatus) {\n const status = lodash.lowerCase(stringStatus);\n\n if (status === this.properties[this.RUNNING].name) {\n return this.RUNNING;\n }\n\n if (status === this.properties[this.FAILING].name) {\n return this.FAILING;\n }\n\n if (status === this.properties[this.STOPPED].name) {\n return this.STOPPED;\n }\n\n return this.UNKNOWN;\n },\n\n toString(statusCode) {\n switch (lodash.toNumber(statusCode)) {\n case this.RUNNING:\n return 'running';\n case this.FAILING:\n return 'failing';\n case this.STOPPED:\n return 'stopped';\n default:\n return 'unknown';\n }\n },\n};\n\nexport default SidecarStatusEnum;\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 Reflux from 'reflux';\nimport URI from 'urijs';\n\nimport * as URLUtils from 'util/URLUtils';\nimport UserNotification from 'util/UserNotification';\nimport fetch, { fetchPeriodically } from 'logic/rest/FetchProvider';\nimport { singletonStore, singletonActions } from 'logic/singleton';\n\nexport const SidecarsActions = singletonActions(\n 'core.Sidecars',\n () => Reflux.createActions({\n listPaginated: { asyncResult: true },\n getSidecar: { asyncResult: true },\n getSidecarActions: { asyncResult: true },\n restartCollector: { asyncResult: true },\n assignConfigurations: { asyncResult: true },\n }),\n);\n\nexport const SidecarsStore = singletonStore(\n 'core.Sidecars',\n () => Reflux.createStore({\n listenables: [SidecarsActions],\n sourceUrl: '/sidecars',\n sidecars: undefined,\n onlyActive: undefined,\n pagination: {\n count: undefined,\n page: undefined,\n pageSize: undefined,\n total: undefined,\n },\n query: undefined,\n sort: {\n field: undefined,\n order: undefined,\n },\n\n init() {\n this.propagateChanges();\n },\n\n propagateChanges() {\n this.trigger({\n sidecars: this.sidecars,\n query: this.query,\n onlyActive: this.onlyActive,\n pagination: this.pagination,\n sort: this.sort,\n });\n },\n\n listPaginated({ query = '', page = 1, pageSize = 50, onlyActive = false, sortField = 'node_name', order = 'asc' }) {\n const search = {\n query: query,\n page: page,\n per_page: pageSize,\n only_active: onlyActive,\n sort: sortField,\n order: order,\n };\n\n const uri = URI(this.sourceUrl).search(search).toString();\n const promise = fetchPeriodically('GET', URLUtils.qualifyUrl(uri));\n\n promise.then(\n (response) => {\n this.sidecars = response.sidecars;\n this.query = response.query;\n this.onlyActive = response.only_active;\n\n this.pagination = {\n total: response.pagination.total,\n count: response.pagination.count,\n page: response.pagination.page,\n pageSize: response.pagination.per_page,\n };\n\n this.sort = {\n field: response.sort,\n order: response.order,\n };\n\n this.propagateChanges();\n\n return response;\n },\n (error) => {\n UserNotification.error(error.status === 400 ? error.responseMessage : `Fetching Sidecars failed with status: ${error.message}`,\n 'Could not retrieve Sidecars');\n },\n );\n\n SidecarsActions.listPaginated.promise(promise);\n },\n\n getSidecar(sidecarId) {\n const promise = fetchPeriodically('GET', URLUtils.qualifyUrl(`${this.sourceUrl}/${sidecarId}`));\n\n promise.catch((error) => {\n let errorMessage = `Fetching Sidecar failed with status: ${error}`;\n\n if (error.status === 404) {\n errorMessage = `Unable to find a sidecar with ID <${sidecarId}>, maybe it was inactive for too long.`;\n }\n\n UserNotification.error(errorMessage, 'Could not retrieve Sidecar');\n });\n\n SidecarsActions.getSidecar.promise(promise);\n },\n\n restartCollector(sidecarId, collector) {\n const action = {};\n\n action.collector = collector;\n action.properties = {};\n action.properties.restart = true;\n const promise = fetch('PUT', URLUtils.qualifyUrl(`${this.sourceUrl}/${sidecarId}/action`), [action]);\n\n promise\n .catch(\n (error) => {\n UserNotification.error(`Restarting Sidecar failed with status: ${error}`,\n 'Could not restart Sidecar');\n },\n );\n\n SidecarsActions.restartCollector.promise(promise);\n },\n\n getSidecarActions(sidecarId) {\n const promise = fetchPeriodically('GET', URLUtils.qualifyUrl(`${this.sourceUrl}/${sidecarId}/action`));\n\n promise\n .catch(\n (error) => {\n UserNotification.error(`Fetching Sidecar actions failed with status: ${error}`,\n 'Could not retrieve Sidecar actions');\n },\n );\n\n SidecarsActions.getSidecarActions.promise(promise);\n },\n\n toConfigurationAssignmentDto(nodeId, collectorId, configurationId) {\n return {\n node_id: nodeId,\n collector_id: collectorId,\n configuration_id: configurationId,\n };\n },\n\n assignConfigurations(sidecars, configurations) {\n const nodes = sidecars.map(({ sidecar, collector }) => {\n // Add all previous assignments, but the one that was changed\n const assignments = sidecar.assignments.filter((assignment) => assignment.collector_id !== collector.id);\n\n // Add new assignments\n configurations.forEach((configuration) => {\n assignments.push({ collector_id: collector.id, configuration_id: configuration.id });\n });\n\n return { node_id: sidecar.node_id, assignments: assignments };\n });\n\n const promise = fetch('PUT', URLUtils.qualifyUrl(`${this.sourceUrl}/configurations`), { nodes: nodes });\n\n promise\n .then(\n (response) => {\n UserNotification.success('', `Configuration change for ${sidecars.length} collectors requested`);\n\n return response;\n },\n (error) => {\n UserNotification.error(`Fetching Sidecar actions failed with status: ${error}`,\n 'Could not retrieve Sidecar actions');\n },\n );\n\n SidecarsActions.assignConfigurations.promise(promise);\n },\n }),\n);\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".popover.i3CKk4UXmnkyBYYZ5r2x {\\n max-width: 500px;\\n}\", \"\",{\"version\":3,\"sources\":[\"webpack://./src/components/sidecars/common/SidecarSearchForm.css\"],\"names\":[],\"mappings\":\"AAAA;IACI,gBAAgB;AACpB\",\"sourcesContent\":[\".popover:local(.popoverWide) {\\n max-width: 500px;\\n}\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"popoverWide\": \"i3CKk4UXmnkyBYYZ5r2x\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".xUMQPeRwYREG_QMMJHzD {\\n white-space: nowrap;\\n}\", \"\",{\"version\":3,\"sources\":[\"webpack://./src/components/sidecars/common/StatusIndicator.css\"],\"names\":[],\"mappings\":\"AAAA;IACI,mBAAmB;AACvB\",\"sourcesContent\":[\":local(.indicator) {\\n white-space: nowrap;\\n}\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"indicator\": \"xUMQPeRwYREG_QMMJHzD\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n"],"names":["Component","obj","props","result","usePaginationQueryParameter","pageSizes","paginationQueryParameter","SidecarIcon","styled","Icon","OperatingSystemIcon","operatingSystem","iconName","iconType","os","trim","toLowerCase","includes","name","type","fixedWidth","propTypes","PropTypes","defaultProps","undefined","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","SidecarSearchForm","React","render","query","onSearch","onReset","children","this","queryHelpPopover","id","className","style","title","condensed","queryHelp","trigger","rootClose","placement","overlay","bsStyle","searchButtonLabel","placeholder","queryWidth","queryHelpComponent","topMargin","useLoadingState","StatusIndicator","message","messageProp","status","lastSeen","toUserTimezone","useUserDateTime","text","lodash","SidecarStatusEnum","lastSeenDateTime","icon","relativeDifference","popover","RUNNING","UNKNOWN","FAILING","STOPPED","properties","isValidStatusCode","statusCode","Object","keys","String","toStatusCode","stringStatus","toString","SidecarsActions","singletonActions","Reflux","listPaginated","asyncResult","getSidecar","getSidecarActions","restartCollector","assignConfigurations","SidecarsStore","singletonStore","listenables","sourceUrl","sidecars","onlyActive","pagination","count","page","pageSize","total","sort","field","order","init","propagateChanges","sortField","search","per_page","only_active","uri","URI","promise","fetchPeriodically","URLUtils","then","response","error","UserNotification","responseMessage","sidecarId","catch","errorMessage","collector","action","restart","fetch","toConfigurationAssignmentDto","nodeId","collectorId","configurationId","node_id","collector_id","configuration_id","configurations","nodes","map","sidecar","assignments","filter","assignment","forEach","configuration","push","length","___CSS_LOADER_EXPORT___","module","locals"],"sourceRoot":""}