forked from cotestatnt/async-esp-fs-webserver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WebSerialMonitor.html
185 lines (161 loc) · 5.85 KB
/
WebSerialMonitor.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
<!--
Dirk luberth Dijkman's version of
https://github.com/GoogleChromeLabs/serial-terminal
-->
<!DOCTYPE html>
<html>
<head>
<style>
body {
padding: 0;
margin: 0;
}
/* Dark theme styles */
@media (prefers-color-scheme: dark) {
body {
background-color: #121212; /* Almost black */
color: #ffffff; /* White */
}
}
* {
box-sizing: border-box;
}
#terminal {
height: 70vh;
padding:20px;
overflow: scroll;
}
.options {
padding: 0.75em;
}
.info {
float: right;
}
#connect {
margin-right: 2em;
}
label.checkbox {
margin-right: 1em;
}
</style>
<script type="module" crossorigin src="https://googlechromelabs.github.io/serial-terminal/assets/index.15524ea3.js"></script>
<link rel="stylesheet" href="WebSerialXTerm.css">
<link rel="manifest" href="https://googlechromelabs.github.io/serial-terminal/manifest.webmanifest">
<script id="vite-plugin-pwa:register-sw" src="https://googlechromelabs.github.io/serial-terminal/registerSW.js"></script>
<style>
.xterm {
padding: 20px; /* want a bit of spavce on left side */
}
.xterm .xterm-viewport a {
color: #00ff00; /* Bright green */
text-decoration: underline;
}
</style>
<script type="module" src="https://ldijkman.github.io/async-esp-fs-webserver/ESP_Web_Tools/install-button.js?module"></script>
</head>
<body>
<div class="options">
<label for="ports">Port:</label>
<select id="ports">
<option value="prompt">Click 'Connect' to add a port...</option>
</select>
<button id="connect">Connect</button>
<button id="download">Download output</button>
<button id="clear">Clear output</button>
<div class="info">
<a id="polyfill_switcher"></a>
</div>
<br>
<label for="baudrate">Baud rate:</label>
<select id="baudrate">
<option value="9600">9600</option>
<option value="14400">14400</option>
<option value="19200">19220</option>
<option value="28800">28800</option>
<option value="38400">38400</option>
<option value="57600">57600</option>
<option value="115200" selected>115200</option>
<option value="230400">230400</option>
<option value="460800">460800</option>
<option value="921600">921600</option>
<option value="custom">Custom</option>
</select>
<input id="custom_baudrate" type="number" min="1" placeholder="Enter baudrate..." hidden>
<label for="databits">Data bits:</label>
<select id="databits">
<option value="7">7</option>
<option value="8" selected>8</option>
</select>
<label for="parity">Parity:</label>
<select id="parity">
<option value="none" selected>None</option>
<option value="even">Even</option>
<option value="odd">Odd</option>
</select>
<label for="stopbits">Stop bits:</label>
<select id="stopbits">
<option value="1" selected>1</option>
<option value="2">2</option>
</select>
<input id="rtscts" type="checkbox" checked>
<label for="rtscts">Hardware flow control</label>
<br>
<input id="echo" type="checkbox" checked>
<label class="checkbox" for="echo">Local echo</label>
<input id="enter_flush" type="checkbox" checked>
<label class="checkbox" for="enter_flush">Flush on enter</label>
<input id="convert_eol" type="checkbox" checked>
<label class="checkbox" for="convert_eol">Convert EOL</label>
<input id="autoconnect" type="checkbox">
<label class="checkbox" for="autoconnect">Automatically connect</label>
<br>
<font style="color: green;">Links in Terminal are Clickable! <font style="color: orange;">(links should have an offset color)</font></font>
<esp-web-install-button manifest="https://ldijkman.github.io/async-esp-fs-webserver/both.json">
<button slot="activate">Flash 4mb ESP8266 / ESP32</button>
<span style="color: red; font-size: 24px; font-weight: bold;" slot="unsupported">Ah Damn, your browser doesn't work! <br>Open this Page in a Chromium Based PC Browser!<br>and an Connect Install button will be here!</span>
<span style="color: red; font-size: 24px; font-weight: bold;" slot="not-allowed">Ah Damn, you are not allowed to use this on HTTP!</span>
</esp-web-install-button>
<br>
<div class="info">
<a href="https://github.com/GoogleChromeLabs/serial-terminal" target="_blank">GoogleChromeLabs</a><br>
<a href="https://github.com/ldijkman/async-esp-fs-webserver/blob/master/docs/WebSerialMonitor.html" target="_blank">This Terminal Source</a>
</div>
</div>
<div id="terminal"></div>
<!-- Floating Div for GitHub Links, Serial Monitor, and Flash Tool -->
<script src="foother.js"></script>
<script src="https://ldijkman.github.io/Ace_Seventh_Heaven/console.js"></script>
<script>
// want to change the link color
// no luck yet
setTimeout(function() {
console.info("Greet Luberth");
console.warn("https://github.com/xtermjs/xterm.js/discussions/4967");
console.info("Please Help!?");
console.info("Do you have the Knowledge how to color the Links");
console.error("Links are Clickable!");
}, 5000); // Delay is in milliseconds, so 5000 ms is equal to 5 seconds
var faviconState = 0;
var faviconA = 'path/to/your/standard/favicon.ico';
var faviconB = 'path/to/your/red/favicon.ico';
function changeFavicon(src) {
var link = document.querySelector("link[rel*='icon']") || document.createElement('link');
link.type = 'image/x-icon';
link.rel = 'shortcut icon';
link.href = src;
document.getElementsByTagName('head')[0].appendChild(link);
}
function blinkFavicon() {
if(faviconState === 0) {
changeFavicon(faviconB); // Change to the red or alternate favicon
faviconState = 1;
} else {
changeFavicon(faviconA); // Change back to the standard favicon
faviconState = 0;
}
}
// Start blinking effect
setInterval(blinkFavicon, 1000); // Adjust the interval as needed
</script>
</body>
</html>