Add /code/ for online editing
This commit is contained in:
parent
4b1d1fd72d
commit
525eb711c1
12
supervisor/shared/web_workflow/static/code.html
Normal file
12
supervisor/shared/web_workflow/static/code.html
Normal file
@ -0,0 +1,12 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Online Code Editor</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script type="module" src="https://code.circuitpython.org/assets/js/device.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Code Edit</title>
|
||||
<title>Offline Code Edit</title>
|
||||
<link rel="stylesheet" href="http://circuitpython.org/assets/css/webworkflow-8.css">
|
||||
<link rel="stylesheet" href="/style.css">
|
||||
</head>
|
||||
|
@ -926,6 +926,7 @@ static void _write_file_and_reply(socketpool_socket_obj_t *socket, _request *req
|
||||
|
||||
#define STATIC_FILE(filename) extern uint32_t filename##_length; extern uint8_t filename[]; extern const char *filename##_content_type;
|
||||
|
||||
STATIC_FILE(code_html);
|
||||
STATIC_FILE(directory_html);
|
||||
STATIC_FILE(directory_js);
|
||||
STATIC_FILE(welcome_html);
|
||||
@ -1143,6 +1144,8 @@ static bool _reply(socketpool_socket_obj_t *socket, _request *request) {
|
||||
} else {
|
||||
_REPLY_STATIC(socket, request, edit_html);
|
||||
}
|
||||
} else if (strcmp(request->path, "/code/") == 0) {
|
||||
_REPLY_STATIC(socket, request, code_html);
|
||||
} else if (strncmp(request->path, "/cp/", 4) == 0) {
|
||||
const char *path = request->path + 3;
|
||||
if (strcasecmp(request->method, "OPTIONS") == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user