131 lines
2.8 KiB
HTML
131 lines
2.8 KiB
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<title>ESP communication</title>
|
|
<style>
|
|
body {
|
|
display: flex;
|
|
flex-direction: column;
|
|
height: calc(100vh - 10px);
|
|
padding: 5px;
|
|
margin: 0pt;
|
|
}
|
|
p {
|
|
margin: 0pt;
|
|
}
|
|
.connection-management {
|
|
display: flex;
|
|
gap: 5px;
|
|
margin-bottom: 5px;
|
|
}
|
|
|
|
#clear-button {
|
|
margin-left: auto;
|
|
}
|
|
|
|
#inner-console {
|
|
background-color: #ccc;
|
|
padding: 10px;
|
|
height: 300px;
|
|
overflow: scroll;
|
|
overflow-x: hidden;
|
|
white-space: pre-wrap;
|
|
font-family: monospace;
|
|
display: flex;
|
|
flex-direction: column;
|
|
border: 1px solid black;
|
|
flex-grow: 1;
|
|
}
|
|
|
|
.p-console {
|
|
width: 100%;
|
|
}
|
|
|
|
.p-log {
|
|
background-color: yellow;
|
|
}
|
|
|
|
.p-incoming {
|
|
background-color: lightgreen;
|
|
}
|
|
|
|
.p-outgoing {
|
|
background-color: lightblue;
|
|
}
|
|
|
|
.p-error {
|
|
background-color: red;
|
|
color: white;
|
|
}
|
|
|
|
.console-management {
|
|
display: flex;
|
|
flex-direction: column;
|
|
margin-top: 5px;
|
|
gap: 5px;
|
|
}
|
|
|
|
.console-management > div {
|
|
display: flex;
|
|
gap: 5px;
|
|
}
|
|
|
|
.console-management > div > input[type="text"] {
|
|
flex-grow: 1;
|
|
}
|
|
|
|
#open-button {
|
|
background-color: green;
|
|
color: white;
|
|
}
|
|
#close-button {
|
|
background-color: red;
|
|
color: white;
|
|
}
|
|
#clear-button {
|
|
background-color: red;
|
|
color: white;
|
|
}
|
|
#send-button {
|
|
background-color: blue;
|
|
color: white;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div class="connection-management">
|
|
<select id="port-select">
|
|
<option value="" disabled>No ports found</option>
|
|
</select>
|
|
<button id="rescan" onclick="listSerialPorts()">Rescan</button>
|
|
<button id="open-button" onclick="openConnection()">Open</button>
|
|
<button
|
|
id="close-button"
|
|
style="display: none"
|
|
onclick="closeConnection()"
|
|
>
|
|
Close
|
|
</button>
|
|
<button id="clear-button" onclick="clearConsole()">Clear console</button>
|
|
</div>
|
|
<div id="inner-console"></div>
|
|
<div class="console-management">
|
|
<div>
|
|
<input type="checkbox" id="message-mode" onchange="toogleMsgMode()" />
|
|
<p>Message mode</p>
|
|
<input type="text" id="sender" placeholder="Sender" disabled />
|
|
<div style="flex-grow: 1"></div>
|
|
</div>
|
|
<div style="flex-grow: 1">
|
|
<p>></p>
|
|
<input type="text" id="console-input" />
|
|
<button id="send-button" onclick="sendToSerial()">Send</button>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
|
|
<script src="./renderer.js"></script>
|
|
</html>
|