AnonSec Shell
Server IP : 104.21.14.48  /  Your IP : 3.15.144.223   [ Reverse IP ]
Web Server : Apache
System : Linux b70eb322-3aee-0c53-7c82-0db91281f2c6.secureserver.net 6.1.90-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 2 12:09:22 EDT 2024 x86_64
User : root ( 0)
PHP Version : 8.0.30.2
Disable Function : NONE
Domains : 0 Domains
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/chroot/var/www/wp-content/plugins/litespeed-cache/assets/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /var/chroot/var/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 (
			<React.Fragment>
				{this.state.list.map((item, i) => (
					<SimulationBlock item={item} key={i} index={i} handleInputChange={this.handleInputChange} delRow={this.delRow} />
				))}

				<p>
					<button type="button" className="button button-link litespeed-form-action litespeed-link-with-icon" onClick={this.addNew}>
						<span className="dashicons dashicons-plus-alt"></span>
						{litespeed_data['lang']['add_cookie_simulation_row']}
					</button>
				</p>
			</React.Fragment>
		);
	}
}

// { 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 (
			<div className="litespeed-block">
				<div className="litespeed-col-auto">
					<label className="litespeed-form-label">{litespeed_data['lang']['cookie_name']}</label>
					<input
						type="text"
						name={litespeed_data['ids']['crawler_cookies'] + '[name][]'}
						className="regular-text"
						value={item.name}
						data-type="name"
						onChange={this.handleInputChange}
					/>
				</div>
				<div className="litespeed-col-auto">
					<label className="litespeed-form-label">{litespeed_data['lang']['cookie_values']}</label>
					<textarea
						rows="5"
						cols="40"
						name={litespeed_data['ids']['crawler_cookies'] + '[vals][]'}
						placeholder={litespeed_data['lang']['one_per_line']}
						value={Array.isArray(item.vals) ? item.vals.join('\n') : item.vals}
						data-type="vals"
						onChange={this.handleInputChange}
					/>
				</div>
				<div className="litespeed-col-auto">
					<button type="button" className="button button-link litespeed-collection-button litespeed-danger" onClick={this.delRow}>
						<span className="dashicons dashicons-dismiss"></span>
						<span className="screen-reader-text">{litespeed_data['lang']['remove_cookie_simulation']}</span>
					</button>
				</div>
			</div>
		);
	}
}

Anon7 - 2022
AnonSec Team