change name to webserver to webtransfer
This commit is contained in:
parent
bf0ff5adc2
commit
7dab8eb109
@ -1,14 +1,14 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<info xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<info xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="https://apps.nextcloud.com/schema/apps/info.xsd">
|
xsi:noNamespaceSchemaLocation="https://apps.nextcloud.com/schema/apps/info.xsd">
|
||||||
<id>webserver</id>
|
<id>webtransfer</id>
|
||||||
<name>Web Server</name>
|
<name>Web Transfer</name>
|
||||||
<summary>Allow users to transfer files from another repository</summary>
|
<summary>Allow users to transfer files from another repository</summary>
|
||||||
<description>Allow users to transfer files from another repository</description>
|
<description>Allow users to transfer files from another repository</description>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
<licence>agpl</licence>
|
<licence>agpl</licence>
|
||||||
<author mail="guillaume.marrec.frey@proton.me" homepage="">Guillaume Marrec</author>
|
<author mail="guillaume.marrec.frey@proton.me" homepage="">Guillaume Marrec</author>
|
||||||
<namespace>WebServer</namespace>
|
<namespace>WebTransfer</namespace>
|
||||||
<category>files</category>
|
<category>files</category>
|
||||||
<bugs>https://gmrrc.fr</bugs>
|
<bugs>https://gmrrc.fr</bugs>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
@ -16,9 +16,9 @@
|
|||||||
</dependencies>
|
</dependencies>
|
||||||
<navigations>
|
<navigations>
|
||||||
<navigation>
|
<navigation>
|
||||||
<id>webserver</id>
|
<id>webtransfer</id>
|
||||||
<name>Web Server</name>
|
<name>Web Transfer</name>
|
||||||
<route>webserver.page.index</route>
|
<route>webtransfer.page.index</route>
|
||||||
<icon>app.svg</icon>
|
<icon>app.svg</icon>
|
||||||
<type>link</type>
|
<type>link</type>
|
||||||
</navigation>
|
</navigation>
|
||||||
|
@ -2,6 +2,5 @@
|
|||||||
return [
|
return [
|
||||||
'routes' => [
|
'routes' => [
|
||||||
['name' => 'page#main', 'url' => '/', 'verb' => 'GET'],
|
['name' => 'page#main', 'url' => '/', 'verb' => 'GET'],
|
||||||
['name' => 'file#upload', 'url' => '/upload', 'verb' => 'POST']
|
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
@ -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;
|
|
||||||
}
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace OCA\WebServer\Controller;
|
namespace OCA\WebTransfer\Controller;
|
||||||
|
|
||||||
use OCP\AppFramework\Http;
|
use OCP\AppFramework\Http;
|
||||||
use OCP\AppFramework\Http\Attribute\ApiRoute;
|
use OCP\AppFramework\Http\Attribute\ApiRoute;
|
||||||
|
@ -1,42 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace OCA\WebServer\Controller;
|
|
||||||
|
|
||||||
use OCP\AppFramework\Http\DataResponse;
|
|
||||||
use OCP\AppFramework\Controller;
|
|
||||||
use OCP\Files\Node;
|
|
||||||
use OCP\IRequest;
|
|
||||||
|
|
||||||
class FileController extends Controller {
|
|
||||||
public function __construct(IRequest $request) {
|
|
||||||
parent::__construct($appName, $request);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @NoCSRFRequired
|
|
||||||
* @NoAdminRequired
|
|
||||||
*/
|
|
||||||
public function upload() {
|
|
||||||
$uploadedFile = $this->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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
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\Controller;
|
||||||
use OCP\AppFramework\Http\Attribute\FrontpageRoute;
|
use OCP\AppFramework\Http\Attribute\FrontpageRoute;
|
||||||
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
|
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<NcAppContent>
|
<NcAppContent>
|
||||||
<div id="webserver">
|
<div id="webtransfer">
|
||||||
<h1>Hello world!</h1>
|
<h1>Hello world!</h1>
|
||||||
</div>
|
</div>
|
||||||
</NcAppContent>
|
</NcAppContent>
|
||||||
@ -18,7 +18,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
#webserver {
|
#webtransfer {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin: 16px;
|
margin: 16px;
|
||||||
|
@ -3,4 +3,4 @@ import App from './App.vue'
|
|||||||
Vue.mixin({ methods: { t, n } })
|
Vue.mixin({ methods: { t, n } })
|
||||||
|
|
||||||
const View = Vue.extend(App)
|
const View = Vue.extend(App)
|
||||||
new View().$mount('#webserver')
|
new View().$mount('#webtransfer')
|
||||||
|
@ -4,8 +4,8 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
use OCP\Util;
|
use OCP\Util;
|
||||||
|
|
||||||
Util::addScript(OCA\WebServer\AppInfo\Application::APP_ID, 'main');
|
Util::addScript(OCA\WebTransfer\AppInfo\Application::APP_ID, 'main');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div id="webserver"></div>
|
<div id="webtransfer"></div>
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
script('webserver', 'dragdrop');
|
|
||||||
style('webserver', 'style');
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
<div id="app-content">
|
|
||||||
<h3>Glisser-Déposer pour Ajouter dans Nextcloud</h3>
|
|
||||||
<div id="drop-zone">Déposez vos fichiers ici</div>
|
|
||||||
</div>
|
|
Loading…
x
Reference in New Issue
Block a user