Refactor PVC models and update tests
- Updated the PVC models in the database and adjusted the tests accordingly to reflect the new model counts and codes. - Removed deprecated models from the JSON data for PVC systems. - Added new GLB models for "scorrevole_sf_3_ante" and "scorrevole_sf_4_ante". - Enhanced the development scripts to streamline the build process for both frontends. - Updated documentation to reflect changes in the development environment and deployment process. - Improved the styling of texture radio options for better visibility. - Fixed URL handling in the configurator to ensure proper routing and API calls.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
use App\Models\Preventivo;
|
||||
use App\Support\PreventivoPdf;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
@@ -20,3 +21,21 @@ Route::get('/admin/preventivi/{preventivo}/pdf', function (Preventivo $preventiv
|
||||
'preventivo-'.($preventivo->numero ?? $preventivo->id).'.pdf'
|
||||
);
|
||||
})->middleware(['auth'])->name('preventivi.pdf.show');
|
||||
|
||||
// Configuratore 3D e app cliente (preventivo) sono build Vite statiche dentro public/ (vedi build.sh):
|
||||
// i file (js, css, assets) li serve direttamente il web server, qui gestiamo solo l'index.
|
||||
// Lo slash finale è obbligatorio perché i path runtime sono relativi (./assets/...).
|
||||
foreach (['configuratore', 'preventivo'] as $frontend) {
|
||||
Route::get($frontend, function (Request $request) use ($frontend) {
|
||||
if (! str_ends_with($request->getPathInfo(), '/')) {
|
||||
$query = $request->getQueryString();
|
||||
|
||||
return redirect('/'.$frontend.'/'.($query ? '?'.$query : ''), 301);
|
||||
}
|
||||
|
||||
$index = public_path($frontend.'/index.html');
|
||||
abort_unless(is_file($index), 404, "Build di {$frontend} assente: eseguire build.sh.");
|
||||
|
||||
return response()->file($index, ['Cache-Control' => 'no-cache']);
|
||||
})->name($frontend);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user