From d47beb8f5bb394f80840a950670929c164b44e24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claudio=20G=C3=B6tz?= Date: Fri, 28 Jul 2023 10:15:57 +0200 Subject: [PATCH] fix web interface, uploading etc # Conflicts: # include/handler_api.h # Conflicts: # contrib/www/index.html # include/handler_api.h --- contrib/www/index.html | 49 ++++++++++++++++++++++++++++++++++++++++++ include/handler_api.h | 6 ++++++ 2 files changed, 55 insertions(+) diff --git a/contrib/www/index.html b/contrib/www/index.html index a9bda84b..d6b8546a 100644 --- a/contrib/www/index.html +++ b/contrib/www/index.html @@ -718,7 +718,10 @@

Client certificate upload

path: '/', files: [], selectedFiles: [], +<<<<<<< HEAD tonies: [], +======= +>>>>>>> bcbad4f (fix web interface, uploading etc) }; this.fetchFileIndex = this.fetchFileIndex.bind(this); this.uploadFiles = this.uploadFiles.bind(this); @@ -728,7 +731,10 @@

Client certificate upload

this.deleteSelectedFiles = this.deleteSelectedFiles.bind(this); this.toggleFileSelection = this.toggleFileSelection.bind(this); this.selectAllFiles = this.selectAllFiles.bind(this); +<<<<<<< HEAD this.oggPlayerRef = React.createRef(); +======= +>>>>>>> bcbad4f (fix web interface, uploading etc) } componentDidMount() { @@ -840,7 +846,11 @@

Client certificate upload

const response = await fetch(api, { method: 'POST', headers: { 'Content-Type': 'text/plain' }, +<<<<<<< HEAD body: this.state.path + '/' + file.name, +======= + body: this.state.path + file.name, +>>>>>>> bcbad4f (fix web interface, uploading etc) }); if (response.ok && await response.text() === 'OK') { @@ -854,9 +864,13 @@

Client certificate upload

} } +<<<<<<< HEAD if (failedCount > 0) { alert(`Deleted: ${deletedCount}, Failed: ${failedCount} `); } +======= + alert(`Deleted: ${deletedCount}, Failed: ${failedCount} `); +>>>>>>> bcbad4f (fix web interface, uploading etc) this.setState({ selectedFiles: [] }); this.fetchFileIndex(this.state.path); // Refresh files after delete } @@ -922,6 +936,7 @@

File Viewer

)} +<<<<<<< HEAD {this.state.files.map((file, index) => { let maxLen = 24; let filename = file.name.substring(0, maxLen); @@ -1008,13 +1023,47 @@

File Viewer

}) } +======= + {this.state.files.map((file, index) => ( +
+                                 this.toggleFileSelection(file)}
+                                />
+                                {file.isDirectory ? (
+                                    
+                                         { e.preventDefault(); this.fetchFileIndex(`${this.state.path}${file.name}/`); }}>
+                                            {file.name}
+                                        
+                                        {' '.repeat(32 - file.name.length)}
+                                        {file.date}
+                                        {'-'.padStart(10)}
+                                    
+                                ) : (
+                                    
+                                        
+                                            {file.name}
+                                        
+                                        {' '.repeat(32 - file.name.length)}
+                                        {file.date.padEnd(10)}
+                                        {file.size.padStart(10)}
+                                    
+                                )
+                                }
+                            
+ ))} +>>>>>>> bcbad4f (fix web interface, uploading etc) ); } } +<<<<<<< HEAD +======= +>>>>>>> bcbad4f (fix web interface, uploading etc) class App extends React.Component { constructor(props) { super(props); diff --git a/include/handler_api.h b/include/handler_api.h index ea833867..1b10349f 100644 --- a/include/handler_api.h +++ b/include/handler_api.h @@ -16,10 +16,16 @@ error_t handleApiSet(HttpConnection *connection, const char_t *uri, const char_t error_t handleApiTrigger(HttpConnection *connection, const char_t *uri, const char_t *queryString); error_t handleApiFileIndex(HttpConnection *connection, const char_t *uri, const char_t *queryString); <<<<<<< HEAD +<<<<<<< HEAD +======= +>>>>>>> bcbad4f (fix web interface, uploading etc) error_t handleApiFileUpload(HttpConnection *connection, const char_t *uri, const char_t *queryString); error_t handleApiDirectoryCreate(HttpConnection *connection, const char_t *uri, const char_t *queryString); error_t handleApiFileDelete(HttpConnection *connection, const char_t *uri, const char_t *queryString); error_t handleApiDirectoryDelete(HttpConnection *connection, const char_t *uri, const char_t *queryString); +<<<<<<< HEAD ======= error_t handleApiFileUpload(HttpConnection *connection, const char_t *uri, const char_t *queryString); >>>>>>> e6efbc1 (passthrough queryString) +======= +>>>>>>> bcbad4f (fix web interface, uploading etc)