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

web-interface.assets.b6fe2bb5-7733.1e16325a5d1a31c26078.js.map Maven / Gradle / Ivy

{"version":3,"file":"b6fe2bb5-7733.1e16325a5d1a31c26078.js","mappings":"2PAsCMA,EAAiBC,EAAAA,QAAAA,KAAAA,WAAH,qEAAGA,EAAY,YAA0C,IAAvCC,EAAuC,EAAvCA,KACpC,EAD2E,EAAjCC,MACNC,MAAMF,KAAlCG,EAAR,EAAQA,KAAMC,EAAd,EAAcA,MAAOC,EAArB,EAAqBA,KACfC,EAAoB,UAATN,EAAmBI,EAAQD,EAE5C,OAAOI,EAAAA,EAAAA,KAAP,yCAEwB,WAATP,EAAoBK,EAAOC,MAItCE,EAAa,SAAC,GAAkD,IAAhDC,EAAgD,EAAhDA,MAAOT,EAAyC,EAAzCA,KAAMU,EAAmC,EAAnCA,KAAMT,EAA6B,EAA7BA,MACjCU,EAAcV,EAAMW,MAAMC,WAAWJ,EAAO,GAC5CK,EAAYb,EAAMW,MAAMG,iBAAiBN,GAE/C,OACE,gBAACX,EAAD,CAAgBE,KAAMA,GACpB,gBAAC,KAAD,CAAOgB,MAAO,CACZC,gBAAiBR,EACjBS,OAAQ,aAAF,OAAeP,GACrBF,MAAOK,IAENJ,KAMTF,EAAWW,UAAY,CACrBV,MAAOW,IAAAA,OAAAA,WACPV,KAAMU,IAAAA,UAAoB,CAACA,IAAAA,OAAkBA,IAAAA,UAC7CpB,KAAMoB,IAAAA,MAAgB,CAAC,SAAU,QAAS,WAC1CnB,MAAOoB,EAAAA,GAAAA,YAGTb,EAAWc,aAAe,CACxBZ,KAAM,iCACNV,KAAM,UAGR,SAAeuB,EAAAA,EAAAA,WAAUf,I,2LCpDZgB,GAAiCC,EAAAA,EAAAA,IAC5C,gCACA,kBAAMC,IAAAA,cAAqB,CACzBC,IAAK,CAAEC,aAAa,GACpBC,KAAM,CAAED,aAAa,GACrBE,YAAa,CAAEF,aAAa,GAC5BG,iBAAkB,CAAEH,aAAa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AA,EAAAA,QAAyB,GAAzB,qBAA2CY,EAA3C,0BACA,EAAKX,cAEEH,KACN,SAACC,GACFC,EAAAA,EAAAA,MAAA,4BAA4CY,EAA5C,iCAAyEb,EAAMW,SAC7E,+BAGNM,EAAkBI,KAAKxB,QAAQA,IAGjC1B,SA/LuB,SA+LdyD,GAEP,IAAMd,EAAU,CACdF,GAAI,IACJiB,aAAc,OACdC,gBAAiB,IACjBC,iBAAkB,KAGpBf,IAAAA,MAAaF,EAASc,GAEtB,IAAM/B,GAAUH,EAAAA,EAAAA,IAAM,OAAQC,EAAAA,GAAA,UAAuBV,KAAKV,UAA5B,yBAA8DuC,GAE5FjB,EACGC,MACC,SAACC,GAAD,OAAcA,KACd,SAACC,GAAD,OACEC,EAAAA,EAAAA,MAAA,gCAAgDa,EAAQD,KAAxD,iCAAqFb,EAAMW,SACzF,mCAIRM,EAAkB9C,SAAS0B,QAAQA","sources":["webpack://graylog-web-interface/./src/components/sidecars/common/ColorLabel.tsx","webpack://graylog-web-interface/./src/stores/sidecars/CollectorConfigurationsStore.js","webpack://graylog-web-interface/./src/stores/sidecars/CollectorsStore.js"],"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 React from 'react';\nimport PropTypes from 'prop-types';\nimport type { DefaultTheme } from 'styled-components';\nimport styled, { css, withTheme } from 'styled-components';\n\nimport { themePropTypes } from 'theme';\nimport { Label } from 'components/bootstrap';\n\ntype Size = 'normal' | 'small' | 'xsmall';\n\ninterface ColorLabelWrapProps {\n  size: Size,\n  theme: DefaultTheme\n}\n\ninterface ColorLabelProps {\n  color: string,\n  size?: Size,\n  text?: string | React.ReactNode,\n  theme: DefaultTheme\n}\n\nconst ColorLabelWrap = styled.span(({ size, theme }: ColorLabelWrapProps) => {\n  const { body, small, tiny } = theme.fonts.size;\n  const fontSize = size === 'small' ? small : body;\n\n  return css`\n    vertical-align: middle;\n    font-size: ${size === 'xsmall' ? tiny : fontSize};\n  `;\n});\n\nconst ColorLabel = ({ color, size, text, theme }: ColorLabelProps) => {\n  const borderColor = theme.utils.colorLevel(color, 5);\n  const textColor = theme.utils.contrastingColor(color);\n\n  return (\n    \n      \n    \n  );\n};\n\nColorLabel.propTypes = {\n  color: PropTypes.string.isRequired,\n  text: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n  size: PropTypes.oneOf(['normal', 'small', 'xsmall']),\n  theme: themePropTypes.isRequired,\n};\n\nColorLabel.defaultProps = {\n  text: ,\n  size: 'normal',\n};\n\nexport default withTheme(ColorLabel);\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';\nimport lodash from 'lodash';\n\nimport * as URLUtils from 'util/URLUtils';\nimport UserNotification from 'util/UserNotification';\nimport fetch from 'logic/rest/FetchProvider';\nimport { singletonStore, singletonActions } from 'logic/singleton';\n\nexport const CollectorConfigurationsActions = singletonActions(\n  'core.CollectorConfigurations',\n  () => Reflux.createActions({\n    all: { asyncResult: true },\n    list: { asyncResult: true },\n    listUploads: { asyncResult: true },\n    getConfiguration: { asyncResult: true },\n    getConfigurationSidecars: { asyncResult: true },\n    getUploads: { asyncResult: true },\n    createConfiguration: { asyncResult: true },\n    updateConfiguration: { asyncResult: true },\n    renderPreview: { asyncResult: true },\n    copyConfiguration: { asyncResult: true },\n    delete: { asyncResult: true },\n    validate: { asyncResult: true },\n  }),\n);\n\nexport const CollectorConfigurationsStore = singletonStore(\n  'core.CollectorConfigurations',\n  () => Reflux.createStore({\n    listenables: [CollectorConfigurationsActions],\n    sourceUrl: '/sidecar',\n    configurations: undefined,\n    pagination: {\n      page: undefined,\n      pageSize: undefined,\n      total: undefined,\n    },\n    total: undefined,\n    paginatedConfigurations: undefined,\n    query: undefined,\n\n    propagateChanges() {\n      this.trigger({\n        configurations: this.configurations,\n        query: this.query,\n        total: this.total,\n        pagination: this.pagination,\n        paginatedConfigurations: this.paginatedConfigurations,\n      });\n    },\n\n    _fetchConfigurations({ query, page, pageSize }) {\n      const baseUrl = `${this.sourceUrl}/configurations`;\n      const search = {\n        query: query,\n        page: page,\n        per_page: pageSize,\n      };\n\n      const uri = URI(baseUrl).search(search).toString();\n\n      return fetch('GET', URLUtils.qualifyUrl(uri));\n    },\n\n    _fetchUploads({ page }) {\n      const baseUrl = `${this.sourceUrl}/configurations/uploads`;\n      const search = {\n        page: page,\n      };\n\n      const uri = URI(baseUrl).search(search).toString();\n\n      return fetch('GET', URLUtils.qualifyUrl(uri));\n    },\n\n    all() {\n      const promise = this._fetchConfigurations({ pageSize: 0 });\n\n      promise\n        .then(\n          (response) => {\n            this.configurations = response.configurations;\n            this.propagateChanges();\n\n            return response.configurations;\n          },\n          (error) => {\n            UserNotification.error(`Fetching collector configurations failed with status: ${error}`,\n              'Could not retrieve configurations');\n          },\n        );\n\n      CollectorConfigurationsActions.all.promise(promise);\n    },\n\n    list({ query = '', page = 1, pageSize = 10 }) {\n      const promise = this._fetchConfigurations({ query: query, page: page, pageSize: pageSize });\n\n      promise\n        .then(\n          (response) => {\n            this.query = response.query;\n\n            this.pagination = {\n              page: response.pagination.page,\n              pageSize: response.pagination.per_page,\n              total: response.pagination.total,\n            };\n\n            this.total = response.total;\n            this.paginatedConfigurations = response.configurations;\n            this.propagateChanges();\n\n            return response.configurations;\n          },\n          (error) => {\n            UserNotification.error(`Fetching collector configurations failed with status: ${error}`,\n              'Could not retrieve configurations');\n          },\n        );\n\n      CollectorConfigurationsActions.list.promise(promise);\n    },\n\n    listUploads({ page = 1 }) {\n      const promise = this._fetchUploads({ page: page });\n\n      promise\n        .catch(\n          (error) => {\n            UserNotification.error(`Fetching configuration uploads failed with status: ${error}`,\n              'Could not retrieve configurations');\n          },\n        );\n\n      CollectorConfigurationsActions.listUploads.promise(promise);\n    },\n\n    refreshList() {\n      this.list({ query: this.query, page: this.page, pageSize: this.pageSize });\n    },\n\n    getConfiguration(configurationId) {\n      const promise = fetch('GET', URLUtils.qualifyUrl(`${this.sourceUrl}/configurations/${configurationId}`));\n\n      promise.catch((error) => {\n        let errorMessage = `Fetching Configuration failed with status: ${error}`;\n\n        if (error.status === 404) {\n          errorMessage = `Unable to find a Configuration with ID <${configurationId}>, please ensure it was not deleted.`;\n        }\n\n        UserNotification.error(errorMessage, 'Could not retrieve Configuration');\n      });\n\n      CollectorConfigurationsActions.getConfiguration.promise(promise);\n    },\n\n    getConfigurationSidecars(configurationId) {\n      const promise = fetch('GET', URLUtils.qualifyUrl(`${this.sourceUrl}/configurations/${configurationId}/sidecars`));\n\n      promise.catch((error) => {\n        let errorMessage = `Fetching Configuration failed with status: ${error}`;\n\n        if (error.status === 404) {\n          errorMessage = `Unable to find a Configuration with ID <${configurationId}>, please ensure it was not deleted.`;\n        }\n\n        UserNotification.error(errorMessage, 'Could not retrieve Configuration');\n      });\n\n      CollectorConfigurationsActions.getConfigurationSidecars.promise(promise);\n    },\n\n    renderPreview(template) {\n      const requestTemplate = {\n        template: template,\n      };\n\n      const promise = fetch(\n        'POST',\n        URLUtils.qualifyUrl(`${this.sourceUrl}/configurations/render/preview`),\n        requestTemplate,\n      );\n\n      promise\n        .catch(\n          (error) => {\n            UserNotification.error(`Fetching configuration preview failed with status: ${error}`,\n              'Could not retrieve preview');\n          },\n        );\n\n      CollectorConfigurationsActions.renderPreview.promise(promise);\n    },\n\n    createConfiguration(configuration) {\n      const url = URLUtils.qualifyUrl(`${this.sourceUrl}/configurations`);\n      const method = 'POST';\n\n      const promise = fetch(method, url, configuration);\n\n      promise\n        .then((response) => {\n          UserNotification.success('', 'Configuration successfully created');\n\n          return response;\n        }, (error) => {\n          UserNotification.error(error.status === 400 ? error.responseMessage : `Creating configuration failed with status: ${error.message}`,\n            'Could not save configuration');\n        });\n\n      CollectorConfigurationsActions.createConfiguration.promise(promise);\n    },\n\n    updateConfiguration(configuration) {\n      const url = URLUtils.qualifyUrl(`${this.sourceUrl}/configurations/${configuration.id}`);\n\n      const promise = fetch('PUT', url, configuration);\n\n      promise\n        .then((response) => {\n          UserNotification.success('', 'Configuration successfully updated');\n          this.refreshList();\n\n          return response;\n        }, (error) => {\n          UserNotification.error(`Updating Configuration failed: ${error.status === 400 ? error.responseMessage : error.message}`,\n            `Could not update Configuration ${configuration.name}`);\n        });\n\n      CollectorConfigurationsActions.updateConfiguration.promise(promise);\n    },\n\n    copyConfiguration(configurationId, name) {\n      const url = URLUtils.qualifyUrl(`${this.sourceUrl}/configurations/${configurationId}/${name}`);\n      const method = 'POST';\n\n      const promise = fetch(method, url);\n\n      promise\n        .then((response) => {\n          UserNotification.success('', `Configuration \"${name}\" successfully copied`);\n          this.refreshList();\n\n          return response;\n        }, (error) => {\n          UserNotification.error(`Saving configuration \"${name}\" failed with status: ${error.message}`,\n            'Could not save Configuration');\n        });\n\n      CollectorConfigurationsActions.copyConfiguration.promise(promise);\n    },\n\n    delete(configuration) {\n      const url = URLUtils.qualifyUrl(`${this.sourceUrl}/configurations/${configuration.id}`);\n      const promise = fetch('DELETE', url);\n\n      promise\n        .then((response) => {\n          UserNotification.success('', `Configuration \"${configuration.name}\" successfully deleted`);\n          this.refreshList();\n\n          return response;\n        }, (error) => {\n          UserNotification.error(`Deleting Configuration failed: ${error.status === 400 ? error.responseMessage : error.message}`,\n            `Could not delete Configuration ${configuration.name}`);\n        });\n\n      CollectorConfigurationsActions.delete.promise(promise);\n    },\n\n    validate(configuration) {\n    // set minimum api defaults for faster validation feedback\n      const payload = {\n        name: ' ',\n        collector_id: ' ',\n        color: ' ',\n        template: ' ',\n      };\n\n      lodash.merge(payload, configuration);\n\n      const promise = fetch('POST', URLUtils.qualifyUrl(`${this.sourceUrl}/configurations/validate`), payload);\n\n      promise\n        .then(\n          (response) => response,\n          (error) => (\n            UserNotification.error(`Validating configuration \"${payload.name}\" failed with status: ${error.message}`,\n              'Could not validate configuration')\n          ),\n        );\n\n      CollectorConfigurationsActions.validate.promise(promise);\n    },\n\n  }),\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 Reflux from 'reflux';\nimport URI from 'urijs';\nimport lodash from 'lodash';\n\nimport * as URLUtils from 'util/URLUtils';\nimport fetch from 'logic/rest/FetchProvider';\nimport UserNotification from 'util/UserNotification';\nimport { singletonStore, singletonActions } from 'logic/singleton';\n\nexport const CollectorsActions = singletonActions(\n  'core.Collectors',\n  () => Reflux.createActions({\n    getCollector: { asyncResult: true },\n    all: { asyncResult: true },\n    list: { asyncResult: true },\n    create: { asyncResult: true },\n    update: { asyncResult: true },\n    delete: { asyncResult: true },\n    copy: { asyncResult: true },\n    validate: { asyncResult: true },\n  }),\n);\n\nexport const CollectorsStore = singletonStore(\n  'core.Collectors',\n  () => Reflux.createStore({\n    listenables: [CollectorsActions],\n    sourceUrl: '/sidecar',\n    collectors: undefined,\n    query: undefined,\n    pagination: {\n      page: undefined,\n      pageSize: undefined,\n      total: undefined,\n    },\n    total: undefined,\n    paginatedCollectors: undefined,\n\n    getInitialState() {\n      return {\n        collectors: this.collectors,\n      };\n    },\n\n    propagateChanges() {\n      this.trigger({\n        collectors: this.collectors,\n        paginatedCollectors: this.paginatedCollectors,\n        query: this.query,\n        total: this.total,\n        pagination: this.pagination,\n      });\n    },\n\n    getCollector(collectorId) {\n      const promise = fetch('GET', URLUtils.qualifyUrl(`${this.sourceUrl}/collectors/${collectorId}`));\n\n      promise.catch((error) => {\n        let errorMessage = `Fetching Collector failed with status: ${error}`;\n\n        if (error.status === 404) {\n          errorMessage = `Unable to find a collector with ID <${collectorId}>, please ensure it was not deleted.`;\n        }\n\n        UserNotification.error(errorMessage, 'Could not retrieve Collector');\n      });\n\n      CollectorsActions.getCollector.promise(promise);\n    },\n\n    _fetchCollectors({ query, page, pageSize }) {\n      const search = {\n        query: query,\n        page: page,\n        per_page: pageSize,\n      };\n\n      const uri = URI(`${this.sourceUrl}/collectors/summary`).search(search).toString();\n\n      return fetch('GET', URLUtils.qualifyUrl(uri));\n    },\n\n    all() {\n      const promise = this._fetchCollectors({ pageSize: 0 });\n\n      promise\n        .then(\n          (response) => {\n            this.collectors = response.collectors;\n            this.propagateChanges();\n\n            return response.collectors;\n          },\n          (error) => {\n            UserNotification.error(`Fetching collectors failed with status: ${error}`,\n              'Could not retrieve collectors');\n          },\n        );\n\n      CollectorsActions.all.promise(promise);\n    },\n\n    list({ query = '', page = 1, pageSize = 10 }) {\n      const promise = this._fetchCollectors({ query: query, page: page, pageSize: pageSize });\n\n      promise\n        .then(\n          (response) => {\n            this.query = response.query;\n\n            this.pagination = {\n              page: response.pagination.page,\n              pageSize: response.pagination.per_page,\n              total: response.pagination.total,\n            };\n\n            this.total = response.total;\n            this.paginatedCollectors = response.collectors;\n\n            this.propagateChanges();\n\n            return response.collectors;\n          },\n          (error) => {\n            UserNotification.error(`Fetching collectors failed with status: ${error}`,\n              'Could not retrieve collectors');\n          },\n        );\n\n      CollectorsActions.list.promise(promise);\n    },\n\n    refreshList() {\n      this.list({ query: this.query, page: this.pagination.page, pageSize: this.pagination.pageSize });\n    },\n\n    create(collector) {\n      const promise = fetch('POST', URLUtils.qualifyUrl(`${this.sourceUrl}/collectors`), collector);\n\n      promise\n        .then(\n          (response) => {\n            UserNotification.success('', 'Collector successfully created');\n            this.collectors = response.collectors;\n            this.propagateChanges();\n\n            return this.collectors;\n          },\n          (error) => {\n            UserNotification.error(`Fetching collectors failed with status: ${error}`,\n              'Could not retrieve collectors');\n          },\n        );\n\n      CollectorsActions.create.promise(promise);\n    },\n\n    update(collector) {\n      const promise = fetch('PUT', URLUtils.qualifyUrl(`${this.sourceUrl}/collectors/${collector.id}`), collector);\n\n      promise\n        .then(\n          (response) => {\n            UserNotification.success('', 'Collector successfully updated');\n            this.collectors = response.collectors;\n            this.propagateChanges();\n\n            return this.collectors;\n          },\n          (error) => {\n            UserNotification.error(`Fetching collectors failed with status: ${error}`,\n              'Could not retrieve collectors');\n          },\n        );\n\n      CollectorsActions.update.promise(promise);\n    },\n\n    delete(collector) {\n      const url = URLUtils.qualifyUrl(`${this.sourceUrl}/collectors/${collector.id}`);\n      const promise = fetch('DELETE', url);\n\n      promise\n        .then((response) => {\n          UserNotification.success('', `Collector \"${collector.name}\" successfully deleted`);\n          this.refreshList();\n\n          return response;\n        }, (error) => {\n          UserNotification.error(`Deleting Collector failed: ${error.status === 400 ? error.responseMessage : error.message}`,\n            `Could not delete Collector \"${collector.name}\"`);\n        });\n\n      CollectorsActions.delete.promise(promise);\n    },\n\n    copy(collectorId, name) {\n      const url = URLUtils.qualifyUrl(`${this.sourceUrl}/collectors/${collectorId}/${name}`);\n      const method = 'POST';\n\n      const promise = fetch(method, url);\n\n      promise\n        .then((response) => {\n          UserNotification.success('', `Collector \"${name}\" successfully copied`);\n          this.refreshList();\n\n          return response;\n        }, (error) => {\n          UserNotification.error(`Saving collector \"${name}\" failed with status: ${error.message}`,\n            'Could not save Collector');\n        });\n\n      CollectorsActions.copy.promise(promise);\n    },\n\n    validate(collector) {\n    // set minimum api defaults for faster validation feedback\n      const payload = {\n        id: ' ',\n        service_type: 'exec',\n        executable_path: ' ',\n        default_template: ' ',\n      };\n\n      lodash.merge(payload, collector);\n\n      const promise = fetch('POST', URLUtils.qualifyUrl(`${this.sourceUrl}/collectors/validate`), payload);\n\n      promise\n        .then(\n          (response) => response,\n          (error) => (\n            UserNotification.error(`Validating collector \"${payload.name}\" failed with status: ${error.message}`,\n              'Could not validate collector')\n          ),\n        );\n\n      CollectorsActions.validate.promise(promise);\n    },\n  }),\n);\n"],"names":["ColorLabelWrap","styled","size","theme","fonts","body","small","tiny","fontSize","css","ColorLabel","color","text","borderColor","utils","colorLevel","textColor","contrastingColor","style","backgroundColor","border","propTypes","PropTypes","themePropTypes","defaultProps","withTheme","CollectorConfigurationsActions","singletonActions","Reflux","all","asyncResult","list","listUploads","getConfiguration","getConfigurationSidecars","getUploads","createConfiguration","updateConfiguration","renderPreview","copyConfiguration","delete","validate","CollectorConfigurationsStore","singletonStore","listenables","sourceUrl","configurations","undefined","pagination","page","pageSize","total","paginatedConfigurations","query","propagateChanges","this","trigger","_fetchConfigurations","baseUrl","search","per_page","uri","URI","toString","fetch","URLUtils","_fetchUploads","promise","then","response","error","UserNotification","refreshList","configurationId","errorMessage","status","template","requestTemplate","configuration","url","responseMessage","message","id","name","payload","collector_id","lodash","CollectorsActions","getCollector","create","update","copy","CollectorsStore","collectors","paginatedCollectors","getInitialState","collectorId","_fetchCollectors","collector","service_type","executable_path","default_template"],"sourceRoot":""}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy