mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
Remove flash_read_bulk(), refactor website and execute_config().
flash_read_bulk() is kind of a printf function. But did not work as well. flash_read_bulk() was used in the http generation so this needed to be changed as well. For the website we decided that we are going to use CSR(Client Side Rendering). So every HTML and JS files are now static. Variables are fetched via json calls and output is render on the client side. Also usefull for the future when we want a REST like API. execute_config() was also using flash_read_bulk(). This have been replaced with flash_read_bulk() and parsing the flash_buf buffer.
This commit is contained in:
+29
-18
@@ -1,24 +1,35 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<script src="/ports.js"></script>
|
||||
<script src="/main.js"></script>
|
||||
<head>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<title>FreeSwitchOS Main Page</title>
|
||||
</head>
|
||||
<body>
|
||||
<ul> <li><a href="index.html">Overview</a></li> <li><a href="stat.html">Port Statistics</a></li>
|
||||
<li><a href="vlan.html">VLAN</a></li> <li><a href="mirror.html">Mirroring</a></li>
|
||||
<li><a href="trunk.html">Port Aggregation</a></li>
|
||||
<li><a href="mirror.html">Mirroring</a></li>
|
||||
<li><a href="update.html">Firmware Update</a></li> </ul>
|
||||
<div style="margin-left:16%;padding:1px 16px;height:1000px;">
|
||||
<script src="/ports.js"></script>
|
||||
<script src="/main.js"></script>
|
||||
<script src="/main_info.js"></script>
|
||||
|
||||
<head>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<title>FreeSwitchOS Main Page</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<ul>
|
||||
<li><a href="index.html">Overview</a></li>
|
||||
<li><a href="stat.html">Port Statistics</a></li>
|
||||
<li><a href="vlan.html">VLAN</a></li>
|
||||
<li><a href="mirror.html">Mirroring</a></li>
|
||||
<li><a href="trunk.html">Port Aggregation</a></li>
|
||||
<li><a href="mirror.html">Mirroring</a></li>
|
||||
<li><a href="update.html">Firmware Update</a></li>
|
||||
</ul>
|
||||
<div style="margin-left:16%;padding:1px 16px;height:1000px;">
|
||||
<div id="ports"></div>
|
||||
<h1>Switch Configuration</h1>
|
||||
<table>
|
||||
<tr> <th>Setting</th> <th></th> </tr>
|
||||
#{html_index}
|
||||
<table id="infoTable">
|
||||
<tr>
|
||||
<th colspan="2">Settings</th>
|
||||
</tr>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
fetch('/information.json')
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
const tableBody = document.getElementById('infoTable').querySelector('tbody');
|
||||
|
||||
// Create table rows
|
||||
for (const [key, value] of Object.entries(data)) {
|
||||
const row = document.createElement('tr');
|
||||
const cellKey = document.createElement('td');
|
||||
const cellValue = document.createElement('td');
|
||||
|
||||
cellKey.textContent = key;
|
||||
cellValue.textContent = value;
|
||||
|
||||
row.appendChild(cellKey);
|
||||
row.appendChild(cellValue);
|
||||
tableBody.appendChild(row);
|
||||
}
|
||||
})
|
||||
.catch(error => console.error('Error fetching the data:', error));
|
||||
});
|
||||
Reference in New Issue
Block a user