added ATI as the default command
This commit is contained in:
@@ -122,18 +122,6 @@
|
|||||||
</header>
|
</header>
|
||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<!-- <div class="field" style="margin-bottom: 1rem">
|
|
||||||
<p class="control">
|
|
||||||
<button
|
|
||||||
class="button is-danger"
|
|
||||||
click="sendRebootCommand()"
|
|
||||||
:disabled="isRebootClicked"
|
|
||||||
|
|
||||||
>
|
|
||||||
Reboot
|
|
||||||
</button>
|
|
||||||
</p>
|
|
||||||
</div> -->
|
|
||||||
<!-- Add your useful commands content here -->
|
<!-- Add your useful commands content here -->
|
||||||
<p>Here are some useful commands:</p>
|
<p>Here are some useful commands:</p>
|
||||||
<ul>
|
<ul>
|
||||||
@@ -254,8 +242,14 @@
|
|||||||
return {
|
return {
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
atcmd: null,
|
atcmd: null,
|
||||||
|
defaultAtCommand: 'ATI',
|
||||||
atCommandResponse: "",
|
atCommandResponse: "",
|
||||||
sendAtCommand() {
|
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;
|
this.isLoading = true;
|
||||||
fetch(
|
fetch(
|
||||||
"/cgi-bin/get_atcommand?" +
|
"/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);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user