Update console.html

This commit is contained in:
Namhyeon Go 2024-06-20 17:01:32 +09:00 committed by GitHub
parent 6642750172
commit 472d989a17
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -29,13 +29,17 @@
url: env.target, url: env.target,
type: 'POST', type: 'POST',
contentType: 'application/json', contentType: 'application/json',
dataType: 'json',
data: JSON.stringify(requestData), data: JSON.stringify(requestData),
beforeSend: function(xhr) { beforeSend: function(xhr) {
xhr.setRequestHeader("X-User-Agent", "php-httpproxy/0.1.5 (Client; WebConsole; abuse@catswords.net)"); xhr.setRequestHeader("X-User-Agent", "php-httpproxy/0.1.5 (Client; WebConsole; abuse@catswords.net)");
}, },
success: function(response) { success: function(response) {
var responseData = JSON.parse(response); if (typeof response.result.data === "object") {
term.echo(responseData.result.data); term.echo(JSON.stringify(response.result.data));
} else {
term.echo(response.result.data);
}
}, },
error: function(xhr, status, error) { error: function(xhr, status, error) {
term.echo(error); term.echo(error);