OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
API
/
swagger-ui-5.17.14
/
src
/
core
/
components
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
08/07/2024 04:34:11 AM
rwxr-xr-x
📄
app.jsx
621 bytes
08/07/2024 04:33:53 AM
rw-r--r--
📁
auth
-
08/07/2024 04:34:04 AM
rwxr-xr-x
📄
clear.jsx
599 bytes
08/07/2024 04:33:53 AM
rw-r--r--
📄
contact.jsx
1.14 KB
08/07/2024 04:33:53 AM
rw-r--r--
📄
content-type.jsx
1.71 KB
08/07/2024 04:33:53 AM
rw-r--r--
📄
copy-to-clipboard-btn.jsx
740 bytes
08/07/2024 04:33:53 AM
rw-r--r--
📄
curl.jsx
1.11 KB
08/07/2024 04:33:53 AM
rw-r--r--
📄
debug.jsx
1.05 KB
08/07/2024 04:33:53 AM
rw-r--r--
📄
deep-link.jsx
475 bytes
08/07/2024 04:33:53 AM
rw-r--r--
📄
errors.jsx
4.03 KB
08/07/2024 04:33:53 AM
rw-r--r--
📄
example.jsx
1.14 KB
08/07/2024 04:33:53 AM
rw-r--r--
📄
examples-select-value-retainer.jsx
8.08 KB
08/07/2024 04:33:53 AM
rw-r--r--
📄
examples-select.jsx
3.9 KB
08/07/2024 04:33:53 AM
rw-r--r--
📄
execute.jsx
3.4 KB
08/07/2024 04:33:53 AM
rw-r--r--
📄
footer.jsx
156 bytes
08/07/2024 04:33:53 AM
rw-r--r--
📄
headers.jsx
1.81 KB
08/07/2024 04:33:53 AM
rw-r--r--
📄
info.jsx
3.99 KB
08/07/2024 04:33:53 AM
rw-r--r--
📄
initialized-input.jsx
1.43 KB
08/07/2024 04:33:53 AM
rw-r--r--
📄
jump-to-path.jsx
191 bytes
08/07/2024 04:33:53 AM
rw-r--r--
📄
layout-utils.jsx
5.37 KB
08/07/2024 04:33:53 AM
rw-r--r--
📁
layouts
-
08/07/2024 04:34:05 AM
rwxr-xr-x
📄
license.jsx
1.01 KB
08/07/2024 04:33:53 AM
rw-r--r--
📄
live-response.jsx
4.67 KB
08/07/2024 04:33:53 AM
rw-r--r--
📄
online-validator-badge.jsx
3.15 KB
08/07/2024 04:33:53 AM
rw-r--r--
📄
openapi-version.jsx
314 bytes
08/07/2024 04:33:53 AM
rw-r--r--
📄
operation-extension-row.jsx
411 bytes
08/07/2024 04:33:53 AM
rw-r--r--
📄
operation-extensions.jsx
970 bytes
08/07/2024 04:33:53 AM
rw-r--r--
📄
operation-summary-method.jsx
535 bytes
08/07/2024 04:33:53 AM
rw-r--r--
📄
operation-summary-path.jsx
1.38 KB
08/07/2024 04:33:54 AM
rw-r--r--
📄
operation-summary.jsx
3.57 KB
08/07/2024 04:33:54 AM
rw-r--r--
📄
operation-tag.jsx
3.63 KB
08/07/2024 04:33:54 AM
rw-r--r--
📄
operation.jsx
9.93 KB
08/07/2024 04:33:54 AM
rw-r--r--
📄
operations.jsx
2.8 KB
08/07/2024 04:33:54 AM
rw-r--r--
📄
overview.jsx
3.57 KB
08/07/2024 04:33:54 AM
rw-r--r--
📄
param-body.jsx
4.85 KB
08/07/2024 04:33:54 AM
rw-r--r--
📄
parameter-extension.jsx
302 bytes
08/07/2024 04:33:54 AM
rw-r--r--
📄
parameter-include-empty.jsx
1.43 KB
08/07/2024 04:33:54 AM
rw-r--r--
📄
parameter-row.jsx
14.28 KB
08/07/2024 04:33:54 AM
rw-r--r--
📁
parameters
-
08/07/2024 04:34:05 AM
rwxr-xr-x
📄
property.jsx
376 bytes
08/07/2024 04:33:54 AM
rw-r--r--
📁
providers
-
08/07/2024 04:34:05 AM
rwxr-xr-x
📄
response-body.jsx
5.97 KB
08/07/2024 04:33:54 AM
rw-r--r--
📄
response-extension.jsx
316 bytes
08/07/2024 04:33:54 AM
rw-r--r--
📄
response.jsx
9.31 KB
08/07/2024 04:33:54 AM
rw-r--r--
📄
responses.jsx
6.59 KB
08/07/2024 04:33:54 AM
rw-r--r--
📄
svg-assets.jsx
3.15 KB
08/07/2024 04:33:54 AM
rw-r--r--
📄
system-wrapper.jsx
0 bytes
08/07/2024 04:33:54 AM
rw-r--r--
📄
try-it-out-button.jsx
1.36 KB
08/07/2024 04:33:54 AM
rw-r--r--
📄
version-pragma-filter.jsx
1.84 KB
08/07/2024 04:33:54 AM
rw-r--r--
📄
version-stamp.jsx
271 bytes
08/07/2024 04:33:54 AM
rw-r--r--
Editing: param-body.jsx
Close
import React, { PureComponent } from "react" import PropTypes from "prop-types" import { fromJS, List } from "immutable" import { getKnownSyntaxHighlighterLanguage } from "core/utils/jsonParse" import createHtmlReadyId from "core/utils/create-html-ready-id" const NOOP = Function.prototype export default class ParamBody extends PureComponent { static propTypes = { param: PropTypes.object, onChange: PropTypes.func, onChangeConsumes: PropTypes.func, consumes: PropTypes.object, consumesValue: PropTypes.string, fn: PropTypes.object.isRequired, getComponent: PropTypes.func.isRequired, isExecute: PropTypes.bool, specSelectors: PropTypes.object.isRequired, pathMethod: PropTypes.array.isRequired } static defaultProp = { consumes: fromJS(["application/json"]), param: fromJS({}), onChange: NOOP, onChangeConsumes: NOOP, } constructor(props, context) { super(props, context) this.state = { isEditBox: false, value: "" } } componentDidMount() { this.updateValues.call(this, this.props) } UNSAFE_componentWillReceiveProps(nextProps) { this.updateValues.call(this, nextProps) } updateValues = (props) => { let { param, isExecute, consumesValue="" } = props let isXml = /xml/i.test(consumesValue) let isJson = /json/i.test(consumesValue) let paramValue = isXml ? param.get("value_xml") : param.get("value") if ( paramValue !== undefined ) { let val = !paramValue && isJson ? "{}" : paramValue this.setState({ value: val }) this.onChange(val, {isXml: isXml, isEditBox: isExecute}) } else { if (isXml) { this.onChange(this.sample("xml"), {isXml: isXml, isEditBox: isExecute}) } else { this.onChange(this.sample(), {isEditBox: isExecute}) } } } sample = (xml) => { let { param, fn} = this.props let schema = fn.inferSchema(param.toJS()) return fn.getSampleSchema(schema, xml, { includeWriteOnly: true }) } onChange = (value, { isEditBox, isXml }) => { this.setState({value, isEditBox}) this._onChange(value, isXml) } _onChange = (val, isXml) => { (this.props.onChange || NOOP)(val, isXml) } handleOnChange = e => { const {consumesValue} = this.props const isXml = /xml/i.test(consumesValue) const inputValue = e.target.value this.onChange(inputValue, {isXml, isEditBox: this.state.isEditBox}) } toggleIsEditBox = () => this.setState( state => ({isEditBox: !state.isEditBox})) render() { let { onChangeConsumes, param, isExecute, specSelectors, pathMethod, getComponent, } = this.props const Button = getComponent("Button") const TextArea = getComponent("TextArea") const HighlightCode = getComponent("HighlightCode", true) const ContentType = getComponent("contentType") // for domains where specSelectors not passed let parameter = specSelectors ? specSelectors.parameterWithMetaByIdentity(pathMethod, param) : param let errors = parameter.get("errors", List()) let consumesValue = specSelectors.contentTypeValues(pathMethod).get("requestContentType") let consumes = this.props.consumes && this.props.consumes.size ? this.props.consumes : ParamBody.defaultProp.consumes let { value, isEditBox } = this.state let language = null let testValueForJson = getKnownSyntaxHighlighterLanguage(value) if (testValueForJson) { language = "json" } const regionId = createHtmlReadyId(`${pathMethod[1]}${pathMethod[0]}_parameters`) const controlId = `${regionId}_select` return ( <div className="body-param" data-param-name={param.get("name")} data-param-in={param.get("in")}> { isEditBox && isExecute ? <TextArea className={ "body-param__text" + ( errors.count() ? " invalid" : "")} value={value} onChange={ this.handleOnChange }/> : (value && <HighlightCode className="body-param__example" language={ language }>{value}</HighlightCode>) } <div className="body-param-options"> { !isExecute ? null : <div className="body-param-edit"> <Button className={isEditBox ? "btn cancel body-param__example-edit" : "btn edit body-param__example-edit"} onClick={this.toggleIsEditBox}>{ isEditBox ? "Cancel" : "Edit"} </Button> </div> } <label htmlFor={controlId}> <span>Parameter content type</span> <ContentType value={ consumesValue } contentTypes={ consumes } onChange={onChangeConsumes} className="body-param-content-type" ariaLabel="Parameter content type" controlId={controlId} /> </label> </div> </div> ) } }