Skip to content

Commit

Permalink
Migrate to vue 3
Browse files Browse the repository at this point in the history
  • Loading branch information
raimund-schluessler committed Jan 12, 2024
1 parent f9c59a5 commit 7862b0a
Show file tree
Hide file tree
Showing 28 changed files with 1,135 additions and 1,405 deletions.
17 changes: 1 addition & 16 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,7 @@ public function register(IRegistrationContext $context): void {
});

$context->registerMiddleware(ExceptionMiddleware::class);

/**
* Add worker-src blob to content security policy, so that
* https://github.com/gruhn/vue-qrcode-reader works correctly.
*/
if (class_exists('\\OCP\\AppFramework\\Http\\EmptyContentSecurityPolicy')) {
$manager = \OC::$server->getContentSecurityPolicyManager();

$policy = new \OCP\AppFramework\Http\EmptyContentSecurityPolicy();
$policy->addAllowedWorkerSrcDomain('blob:');
// This line is for Safari on iOS and Mac, which doesn't know 'worker-src' yet.
$policy->addAllowedChildSrcDomain('blob:');

$manager->addDefaultPolicy($policy);
}


$context->registerSearchProvider(Provider::class);
}

Expand Down
11 changes: 10 additions & 1 deletion lib/Controller/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
namespace OCA\Inventory\Controller;

use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\ContentSecurityPolicy;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IConfig;
use OCP\IInitialStateService;
Expand Down Expand Up @@ -62,6 +63,14 @@ public function index() {
'attachmentFolder', $attachmentFolder
);

return new TemplateResponse('inventory', 'main');
$response = new TemplateResponse('inventory', 'main');

$csp = new ContentSecurityPolicy();
$csp->allowEvalScript(true);
// Needed to get https://github.com/gruhn/vue-qrcode-reader to work.
// $csp->allowEvalWasm(true);
$response->setContentSecurityPolicy($csp);

return $response;
}
}
Loading

0 comments on commit 7862b0a

Please sign in to comment.