| 118 | } |
| 119 | |
| 120 | async #onLogin(apiRecord) { |
| 121 | this.loginButton.setEnabled(false); |
| 122 | this.submitButton.setEnabled(false); |
| 123 | try { |
| 124 | const info = await apiRecord.login(); |
| 125 | if (info.cookie) |
| 126 | this.apiParams.getRow('cookie').setValue(info.cookie); |
| 127 | if (info.params) { |
| 128 | for (const name in info.params) |
| 129 | this.apiParams.getRow(name)?.setValue(info.params[name]); |
| 130 | } |
| 131 | } catch (error) { |
| 132 | if (error.name != 'CancelledError') |
| 133 | alert(error.message); |
| 134 | } finally { |
| 135 | this.loginButton.setEnabled(true); |
| 136 | this.submitButton.setEnabled(true); |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | #onSubmit() { |
| 141 | const name = this.apiSelector.getValue('name') as string; |