From: Vincent Vanwaelscappel Date: Tue, 7 Sep 2021 18:26:36 +0000 (+0200) Subject: wip #4666 @2 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=9f99599d8395238f05e7147e326aa81321afdcec;p=odl.git wip #4666 @2 --- diff --git a/app/Http/Controllers/Admin/ToolsController.php b/app/Http/Controllers/Admin/ToolsController.php new file mode 100644 index 0000000..9aa6a68 --- /dev/null +++ b/app/Http/Controllers/Admin/ToolsController.php @@ -0,0 +1,26 @@ + $args]); + } + return $this->$tool($args); + } +} diff --git a/app/Http/Controllers/Tools/FluidbookConvert.php b/app/Http/Controllers/Tools/FluidbookConvert.php new file mode 100644 index 0000000..2ff33f0 --- /dev/null +++ b/app/Http/Controllers/Tools/FluidbookConvert.php @@ -0,0 +1,14 @@ +job instanceof SyncJob); + + start_measure('Process Fluidbook'); $this->resetOutput(); - $this->processPages(); + $this->processPages($sync); $this->getTexts(); $this->getLinks(); $this->writeConfig(); + stop_measure('Process Fluidbook'); } protected function resetOutput() { + start_measure("Reset Fluidbook Output"); $stub = resource_path('fluidbook/'); $cmd = "rm -rfv $this->out;cp -rv $stub $this->out"; `$cmd`; + stop_measure("Reset Fluidbook Output"); } - public function processPages() + public function processPages($sync = false) { + start_measure('Process Pages'); $out = storage_path('fluidbook/convert/' . $this->in->getHash()); $this->in->processPages($out, [ ['format' => 'jpg', 'resolution' => '36', 'withTexts' => true, 'withGraphics' => true], ['format' => 'jpg', 'resolution' => '150', 'withTexts' => false, 'withGraphics' => true], - ['format' => 'jpg', 'resolution' => '300', 'withTexts' => false, 'withGraphics' => true], + // ['format' => 'jpg', 'resolution' => '300', 'withTexts' => false, 'withGraphics' => true], ['format' => 'svg', 'resolution' => '300', 'withTexts' => true, 'withGraphics' => false], - ]); + ], $sync); + stop_measure('Process Pages'); + } public function getTexts() diff --git a/resources/views/tools/fluidbookconvert.blade.php b/resources/views/tools/fluidbookconvert.blade.php new file mode 100644 index 0000000..c62a2be --- /dev/null +++ b/resources/views/tools/fluidbookconvert.blade.php @@ -0,0 +1,4 @@ +@extends(backpack_view('blank')) + +@section('content') +@endsection diff --git a/routes/web.php b/routes/web.php index 9f058cd..1725466 100644 --- a/routes/web.php +++ b/routes/web.php @@ -7,5 +7,5 @@ Route::group([ 'middleware' => ['web', config('backpack.base.middleware_key', 'admin')], 'namespace' => '\App\Http\Controllers\Admin', ], function () { // custom admin routes - //Route::any('tools/{tool}/{args?}', 'ToolsController@index')->where(['args' => '.*']); + Route::any('tools/{tool}/{args?}', 'ToolsController@index')->where(['args' => '.*']); });