Skip to content

A Hardware Hacking Tool with Web-Based CLI That Speaks Every Protocol

fix connection lost message for mobile

Geo88c9a936262e
diff --git a/src/Controllers/I2cController.cpp b/src/Controllers/I2cController.cpp
index 9cdfc9ee..96c357a4 100644
--- a/src/Controllers/I2cController.cpp
+++ b/src/Controllers/I2cController.cpp
@@ -53,7 +53,7 @@ void I2cController::handleInstruction(const std::vector<ByteCode>& bytecodes) {
Scan
*/
void I2cController::handleScan() {
- terminalView.println("I2C Scan: Scanning I2C bus... Press ENTER to stop");
+ terminalView.println("I2C Scan: Scanning I2C bus... Press [ENTER] to stop");
terminalView.println("");
bool found = false;
@@ -83,7 +83,7 @@ void I2cController::handleScan() {
Sniff
*/
void I2cController::handleSniff() {
- terminalView.println("I2C Sniffer: Listening... Press ENTER to stop.\n");
+ terminalView.println("I2C Sniffer: Listening... Press [ENTER] to stop.\n");
i2c_sniffer_begin(state.getI2cSclPin(), state.getI2cSdaPin()); // dont need freq to work
i2c_sniffer_setup();
diff --git a/src/Controllers/InfraredController.cpp b/src/Controllers/InfraredController.cpp
index 1395f751..b72e5ccc 100644
--- a/src/Controllers/InfraredController.cpp
+++ b/src/Controllers/InfraredController.cpp
@@ -104,7 +104,7 @@ void InfraredController::handleReceive() {
DeviceBgone
*/
void InfraredController::handleDeviceBgone() {
- terminalView.println("Sending Device-B-Gone commands... Press ENTER to stop");
+ terminalView.println("Sending Device-B-Gone commands... Press [ENTER] to stop");
for (const auto& cmd : deviceBgoneCommands) {
diff --git a/src/Controllers/OneWireController.cpp b/src/Controllers/OneWireController.cpp
index d1522412..47ce6ef7 100644
--- a/src/Controllers/OneWireController.cpp
+++ b/src/Controllers/OneWireController.cpp
@@ -101,7 +101,7 @@ void OneWireController::handlePing() {
Read
*/
void OneWireController::handleRead() {
- terminalView.println("OneWire Read: Press ENTER to stop.\n");
+ terminalView.println("OneWire Read: Press [ENTER] to stop.\n");
while (true) {
auto key = terminalInput.readChar();
@@ -227,7 +227,7 @@ void OneWireController::handleIdWrite(std::vector<uint8_t> idBytes) {
int attempt = 0;
bool success = false;
- terminalView.println("OneWire ID Write: Waiting for device... Press ENTER to stop");
+ terminalView.println("OneWire ID Write: Waiting for device... Press [ENTER] to stop");
// Wait detection
while (!oneWireService.reset()) {
@@ -284,7 +284,7 @@ void OneWireController::handleScratchpadWrite(std::vector<uint8_t> scratchpadByt
int attempt = 0;
bool success = false;
- terminalView.println("OneWire Write: Waiting for device... Press ENTER to stop");
+ terminalView.println("OneWire Write: Waiting for device... Press [ENTER] to stop");
// Wait for device presence
while (!oneWireService.reset()) {
@@ -367,7 +367,7 @@ void OneWireController::handleConfig() {
Sniff
*/
void OneWireController::handleSniff() {
- terminalView.println("OneWire Sniff: Oberserving data line... Press ENTER to stop.\n");
+ terminalView.println("OneWire Sniff: Oberserving data line... Press [ENTER] to stop.\n");
// Init the pin to read passively
uint8_t pin = state.getOneWirePin();
diff --git a/src/Controllers/WifiController.cpp b/src/Controllers/WifiController.cpp
index 9248abbf..1d590a9b 100644
--- a/src/Controllers/WifiController.cpp
+++ b/src/Controllers/WifiController.cpp
@@ -291,8 +291,8 @@ Config
*/
void WifiController::handleConfig() {
terminalView.println("[WARNING] If you're connected via Web CLI,");
- terminalView.println(" executing Wi-Fi configuration commands may");
- terminalView.println(" cause the terminal session to disconnect.");
+ terminalView.println(" executing Wi-Fi commands may cause ");
+ terminalView.println(" the terminal session to disconnect.");
terminalView.println(" Use USB serial or restart if connection is lost.\n");
}
diff --git a/webui/index.h b/webui/index.h
index 19fcc8e8..e8cd3771 100644
--- a/webui/index.h
+++ b/webui/index.h
@@ -20,7 +20,8 @@ inline const char* index_html = R"rawliteral(
<div id="history" class="history-area"></div>
</main>
<div id="ws-lost-popup" class="popup" style="display: none;">
- Connection lost. <a href="#" onclick="location.reload()">Refresh</a>
+ <span class="popup-text">Connection lost.</span>
+ <a href="#" onclick="location.reload()">Refresh</a>
</div>
<script src="/scripts.js"></script>
</body>
diff --git a/webui/style.h b/webui/style.h
index 30580d77..cae1f9dd 100644
--- a/webui/style.h
+++ b/webui/style.h
@@ -176,16 +176,33 @@ button:hover {
box-shadow: 0 0 8px #000;
z-index: 9999;
font-size: 0.95rem;
+ max-width: 90vw;
+
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: 10px;
+
+ white-space: nowrap;
+ overflow: hidden;
+}
+
+.popup-text {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
}
+
.popup a {
- color: #00ffcc;;
+ color: #00ffcc;
text-decoration: underline;
- margin-left: 10px;
+ flex-shrink: 0;
}
+
.popup a:hover {
color: #00ffff;
}
-
+
/* Responsive */
@media (max-width: 600px), (max-height: 600px) {
@@ -194,6 +211,11 @@ button:hover {
gap: 6px;
}
+ .popup {
+ font-size: 0.8rem;
+ }
+
+
#output {
font-size: 0.8rem;
padding: 8px;