芝麻web文件管理V1.00
编辑当前文件:/home/royashxg/www/wp-content/plugins/litespeed-cache/assets/js/component.crawler.js
/** * Crawler simulation module * @author Hai Zheng */ class CrawlerSimulate extends React.Component { constructor(props) { super(props); this.state = { list: props.list, }; this.handleInputChange = this.handleInputChange.bind(this); this.delRow = this.delRow.bind(this); this.addNew = this.addNew.bind(this); } handleInputChange(e, index) { const target = e.target; const value = target.type === 'checkbox' ? target.checked : target.value; const list = this.state.list; list[index][target.dataset.type] = value; this.setState({ list: list, }); } delRow(index) { const data = this.state.list; data.splice(index, 1); this.setState({ list: data }); } addNew() { const list = this.state.list; list.push({ name: '', vals: '' }); this.setState({ list: list }); } render() { return (
{this.state.list.map((item, i) => (
))}
{litespeed_data['lang']['add_cookie_simulation_row']}
); } } // { name: '', vals: '' } class SimulationBlock extends React.Component { constructor(props) { super(props); this.handleInputChange = this.handleInputChange.bind(this); this.delRow = this.delRow.bind(this); } handleInputChange(e) { this.props.handleInputChange(e, this.props.index); } delRow() { this.props.delRow(this.props.index); } render() { const item = this.props.item; return (
{litespeed_data['lang']['cookie_name']}
{litespeed_data['lang']['cookie_values']}
{litespeed_data['lang']['remove_cookie_simulation']}
); } }