-
-
Notifications
You must be signed in to change notification settings - Fork 48
/
settings.html
155 lines (143 loc) · 8.17 KB
/
settings.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
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="/advanced_terminal/src/css/style.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fastest Serial terminal in your browser for Chrome.</title>
<meta name="Description" content="Set your baud speed and hit connect.
A serial terminal that runs with out any plugins in chrome.">
</head>
<body>
<form>
<div class="topnav">
<button class="active btn btn-primary" type="button" onclick="location.href='index.html'">🏠</button>
<button class="active btn btn-primary" style="color: rgb(60, 255, 1);" type="button"
onclick="location.href='advanced_terminal/src/html/index.html'">🖳</button>
<br>
</div>
<div>
<h1>Settings</h1>
<p>
This is a serial terminal that runs without any plugins in chrome.
In this section you can configure your advanced settings.
</p>
<section class="info-note">
<p>
<span class="icon-span-note"><svg class="info-note-svg" viewBox="0 0 16 16" version="1.1" width="16"
height="16" aria-hidden="true">
<path fill-rule="evenodd"
d="M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM0 8a8 8 0 1116 0A8 8 0 010 8zm6.5-.25A.75.75 0 017.25 7h1a.75.75 0 01.75.75v2.75h.25a.75.75 0 010 1.5h-2a.75.75 0 010-1.5h.25v-2h-.25a.75.75 0 01-.75-.75zM8 6a1 1 0 100-2 1 1 0 000 2z">
</path>
</svg><b> Note:</b>
<p>
If you are using an ESP32Cam module, RTS and DTS <em>must be</em> turned off
</p>
</span>
</p>
</section>
<br>
<section class="settings-pane">
<div class="card">
<div class="container">
<h2>Serial Settings</h2>
<div class="buttonGroup">
<button style="color: rgb(60, 255, 1);" class="btn btn-primary" type="button"
id="forgetDevice" onclick='forgetTrigger()'>Forget
Device</button>
</div>
<section class="checkBoxes">
<br>
<label for="rtsOn">
<input type="checkbox" id="rtsOn" onclick="localStorage.rtsOn = this.checked;"
unchecked>RTS
</label>
<label for="dtrOn">
<input type="checkbox" id="dtrOn" onclick="localStorage.dtrOn = this.checked;"
unchecked>DTR
</label>
<label for="dtrDsrOn">
<input type="checkbox" id="dtrDsrOn" onclick="localStorage.dtrDsrOn = this.checked;"
unchecked>dtrDsr
</label>
<label for="rtsCtsOn">
<input type="checkbox" id="rtsCtsOn" onclick="localStorage.rtsCtsOn = this.checked;"
unchecked>rtsCts
</label>
</section>
<br>
<details>
<summary>Advanced Settings</summary>
<br>
<section class="advancedInputs">
<ul>
<li class="form-row">
<label for="bufferSize"> Buffer Size:
<input type="number" id="bufferSize" style="width: 10ch;"
onchange='fillObject(portSettings, "bufferSize", this.value)'>
</label>
</li>
<li class="form-row">
<label for="parity"> Parity:
<input type="text" id="parity" style="width: 10ch;"
onchange='fillObject(portSettings, "parity", this.value)'>
</label>
</li>
<li class="form-row">
<label for="dataBits"> Data Bits:
<input type="number" id="dataBits" style="width: 10ch;"
onchange='fillObject(portSettings, "dataBits", this.value)'>
</label>
</li>
<li class="form-row">
<label for="stopBits"> Stop Bits:
<input type="number" id="stopBits" style="width: 10ch;"
onchange='fillObject(portSettings, "stopBits", this.value)'>
</label>
</li>
<li class="form-row">
<label for="flowControl"> Flow Control:
<input type="text" id="flowControl" style="width: 10ch;"
onchange='fillObject(portSettings, "flowControl", this.value)'>
</label>
</li>
</ul>
</section>
</details>
<br>
</div>
</div>
</section>
</div>
<br> © 2021 Autodrop3d Source && ZanzyTHEbar <a
href="https://github.com/autodrop3d/serialTerminal.com">https://github.com/autodrop3d/serialTerminal.com</a>
</form>
<script>
function fillObject(obj, key, value) {
obj[key] = value;
var temp = JSON.stringify(obj);
console.log(temp);
localStorage.setItem("portSettings", temp);
}
var portSettings_deserialized = JSON.parse(localStorage.getItem("portSettings"));
document.getElementById("rtsOn").checked = (localStorage.rtsOn == "false" ? false : true);
document.getElementById("dtrOn").checked = (localStorage.dtrOn == "false" ? false : true);
document.getElementById("rtsCtsOn").checked = (localStorage.rtsCtsOn == "true" ? true : false);
document.getElementById("dtrDsrOn").checked = (localStorage.dtrDsrOn == "true" ? true : false);
document.getElementById("forgetDevice").onclick = function () {
localStorage.forgetDevice == "true" ? localStorage.forgetDevice = "false" : localStorage.forgetDevice = "true";
if (localStorage.forgetDevice == "true") alert("Forget Activated - Device will be forgotten when you visit the terminal page again.");
else if (alert("Forget Deactivated"));
};
document.getElementById("bufferSize").value =
portSettings_deserialized.bufferSize == undefined ? "0" : portSettings_deserialized.bufferSize;
document.getElementById("parity").value =
portSettings_deserialized.parity == undefined ? "none" : portSettings_deserialized.parity;
document.getElementById("dataBits").value =
portSettings_deserialized.dataBits == undefined ? "0" : portSettings_deserialized.dataBits;
document.getElementById("stopBits").value =
localStorage.portSettings.stopBits == undefined ? "0" : portSettings_deserialized.stopBits;
document.getElementById("flowControl").value =
portSettings_deserialized.flowControl == undefined ? "none" : portSettings_deserialized.flowControl;
</script>
</body>
</html>