From 4a3307f68336f2fc176ce6f6871a52e464663b72 Mon Sep 17 00:00:00 2001 From: Russel Yasol Date: Sun, 24 Mar 2024 21:50:24 +0800 Subject: [PATCH] added ATI as the default command --- simpleadmin/www/atcommander.html | 39 +++++--------------------------- 1 file changed, 6 insertions(+), 33 deletions(-) diff --git a/simpleadmin/www/atcommander.html b/simpleadmin/www/atcommander.html index 2702c49..5bc2ff7 100644 --- a/simpleadmin/www/atcommander.html +++ b/simpleadmin/www/atcommander.html @@ -122,18 +122,6 @@
-

Here are some useful commands:

    @@ -254,8 +242,14 @@ return { isLoading: false, atcmd: null, + defaultAtCommand: 'ATI', atCommandResponse: "", sendAtCommand() { + if (!this.atcmd) { + // Use ATI as default command + this.atcmd = "ATI"; + console.log("AT Command is empty, using ATI as default command: ", this.atcmd); + } this.isLoading = true; fetch( "/cgi-bin/get_atcommand?" + @@ -279,27 +273,6 @@ }, }; } - - function sendRebootCommand() { - var isRebootClicked = true; - console.log("Reboot command triggered"); - var atcmd = "AT+CFUN=1,1"; - fetch( - "/cgi-bin/get_atcommand?" + - new URLSearchParams({ - atcmd: atcmd, - }) - ) - .then((res) => { - return res.text(); - }) - .then((data) => { - console.log(data); // Logging the response for debugging purposes - }) - .catch((error) => { - console.error("Error:", error); - }); - }