Skip to content

Commit c3f8e0f

Browse files
authored
Merge pull request micropython#8667 from tannewt/ww_large_file
Improve web workflow error handling
2 parents db3b5ff + 31d5779 commit c3f8e0f

File tree

8 files changed

+137
-51
lines changed

8 files changed

+137
-51
lines changed

docs/workflows.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,31 @@ curl -v -L http://circuitpython.local/cp/devices.json
368368
}
369369
```
370370

371+
#### `/cp/diskinfo.json`
372+
373+
Returns information about the attached disk(s). A list of objects, one per disk.
374+
375+
* `root`: Filesystem path to the root of the disk.
376+
* `free`: Count of free bytes on the disk.
377+
* `block_size`: Size of a block in bytes.
378+
* `writable`: True when CircuitPython and the web workflow can write to the disk. USB may claim a disk instead.
379+
* `total`: Total bytes that make up the disk.
380+
381+
Example:
382+
```sh
383+
curl -v -L http://circuitpython.local/cp/diskinfo.json
384+
```
385+
386+
```json
387+
[{
388+
"root": "/",
389+
"free": 2964992,
390+
"block_size": 512,
391+
"writable": true,
392+
"total": 2967552
393+
}]
394+
```
395+
371396
#### `/cp/serial/`
372397

373398

@@ -380,7 +405,7 @@ This is an authenticated endpoint in both modes.
380405

381406
Returns information about the device.
382407

383-
* `web_api_version`: Always `1`. This versions the rest of the API and new versions may not be backwards compatible.
408+
* `web_api_version`: Between `1` and `3`. This versions the rest of the API and new versions may not be backwards compatible. See below for more info.
384409
* `version`: CircuitPython build version.
385410
* `build_date`: CircuitPython build date.
386411
* `board_name`: Human readable name of the board.
@@ -436,3 +461,9 @@ CircuitPython is expected to be masked UTF-8, as the spec requires. Data from Ci
436461
client is unmasked. It is also unbuffered so the client will get a variety of frame sizes.
437462

438463
Only one WebSocket at a time is supported.
464+
465+
### Versions
466+
467+
* `1` - Initial version.
468+
* `2` - Added `/cp/diskinfo.json`.
469+
* `3` - Changed `/cp/diskinfo.json` to return a list in preparation for multi-disk support.

supervisor/shared/web_workflow/static/directory.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<title></title>
55
<meta charset="UTF-8">
66
<link rel="stylesheet" href="/style.css">
7-
<link rel="stylesheet" href="http://circuitpython.org/assets/css/webworkflow-8.css">
7+
<link rel="stylesheet" href="http://circuitpython.org/assets/css/webworkflow-9.css">
88
</head>
99
<body>
1010
<h1><a href="/"><img src="/favicon.ico"/></a>&nbsp;<span id="path"></span></h1>

supervisor/shared/web_workflow/static/edit.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="UTF-8">
55
<title>Offline Code Edit</title>
6-
<link rel="stylesheet" href="http://circuitpython.org/assets/css/webworkflow-8.css">
6+
<link rel="stylesheet" href="http://circuitpython.org/assets/css/webworkflow-9.css">
77
<link rel="stylesheet" href="/style.css">
88
</head>
99
<body>

supervisor/shared/web_workflow/static/serial.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta charset="UTF-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<link rel="stylesheet" href="/style.css">
8-
<link rel="stylesheet" href="http://circuitpython.org/assets/css/webworkflow-8.css">
8+
<link rel="stylesheet" href="http://circuitpython.org/assets/css/webworkflow-9.css">
99
</head>
1010
<body style="flex-direction: column; display: flex; height: 100%; width: 100%; margin: 0; font-size: 1rem;">
1111
<div style="flex: auto; display: flex; overflow: auto; flex-direction: column;">

supervisor/shared/web_workflow/static/welcome.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta charset="UTF-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<link rel="stylesheet" href="/style.css">
8-
<link rel="stylesheet" href="http://circuitpython.org/assets/css/webworkflow-8.css">
8+
<link rel="stylesheet" href="http://circuitpython.org/assets/css/webworkflow-9.css">
99
</head>
1010
<body>
1111

0 commit comments

Comments
 (0)