-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from Graylog2/advanced_option_fields
Advanced option fields
- Loading branch information
Showing
10 changed files
with
974 additions
and
750 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,10 @@ | |
"graylog" | ||
], | ||
"author": "Graylog, Inc. <[email protected]>", | ||
"dependencies": { | ||
"@emotion/core": "^10.0.10", | ||
"@emotion/styled": "^10.0.12" | ||
}, | ||
"private": true, | ||
"devDependencies": { | ||
"eslint-config-graylog": "file:../graylog2-server/graylog2-web-interface/packages/eslint-config-graylog", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import React from 'react'; | ||
import styled from '@emotion/styled'; | ||
import PropTypes from 'prop-types'; | ||
import { Input } from 'components/bootstrap'; | ||
|
||
const FormAdvancedOptions = ({ onChange, values, toggle, visible }) => { | ||
return ( | ||
<div> | ||
<ToggleAdvancedOptions onClick={toggle} type="button"> | ||
Advanced Options <i className="fa fa-angle-right fa-sm" /> | ||
</ToggleAdvancedOptions> | ||
|
||
<AdvancedOptionsContent visible={visible}> | ||
<Input id="awsCloudWatchGlobalInput" | ||
type="checkbox" | ||
value="global-input" | ||
defaultChecked={values.awsCloudWatchGlobalInput} | ||
onChange={onChange} | ||
label="Global Input" /> | ||
|
||
<Input id="awsCloudWatchAssumeARN" | ||
type="text" | ||
value={values.awsCloudWatchAssumeARN} | ||
onChange={onChange} | ||
label="AWS assume role ARN" /> | ||
|
||
<Input id="awsCloudWatchBatchSize" | ||
type="number" | ||
value={values.awsCloudWatchBatchSize} | ||
onChange={onChange} | ||
label="Kinesis Record batch size" /> | ||
|
||
<Input id="awsCloudWatchThrottleEnabled" | ||
type="checkbox" | ||
value="throttle-enabled" | ||
defaultChecked={values.awsCloudWatchThrottleEnabled} | ||
onChange={onChange} | ||
label="Enable Throttle" /> | ||
|
||
<Input id="awsCloudWatchThrottleWait" | ||
type="number" | ||
value={values.awsCloudWatchThrottleWait} | ||
onChange={onChange} | ||
label="Throttled wait milliseconds" /> | ||
</AdvancedOptionsContent> | ||
</div> | ||
); | ||
}; | ||
|
||
FormAdvancedOptions.propTypes = { | ||
onChange: PropTypes.func.isRequired, | ||
values: PropTypes.object.isRequired, | ||
toggle: PropTypes.func.isRequired, | ||
visible: PropTypes.bool.isRequired, | ||
}; | ||
|
||
const AdvancedOptionsContent = styled.div` | ||
display: ${props => (props.visible ? 'block' : 'none')}; | ||
`; | ||
|
||
const ToggleAdvancedOptions = styled.button` | ||
border: 0; | ||
color: #16ace3; | ||
font-size: 14px; | ||
:hover { | ||
color: #5e123b; | ||
text-decoration: underline; | ||
} | ||
`; | ||
|
||
export default FormAdvancedOptions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.