Add USB warning

This commit is contained in:
Scott Shawcroft 2022-06-30 16:54:06 -07:00
parent 95d3289df6
commit a59b52bd43
No known key found for this signature in database
GPG Key ID: 0DFD512649C052DA
2 changed files with 23 additions and 3 deletions

View File

@ -1,4 +1,20 @@
<!DOCTYPE html><html><head><title></title><meta charset="UTF-8"></head>
<script src="/directory.js" defer=true></script>
<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>
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="UTF-8">
<script src="/directory.js" defer=true></script>
</head>
<body>
<h1><a href="/"><img src="/favicon.ico"/></a>&nbsp;<span id="path"></span></h1>
<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>
<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>
</body></html>

View File

@ -37,6 +37,10 @@ async function refresh_list() {
editable = status.headers.get("Access-Control-Allow-Methods").includes("DELETE");
new_directory_name.disabled = !editable;
files.disabled = !editable;
if (!editable) {
let usbwarning = document.querySelector("#usbwarning");
usbwarning.style.display = "block";
}
}
if (window.location.path != "/fs/") {