From 7dab8eb109f41f30afe062637f408fba47788f05 Mon Sep 17 00:00:00 2001 From: GMrrc <143954951+GMrrc@users.noreply.github.com> Date: Thu, 14 Nov 2024 17:04:30 +0100 Subject: [PATCH] change name to webserver to webtransfer --- appinfo/info.xml | 12 ++++----- appinfo/routes.php | 1 - css/style.css | 14 ----------- lib/Controller/ApiController.php | 2 +- lib/Controller/FileController.php | 42 ------------------------------- lib/Controller/PageController.php | 4 +-- src/App.vue | 4 +-- src/main.js | 2 +- templates/index.php | 4 +-- templates/main.php | 11 -------- 10 files changed, 14 insertions(+), 82 deletions(-) delete mode 100644 css/style.css delete mode 100644 lib/Controller/FileController.php delete mode 100644 templates/main.php diff --git a/appinfo/info.xml b/appinfo/info.xml index be0b994..1be8da3 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -1,14 +1,14 @@ - webserver - Web Server + webtransfer + Web Transfer Allow users to transfer files from another repository Allow users to transfer files from another repository 1.0.0 agpl Guillaume Marrec - WebServer + WebTransfer files https://gmrrc.fr @@ -16,9 +16,9 @@ - webserver - Web Server - webserver.page.index + webtransfer + Web Transfer + webtransfer.page.index app.svg link diff --git a/appinfo/routes.php b/appinfo/routes.php index 326e20e..e5cd06d 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -2,6 +2,5 @@ return [ 'routes' => [ ['name' => 'page#main', 'url' => '/', 'verb' => 'GET'], - ['name' => 'file#upload', 'url' => '/upload', 'verb' => 'POST'] ] ]; diff --git a/css/style.css b/css/style.css deleted file mode 100644 index 9087c36..0000000 --- a/css/style.css +++ /dev/null @@ -1,14 +0,0 @@ -#drop-zone { - width: 100%; - height: 200px; - border: 2px dashed #0078d4; - display: flex; - align-items: center; - justify-content: center; - color: #555; - } - #drop-zone.hover { - border-color: #005bb5; - background-color: #f0f8ff; - } - \ No newline at end of file diff --git a/lib/Controller/ApiController.php b/lib/Controller/ApiController.php index 58ae596..85057c5 100644 --- a/lib/Controller/ApiController.php +++ b/lib/Controller/ApiController.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace OCA\WebServer\Controller; +namespace OCA\WebTransfer\Controller; use OCP\AppFramework\Http; use OCP\AppFramework\Http\Attribute\ApiRoute; diff --git a/lib/Controller/FileController.php b/lib/Controller/FileController.php deleted file mode 100644 index 829fdad..0000000 --- a/lib/Controller/FileController.php +++ /dev/null @@ -1,42 +0,0 @@ -request->getUploadedFile('file'); - - // Vérifiez si le fichier a été bien reçu - if (!$uploadedFile) { - return new DataResponse(['status' => 'error', 'message' => 'No file uploaded'], 400); - } - - try { - // Sauvegardez le fichier dans le dossier de l'utilisateur - $userFolder = \OC::$server->getUserFolder(); - $userFolder->newFile($uploadedFile['name'], file_get_contents($uploadedFile['tmp_name'])); - - return new DataResponse(['status' => 'success', 'filename' => $uploadedFile['name']]); - - } catch (\Exception $e) { - // Loggez l'erreur pour plus de détails - \OC::$server->getLogger()->error("File upload error: " . $e->getMessage(), ['app' => 'webserver']); - - return new DataResponse(['status' => 'error', 'message' => 'Failed to save file'], 500); - } - } - -} diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index cbd7e8c..2a2b18e 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace OCA\WebServer\Controller; +namespace OCA\WebTransfer\Controller; -use OCA\WebServer\AppInfo\Application; +use OCA\WebTransfer\AppInfo\Application; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\Attribute\FrontpageRoute; use OCP\AppFramework\Http\Attribute\NoAdminRequired; diff --git a/src/App.vue b/src/App.vue index 8a04979..a4d3c13 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,6 +1,6 @@