fixed APN not showing, moved to generic branding, and added sms for testing
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
<div class="container">
|
||||
<div class="navbar-brand">
|
||||
<a class="navbar-item brand-text" href="/">
|
||||
Quectel Simple Admin
|
||||
Simple Admin
|
||||
</a>
|
||||
<a role="button" class="navbar-burger burger" @click="isOpen = !isOpen">
|
||||
<span aria-hidden="true"></span>
|
||||
@@ -29,15 +29,10 @@
|
||||
</div>
|
||||
<div id="navMenu" class="navbar-menu" :class="isOpen ? 'is-active' : ''">
|
||||
<div class="navbar-start">
|
||||
<a class="navbar-item" href="/">
|
||||
Connection Info
|
||||
</a>
|
||||
<a class="navbar-item" href="/atcommander.html">
|
||||
AT Commands
|
||||
</a>
|
||||
<a class="navbar-item" href="/ttl.html">
|
||||
TTL Changer
|
||||
</a>
|
||||
<a class="navbar-item" href="/"> Connection Info </a>
|
||||
<a class="navbar-item" href="/atcommander.html"> AT Commands </a>
|
||||
<a class="navbar-item" href="/sms.html"> SMS </a>
|
||||
<a class="navbar-item" href="/ttl.html"> TTL Changer </a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<nav class="navbar is-black" x-data="{ isOpen: false }">
|
||||
<div class="container">
|
||||
<div class="navbar-brand">
|
||||
<a class="navbar-item brand-text" href="/"> Quectel Simple Admin </a>
|
||||
<a class="navbar-item brand-text" href="/"> Simple Admin </a>
|
||||
<a
|
||||
role="button"
|
||||
class="navbar-burger burger"
|
||||
@@ -36,6 +36,7 @@
|
||||
<div class="navbar-start">
|
||||
<a class="navbar-item" href="/"> Connection Info </a>
|
||||
<a class="navbar-item" href="/atcommander.html"> AT Commands </a>
|
||||
<a class="navbar-item" href="/sms.html"> SMS </a>
|
||||
<a class="navbar-item" href="/ttl.html"> TTL Changer </a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -50,7 +51,7 @@
|
||||
<div class="container">
|
||||
<!-- Fetches the correct Model Name -->
|
||||
<h1 class="title">
|
||||
Quectel <span x-text="csqData.MODEM_MODEL"></span> Connection
|
||||
<span x-text="csqData.MODEM_MODEL"></span> Connection
|
||||
Info
|
||||
</h1>
|
||||
<h2 class="subtitle">
|
||||
|
||||
158
simpleadmin/www/sms.html
Normal file
158
simpleadmin/www/sms.html
Normal file
@@ -0,0 +1,158 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<!-- change to a much simpler tab title -->
|
||||
<title>Simple Admin</title>
|
||||
|
||||
<script src="/js/alpinejs.min.js" defer></script>
|
||||
<link rel="stylesheet" href="/css/bulma.css" />
|
||||
<link rel="stylesheet" type="text/css" href="/css/admin.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- START NAV -->
|
||||
<nav class="navbar is-black" x-data="{ isOpen: false }">
|
||||
<div class="container">
|
||||
<div class="navbar-brand">
|
||||
<a class="navbar-item brand-text" href="/"> Simple Admin </a>
|
||||
<a
|
||||
role="button"
|
||||
class="navbar-burger burger"
|
||||
@click="isOpen = !isOpen"
|
||||
>
|
||||
<span aria-hidden="true"></span>
|
||||
<span aria-hidden="true"></span>
|
||||
<span aria-hidden="true"></span>
|
||||
</a>
|
||||
</div>
|
||||
<div
|
||||
id="navMenu"
|
||||
class="navbar-menu"
|
||||
:class="isOpen ? 'is-active' : ''"
|
||||
>
|
||||
<div class="navbar-start">
|
||||
<a class="navbar-item" href="/"> Connection Info </a>
|
||||
<a class="navbar-item" href="/atcommander.html"> AT Commands </a>
|
||||
<a class="navbar-item" href="/sms.html"> SMS </a>
|
||||
<a class="navbar-item" href="/ttl.html"> TTL Changer </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<!-- END NAV -->
|
||||
<div class="container" x-data="atCommands()">
|
||||
<div class="columns">
|
||||
<div class="column is-12">
|
||||
<div class="columns">
|
||||
<div class="column is-8">
|
||||
<div class="card">
|
||||
<header class="card-header">
|
||||
<p class="card-header-title">SMS Viewer</p>
|
||||
<div class="field">
|
||||
<p class="control">
|
||||
<button
|
||||
class="button is-success"
|
||||
@click="sendAtCommand()"
|
||||
:disabled="isLoading"
|
||||
>
|
||||
Refresh
|
||||
</button>
|
||||
</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<p class="control">
|
||||
<button
|
||||
class="button is-danger"
|
||||
@click="sendAtCommand()"
|
||||
:disabled="isLoading"
|
||||
>
|
||||
Delete
|
||||
</button>
|
||||
</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="card-content">
|
||||
<div class="content">
|
||||
<textarea
|
||||
class="textarea"
|
||||
placeholder="SMS Viewer (Make sure to run: AT+CMGF=1 first)"
|
||||
readonly
|
||||
rows="10"
|
||||
cols="50"
|
||||
x-model="atCommandResponse"
|
||||
:disabled="isLoading"
|
||||
></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function atCommands() {
|
||||
return {
|
||||
isLoading: false,
|
||||
atcmd: 'AT+CMGL="ALL"',
|
||||
atCommandResponse: null,
|
||||
sendAtCommand() {
|
||||
this.isLoading = true; // Set loading state to true before fetching data
|
||||
fetch(
|
||||
"/cgi-bin/get_atcommand?" +
|
||||
new URLSearchParams({
|
||||
atcmd: this.atcmd,
|
||||
})
|
||||
)
|
||||
.then((res) => {
|
||||
return res.text();
|
||||
})
|
||||
.then((data) => {
|
||||
this.atCommandResponse = data;
|
||||
// Split the response into individual messages
|
||||
const messages = data.trim().split("\n\n");
|
||||
|
||||
// Parse each message and construct an array of objects
|
||||
const parsedMessages = messages.map((message) => {
|
||||
const lines = message.split("\n");
|
||||
const sender = decodeHexString(
|
||||
lines[1].split(",")[2].slice(1, -1)
|
||||
);
|
||||
const time = lines[2].split(',"')[1];
|
||||
const messageText = decodeHexString(lines[3]);
|
||||
return {
|
||||
"Người gửi": sender,
|
||||
"Thời gian": time,
|
||||
"Tin nhắn": messageText,
|
||||
};
|
||||
});
|
||||
|
||||
// Log the parsed messages array as JSON to the console
|
||||
console.log(JSON.stringify(parsedMessages, null, 2));
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("Không thể tìm thấy dữ liệu:", error);
|
||||
})
|
||||
.finally(() => {
|
||||
this.isLoading = false; // Set loading state to false after fetching data
|
||||
});
|
||||
},
|
||||
};
|
||||
}
|
||||
// Hàm giải mã chuỗi hex sang văn bản
|
||||
function decodeHexString(hexString) {
|
||||
let decodedString = "";
|
||||
for (let i = 0; i < hexString.length; i += 4) {
|
||||
let hex = hexString.substr(i, 4);
|
||||
let intValue = parseInt(hex, 16);
|
||||
decodedString += String.fromCharCode(intValue);
|
||||
}
|
||||
return decodedString;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -19,7 +19,7 @@
|
||||
<div class="container">
|
||||
<div class="navbar-brand">
|
||||
<a class="navbar-item brand-text" href="/">
|
||||
Quectel Simple Admin
|
||||
Simple Admin
|
||||
</a>
|
||||
<a role="button" class="navbar-burger burger" @click="isOpen = !isOpen">
|
||||
<span aria-hidden="true"></span>
|
||||
@@ -29,15 +29,10 @@
|
||||
</div>
|
||||
<div id="navMenu" class="navbar-menu" :class="isOpen ? 'is-active' : ''">
|
||||
<div class="navbar-start">
|
||||
<a class="navbar-item" href="/">
|
||||
Connection Info
|
||||
</a>
|
||||
<a class="navbar-item" href="/atcommander.html">
|
||||
AT Commands
|
||||
</a>
|
||||
<a class="navbar-item" href="/ttl.html">
|
||||
TTL Changer
|
||||
</a>
|
||||
<a class="navbar-item" href="/"> Connection Info </a>
|
||||
<a class="navbar-item" href="/atcommander.html"> AT Commands </a>
|
||||
<a class="navbar-item" href="/sms.html"> SMS </a>
|
||||
<a class="navbar-item" href="/ttl.html"> TTL Changer </a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user