diff options
| author | Shulhan <ms@kilabit.info> | 2023-11-11 13:01:50 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2023-11-11 13:17:14 +0700 |
| commit | e56ee3e03a34fa738b626a4fd22fbc051bf7f0b0 (patch) | |
| tree | a66cafc7a357e5f9eedc9e55fd630de5d4406cd4 /_www/environment.js | |
| parent | 642d46804ec322b06ab46f27f8b8663764ae4e9a (diff) | |
| download | gorankusu-e56ee3e03a34fa738b626a4fd22fbc051bf7f0b0.tar.xz | |
_www: apply all eslint recommendations
Diffstat (limited to '_www/environment.js')
| -rw-r--r-- | _www/environment.js | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/_www/environment.js b/_www/environment.js index 17ce91b..7a5c0bb 100644 --- a/_www/environment.js +++ b/_www/environment.js @@ -7,19 +7,19 @@ export class Environment { constructor(trunks, opts) { this.trunks = trunks; this.opts = opts; - this.el_nav = document.createElement("h3"); - this.el_content = document.createElement("div"); - this.el_nav.classList.add(CLASS_NAV_TARGET); - this.el_nav.innerText = "Environment"; - this.el_nav.onclick = () => { - trunks.SetContent(HASH_ENVIRONMENT, this.el_content); + this.elNav = document.createElement("h3"); + this.elContent = document.createElement("div"); + this.elNav.classList.add(CLASS_NAV_TARGET); + this.elNav.innerText = "Environment"; + this.elNav.onclick = () => { + trunks.setContent(HASH_ENVIRONMENT, this.elContent); }; this.generateContent(); } generateContent() { - const el_title = document.createElement("h2"); - el_title.innerText = "Environment"; - const opts_listen_address = { + const elTitle = document.createElement("h2"); + elTitle.innerText = "Environment"; + const optsListenAddress = { label: "Listen address", hint: "The address and port where Trunks is running.", value: this.opts.ListenAddress, @@ -31,8 +31,8 @@ export class Environment { this.opts.ListenAddress = v; }, }; - this.com_listen_address = new WuiInputString(opts_listen_address); - const opts_max_attack_dur = { + this.comListenAddress = new WuiInputString(optsListenAddress); + const optsMaxAttackDur = { label: "Max. attack duration (seconds)", hint: "Maximum attack duration for all targets, in seconds.", value: this.opts.MaxAttackDuration / 1e9, @@ -45,8 +45,8 @@ export class Environment { this.opts.MaxAttackDuration = v * 1e9; }, }; - this.com_max_attack_dur = new WuiInputNumber(opts_max_attack_dur); - const opts_max_attack_rate = { + this.comMaxAttackDur = new WuiInputNumber(optsMaxAttackDur); + const optsMaxAttackRate = { label: "Max. attack rate", hint: "Maximum attack rate for all targets.", value: this.opts.MaxAttackRate, @@ -59,8 +59,8 @@ export class Environment { this.opts.MaxAttackRate = v; }, }; - this.com_max_attack_rate = new WuiInputNumber(opts_max_attack_rate); - const opts_results_dir = { + this.comMaxAttackRate = new WuiInputNumber(optsMaxAttackRate); + const optsResultsDir = { label: "Results directory", hint: "The directory where the attack result will be saved.", value: this.opts.ResultsDir, @@ -72,8 +72,8 @@ export class Environment { this.opts.ResultsDir = v; }, }; - this.com_results_dir = new WuiInputString(opts_results_dir); - const opts_results_suffix = { + this.comResultsDir = new WuiInputString(optsResultsDir); + const optsResultsSuffix = { label: "Results suffix", hint: "Optional suffix for the file name of attack result.", value: this.opts.ResultsSuffix, @@ -85,20 +85,20 @@ export class Environment { this.opts.ResultsSuffix = v; }, }; - this.com_results_suffix = new WuiInputString(opts_results_suffix); - this.el_content.appendChild(el_title); - this.el_content.appendChild(this.com_listen_address.el); - this.el_content.appendChild(this.com_max_attack_dur.el); - this.el_content.appendChild(this.com_max_attack_rate.el); - this.el_content.appendChild(this.com_results_dir.el); - this.el_content.appendChild(this.com_results_suffix.el); + this.comResultsSuffix = new WuiInputString(optsResultsSuffix); + this.elContent.appendChild(elTitle); + this.elContent.appendChild(this.comListenAddress.el); + this.elContent.appendChild(this.comMaxAttackDur.el); + this.elContent.appendChild(this.comMaxAttackRate.el); + this.elContent.appendChild(this.comResultsDir.el); + this.elContent.appendChild(this.comResultsSuffix.el); } - Set(opts) { + set(opts) { this.opts = opts; - this.com_listen_address.Set(opts.ListenAddress); - this.com_max_attack_dur.Set(opts.MaxAttackDuration / 1e9); - this.com_max_attack_rate.Set(opts.MaxAttackRate); - this.com_results_dir.Set(opts.ResultsDir); - this.com_results_suffix.Set(opts.ResultsSuffix); + this.comListenAddress.set(opts.ListenAddress); + this.comMaxAttackDur.set(opts.MaxAttackDuration / 1e9); + this.comMaxAttackRate.set(opts.MaxAttackRate); + this.comResultsDir.set(opts.ResultsDir); + this.comResultsSuffix.set(opts.ResultsSuffix); } } |
