| 2306 | }); |
| 2307 | } |
| 2308 | runScript(t, s) { |
| 2309 | return new Promise((e) => { |
| 2310 | let i = this.getdata('@chavy_boxjs_userCfgs.httpapi'); |
| 2311 | i = i ? i.replace(/\n/g, '').trim() : i; |
| 2312 | let o = this.getdata('@chavy_boxjs_userCfgs.httpapi_timeout'); |
| 2313 | (o = o ? 1 * o : 20), |
| 2314 | (o = s && s.timeout ? s.timeout : o); |
| 2315 | const[h, a] = i.split('@'), |
| 2316 | r = { |
| 2317 | url: `http://${a}/v1/scripting/evaluate`, |
| 2318 | body: { |
| 2319 | script_text: t, |
| 2320 | mock_type: 'cron', |
| 2321 | timeout: o |
| 2322 | }, |
| 2323 | headers: { |
| 2324 | 'X-Key': h, |
| 2325 | Accept: '*/*' |
| 2326 | }, |
| 2327 | }; |
| 2328 | $.post(r, (t, s, i) => e(i)); |
| 2329 | }).catch((t) => this.logErr(t)); |
| 2330 | } |
| 2331 | loaddata() { |
| 2332 | if (!this.isNode()) |
| 2333 | return {}; { |