mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
Move drawing of ports into main.js
This reduces the number of .js which are pulled by the browser when loading a http page, which should reduce the loading time. Also prepare for device-dependent logical to physical port mappings.
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<script src="/ports.js"></script>
|
|
||||||
<script src="/main.js"></script>
|
<script src="/main.js"></script>
|
||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="style.css">
|
||||||
<title>EEE Configuration</title>
|
<title>EEE Configuration</title>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<script src="/ports.js"></script>
|
|
||||||
<script src="/main.js"></script>
|
<script src="/main.js"></script>
|
||||||
<script src="/main_info.js"></script>
|
<script src="/main_info.js"></script>
|
||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="style.css">
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<script src="/ports.js"></script>
|
|
||||||
<script src="/main.js"></script>
|
<script src="/main.js"></script>
|
||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="style.css">
|
||||||
<title>Link Aggregation Configuration</title>
|
<title>Link Aggregation Configuration</title>
|
||||||
|
|||||||
@@ -6,6 +6,30 @@ const linkS = ["Disabled", "No Link", "100M", "1000M", "500M", "10G", "2.5G", "5
|
|||||||
var pState = new Int8Array(10);
|
var pState = new Int8Array(10);
|
||||||
var pIsSFP = new Int8Array(10);
|
var pIsSFP = new Int8Array(10);
|
||||||
var numPorts = 0;
|
var numPorts = 0;
|
||||||
|
const logToPhysPort = [0, 0, 0, 5, 1, 2, 3, 4, 6];
|
||||||
|
const physToLogPort = [ 4, 5, 6, 7, 3, 8];
|
||||||
|
|
||||||
|
function drawPorts() {
|
||||||
|
var f = document.getElementById('ports');
|
||||||
|
console.log("DRAWING PORTS: ", numPorts);
|
||||||
|
for (let i = 0; i < numPorts; i++) {
|
||||||
|
console.log("DRAWING isSFP: ", pIsSFP[i]);
|
||||||
|
const l = document.createElement("object");
|
||||||
|
l.type = "image/svg+xml";
|
||||||
|
if (!pIsSFP[i]) {
|
||||||
|
l.data = "port.svg";
|
||||||
|
l.width ="40";
|
||||||
|
l.height ="40";
|
||||||
|
} else {
|
||||||
|
l.data = "sfp.svg";
|
||||||
|
l.width = "60";
|
||||||
|
l.height = "60";
|
||||||
|
}
|
||||||
|
l.id="port" + (i+1);
|
||||||
|
f.appendChild(l);
|
||||||
|
}
|
||||||
|
console.log("DRAWING DONE ");
|
||||||
|
}
|
||||||
|
|
||||||
function update() {
|
function update() {
|
||||||
var xhttp = new XMLHttpRequest();
|
var xhttp = new XMLHttpRequest();
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<script src="/ports.js"></script>
|
|
||||||
<script src="/main.js"></script>
|
<script src="/main.js"></script>
|
||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="style.css">
|
||||||
<title>Mirror Configuration</title>
|
<title>Mirror Configuration</title>
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
const logToPhysPort = [0, 0, 0, 5, 1, 2, 3, 4, 6];
|
|
||||||
const physToLogPort = [ 4, 5, 6, 7, 3, 8];
|
|
||||||
|
|
||||||
function drawPorts() {
|
|
||||||
var f = document.getElementById('ports');
|
|
||||||
console.log("DRAWING PORTS: ", numPorts);
|
|
||||||
for (let i = 0; i < numPorts; i++) {
|
|
||||||
console.log("DRAWING isSFP: ", pIsSFP[i]);
|
|
||||||
const l = document.createElement("object");
|
|
||||||
l.type = "image/svg+xml";
|
|
||||||
if (!pIsSFP[i]) {
|
|
||||||
l.data = "port.svg";
|
|
||||||
l.width ="40";
|
|
||||||
l.height ="40";
|
|
||||||
} else {
|
|
||||||
l.data = "sfp.svg";
|
|
||||||
l.width = "60";
|
|
||||||
l.height = "60";
|
|
||||||
}
|
|
||||||
l.id="port" + (i+1);
|
|
||||||
f.appendChild(l);
|
|
||||||
}
|
|
||||||
console.log("DRAWING DONE ");
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<script src="/ports.js"></script>
|
|
||||||
<script src="/main.js"></script>
|
<script src="/main.js"></script>
|
||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="style.css">
|
||||||
<title>FreeSwitchOS Port Statistics</title>
|
<title>FreeSwitchOS Port Statistics</title>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<script src="/ports.js"></script>
|
|
||||||
<script src="/main.js"></script>
|
<script src="/main.js"></script>
|
||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="style.css">
|
||||||
<title>FreeSwitchOS VLAN Configuration</title>
|
<title>FreeSwitchOS VLAN Configuration</title>
|
||||||
|
|||||||
Reference in New Issue
Block a user