8000 Add USB warning · kevincon/circuitpython@a59b52b · GitHub
[go: up one dir, main page]

Skip to content

Commit a59b52b

Browse files
committed
Add USB warning
1 parent 95d3289 commit a59b52b

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed
Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1-
<!DOCTYPE html><html><head><title></title><meta charset="UTF-8"></head>
2-
<script src="/directory.js" defer=true></script>
3-
<body><h1><a href="/"><img src="/favicon.ico"/></a>&nbsp;<span id="path"></span></h1><template id="row"><tr><td></td><td></td><td><a></a></td><td></td><td><button class="delete">🗑️</button></td></tr></template><table><thead><tr><th>Type</th><th>Size</th><th>Path</th><th>Modified</th><th></th></tr></thead><tbody></tbody></table><hr><input type="file" id="files" multiple><button type="submit" id="upload">Upload</button><hr>+🗀&nbsp;<input type="text" id="name"><button type="submit" id="mkdir">Create Directory</button>
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title></title>
5+
<meta charset="UTF-8">
6+
<script src="/directory.js" defer=true></script>
7+
</head>
8+
<body>
9+
<h1><a href="/"><img src="/favicon.ico"/></a>&nbsp;<span id="path"></span></h1>
10+
<div id="usbwarning" style="display: none;">🛈 USB is using the storage. Only allowing reads. See <a href="https://learn.adafruit.com/circuitpython-essentials/circuitpython-storage">the CircuitPython Essentials: Storage guide</a> for details.</div>
11+
<template id="row"><tr><td></td><td></td><td><a></a></td><td></td><td><button class="delete">🗑️</button></td></tr></template>
12+
<table>
13+
<thead><tr><th>Type</th><th>Size</th><th>Path</th><th>Modified</th><th></th></tr></thead>
14+
<tbody></tbody>
15+
</table>
16+
<hr>
17+
<input type="file" id="files" multiple><button type="submit" id="upload">Upload</button>
18+
<hr>
19+
+🗀&nbsp;<input type="text" id="name"><button type="submit" id="mkdir">Create Directory</button>
420
</body></html>

supervisor/shared/web_workflow/static/directory.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ async function refresh_list() {
3737
editable = status.headers.get("Access-Control-Allow-Methods").includes("DELETE");
3838
new_directory_name.disabled = !editable;
3939
files.disabled = !editable;
40+
if (!editable) {
41+
let usbwarning = document.querySelector("#usbwarning");
42+
usbwarning.style.display = "block";
43+
}
4044
}
4145

4246
if (window.location.path != "/fs/") {

0 commit comments

Comments
 (0)
0