diff --git a/src/web/dataadapters/RedisLookupAdapterDocumentation.jsx b/src/web/dataadapters/RedisLookupAdapterDocumentation.jsx index 9559e57..cf82bfe 100644 --- a/src/web/dataadapters/RedisLookupAdapterDocumentation.jsx +++ b/src/web/dataadapters/RedisLookupAdapterDocumentation.jsx @@ -1,36 +1,35 @@ -/* - * Copyright (C) 2024 johan@nosd.in - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the Server Side Public License, version 1, - * as published by MongoDB, Inc. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * Server Side Public License for more details. - * - * You should have received a copy of the Server Side Public License - * along with this program. If not, see - * . - */ -/* eslint-disable react/no-unescaped-entities, no-template-curly-in-string */ -import React from 'react'; - -class RedisLookupAdapterDocumentation extends React.Component { - render() { - const style = { marginBottom: 10 }; - return ( -
-

- The Redis Lookup data adapter lookup redis for the given key and returns the values.
- It supports writing key/values to Redis (SET command).
- All created keys will have the TTL configured for the data adapter. -

-
- ) - ; - } -} - -export default RedisLookupAdapterDocumentation; +/* + * Copyright (C) 2024 johan@nosd.in + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the Server Side Public License, version 1, + * as published by MongoDB, Inc. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * Server Side Public License for more details. + * + * You should have received a copy of the Server Side Public License + * along with this program. If not, see + * . + */ +import React from 'react'; + +class RedisLookupAdapterDocumentation extends React.Component { + render() { + const style = { marginBottom: 10 }; + return ( +
+

+ The Redis Lookup data adapter lookup redis for the given key and returns the values.
+ It supports writing key/values to Redis (SET command).
+ All created keys will have the TTL configured for the data adapter. +

+
+ ) + ; + } +} + +export default RedisLookupAdapterDocumentation; diff --git a/src/web/dataadapters/RedisLookupAdapterFieldSet.jsx b/src/web/dataadapters/RedisLookupAdapterFieldSet.jsx index 20c6a99..5cadc6e 100644 --- a/src/web/dataadapters/RedisLookupAdapterFieldSet.jsx +++ b/src/web/dataadapters/RedisLookupAdapterFieldSet.jsx @@ -1,116 +1,115 @@ -/* - * Copyright (C) 2024 johan@nosd.in - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the Server Side Public License, version 1, - * as published by MongoDB, Inc. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * Server Side Public License for more details. - * - * You should have received a copy of the Server Side Public License - * along with this program. If not, see - * . - */ -import React, { useCallback, useEffect, useRef, useState } from 'react'; -import PropTypes from 'prop-types'; -//import { Button } from 'components/graylog'; -import { Input } from 'components/bootstrap'; - -class RedisLookupAdapterFieldSet extends React.Component { - static propTypes = { - config: PropTypes.shape({ - redis_host: PropTypes.string.isRequired, - }).isRequired, - updateConfig: PropTypes.func.isRequired, - handleFormEvent: PropTypes.func.isRequired, - validationState: PropTypes.func.isRequired, - validationMessage: PropTypes.func.isRequired, - }; - - handleSelect = (fieldName) => { - return (selectedIndicator) => { - const config = lodash.cloneDeep(this.props.config); - config[fieldName] = selectedIndicator; - this.props.updateConfig(config); - }; - }; - - render() { - const { config } = this.props; - - return ( -
- - - - - - - -
- ); - } -} - - -export default RedisLookupAdapterFieldSet; +/* + * Copyright (C) 2024 johan@nosd.in + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the Server Side Public License, version 1, + * as published by MongoDB, Inc. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * Server Side Public License for more details. + * + * You should have received a copy of the Server Side Public License + * along with this program. If not, see + * . + */ +import React, { useCallback, useEffect, useRef, useState } from 'react'; +import PropTypes from 'prop-types'; +//import { Button } from 'components/graylog'; +import { Input } from 'components/bootstrap'; + +class RedisLookupAdapterFieldSet extends React.Component { + static propTypes = { + config: PropTypes.shape({ + redis_host: PropTypes.string.isRequired, + }).isRequired, + updateConfig: PropTypes.func.isRequired, + handleFormEvent: PropTypes.func.isRequired, + validationState: PropTypes.func.isRequired, + validationMessage: PropTypes.func.isRequired, + }; + + handleSelect = (fieldName) => { + return (selectedIndicator) => { + const config = lodash.cloneDeep(this.props.config); + config[fieldName] = selectedIndicator; + this.props.updateConfig(config); + }; + }; + + render() { + const { config } = this.props; + + return ( +
+ + + + + + + +
+ ); + } +} + +export default RedisLookupAdapterFieldSet; diff --git a/src/web/dataadapters/RedisLookupAdapterSummary.jsx b/src/web/dataadapters/RedisLookupAdapterSummary.jsx index 5e1b62a..41105b7 100644 --- a/src/web/dataadapters/RedisLookupAdapterSummary.jsx +++ b/src/web/dataadapters/RedisLookupAdapterSummary.jsx @@ -1,52 +1,52 @@ -/* - * Copyright (C) 2024 johan@nosd.in - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the Server Side Public License, version 1, - * as published by MongoDB, Inc. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * Server Side Public License for more details. - * - * You should have received a copy of the Server Side Public License - * along with this program. If not, see - * . - */ -// eslint-disable-next-line react/prefer-stateless-function -import React from 'react'; -import PropTypes from 'prop-types'; - -class RedisLookupAdapterSummary extends React.Component { - static propTypes = { - dataAdapter: PropTypes.shape({ - config: PropTypes.shape({ - redis_host: PropTypes.string.isRequired, - }), - }), - }; - - render() { - const { config } = this.props.dataAdapter; - - return ( -
-
Redis host
-
{config.redis_host || 'n/a'}
-
Redis port
-
{config.redis_port || 'n/a'}
-
Redis database
-
{config.redis_database}
-
Redis key TTL
-
{config.redis_ttl || 'n/a'}
-
Redis username
-
{config.redis_username || 'n/a'}
-
Redis password
-
******
-
- ); - } -} - -export default RedisLookupAdapterSummary; +/* + * Copyright (C) 2024 johan@nosd.in + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the Server Side Public License, version 1, + * as published by MongoDB, Inc. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * Server Side Public License for more details. + * + * You should have received a copy of the Server Side Public License + * along with this program. If not, see + * . + */ +// eslint-disable-next-line react/prefer-stateless-function +import React from 'react'; +import PropTypes from 'prop-types'; + +class RedisLookupAdapterSummary extends React.Component { + static propTypes = { + dataAdapter: PropTypes.shape({ + config: PropTypes.shape({ + redis_host: PropTypes.string.isRequired, + }), + }), + }; + + render() { + const { config } = this.props.dataAdapter; + + return ( +
+
Redis host
+
{config.redis_host || 'n/a'}
+
Redis port
+
{config.redis_port || 'n/a'}
+
Redis database
+
{config.redis_database}
+
Redis key TTL
+
{config.redis_ttl || 'n/a'}
+
Redis username
+
{config.redis_username || 'n/a'}
+
Redis password
+
******
+
+ ); + } +} + +export default RedisLookupAdapterSummary; diff --git a/src/web/index.jsx b/src/web/index.jsx index 2c14b63..e10e942 100644 --- a/src/web/index.jsx +++ b/src/web/index.jsx @@ -1,39 +1,39 @@ -/* - * Copyright (C) 2024 johan@nosd.in - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the Server Side Public License, version 1, - * as published by MongoDB, Inc. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * Server Side Public License for more details. - * - * You should have received a copy of the Server Side Public License - * along with this program. If not, see - * . - */ -// eslint-disable-next-line no-unused-vars -import webpackEntry from 'webpack-entry'; - -import { PluginManifest, PluginStore } from 'graylog-web-plugin/plugin'; -import packageJson from '../../package.json'; - -import RedisLookupAdapterDocumentation from './dataadapters/RedisLookupAdapterDocumentation'; -import RedisLookupAdapterFieldSet from './dataadapters/RedisLookupAdapterFieldSet'; -import RedisLookupAdapterSummary from './dataadapters/RedisLookupAdapterSummary'; - -const manifest = new PluginManifest(packageJson, { - lookupTableAdapters: [ - { - type: 'RedisLookup', - displayName: 'Redis Lookup', - formComponent: RedisLookupAdapterFieldSet, - summaryComponent: RedisLookupAdapterSummary, - documentationComponent: RedisLookupAdapterDocumentation, - }, - ], -}); - -PluginStore.register(manifest); +/* + * Copyright (C) 2024 johan@nosd.in + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the Server Side Public License, version 1, + * as published by MongoDB, Inc. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * Server Side Public License for more details. + * + * You should have received a copy of the Server Side Public License + * along with this program. If not, see + * . + */ +// eslint-disable-next-line no-unused-vars +import webpackEntry from 'webpack-entry'; + +import { PluginManifest, PluginStore } from 'graylog-web-plugin/plugin'; +import packageJson from '../../package.json'; + +import RedisLookupAdapterDocumentation from './dataadapters/RedisLookupAdapterDocumentation'; +import RedisLookupAdapterFieldSet from './dataadapters/RedisLookupAdapterFieldSet'; +import RedisLookupAdapterSummary from './dataadapters/RedisLookupAdapterSummary'; + +const manifest = new PluginManifest(packageJson, { + lookupTableAdapters: [ + { + type: 'RedisLookup', + displayName: 'Redis Lookup', + formComponent: RedisLookupAdapterFieldSet, + summaryComponent: RedisLookupAdapterSummary, + documentationComponent: RedisLookupAdapterDocumentation, + }, + ], +}); + +PluginStore.register(manifest);