Spostamento in URL legacy per versione retro-compatibile

This commit is contained in:
Dasc3er 2021-03-22 20:45:14 +01:00
parent 1eef5b47b9
commit 20e127c854
13 changed files with 31 additions and 27 deletions

View File

@ -11,9 +11,9 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
class LegacyController extends Controller
{
public function index(Request $request)
public function index(Request $request, $path)
{
$path = substr($request->getPathInfo(), 1);
//$path = substr($request->getPathInfo(), 1);
// Gestione dell'output
$output = self::simulate($path);
@ -27,7 +27,9 @@ class LegacyController extends Controller
}
// Correzione header per API
elseif (self::isApiRequest($path)) {
$response = $response->header('Content-Type', 'application/json');
$output = json_decode($output, true);
$response = $response->header('Content-Type', 'application/json')
->setStatusCode($output['status']);
}
return $response;

View File

@ -56,7 +56,7 @@ return [
'PROVIDER_NAMESPACE',
],
],
'gitkeep' => true,
'gitkeep' => false,
],
'paths' => [
/*
@ -209,10 +209,10 @@ return [
*/
'composer' => [
'vendor' => 'nwidart',
'vendor' => 'devcode-it',
'author' => [
'name' => 'Nicolas Widart',
'email' => 'n.widart@gmail.com',
'name' => 'DevCode s.r.l.',
'email' => 'infot@devcode.it',
],
],

2
legacy

@ -1 +1 @@
Subproject commit 767e211f4c616315618e222b6d55338f92d247a5
Subproject commit 9a3a78520b0a3be853c2c47908e060f7d608983f

View File

@ -7,7 +7,7 @@
<div class="login-box box-center-large">
<div class="login-logo">
<a href="//openstamanager.com" target="_blank">
<img src="{{ base_url() }}/assets/img/full_logo.png" style="max-width: 360px">
<img src="{{ url('/') }}/assets/img/full_logo.png" style="max-width: 360px">
</a>
</div>

View File

@ -7,7 +7,7 @@
<div class="login-box">
<div class="login-logo">
<a href="//openstamanager.com" target="_blank">
<img src="{{ base_url() }}/assets/img/full_logo.png" style="max-width: 360px">
<img src="{{ url('/') }}/assets/img/full_logo.png" style="max-width: 360px">
</a>
</div>

View File

@ -7,7 +7,7 @@
<div class="login-box box-center-large">
<div class="login-logo">
<a href="//openstamanager.com" target="_blank">
<img src="{{ base_url() }}/assets/img/full_logo.png" style="max-width: 360px">
<img src="{{ url('/') }}/assets/img/full_logo.png" style="max-width: 360px">
</a>
</div>

View File

@ -8,7 +8,7 @@
'class' => $class,
'data-parsley-errors-container' => '#'.$unique_id.'-errors'
]) }}>{{ $value }}</textarea>
<script src="{{ base_url() }}/assets/js/ckeditor/ckeditor.js"></script>
<script src="{{ url('/') }}/assets/js/ckeditor/ckeditor.js"></script>
<x-slot name="before">{{ isset($before) ? $before : null }}</x-slot>
<x-slot name="after">{{ isset($after) ? $after : null }}</x-slot>

View File

@ -37,7 +37,7 @@
@if($attributes->has('strength-trigger'))
<div id="{{ $id }}_viewport_progress"></div>
<script src="{{ base_url() }}/assets/dist/password-strength/password.min.js"></script>
<script src="{{ url('/') }}/assets/dist/password-strength/password.min.js"></script>
<script>
$(document).ready(function(){
$("#{{ $id }}").pwstrength({

View File

@ -1,6 +1,6 @@
<a class="clickable" {!! $attrs !!}>
<div class="info-box">
<button type="button" class="close" onclick="if(confirm('Disabilitare questo widget?')) { $.post('{{ base_url() }}/actions.php?id_module={{ $widget->module->id }}', { op: 'disable_widget', id: '{{ $widget->id }}' }, function(response){ location.reload(); }); }" >
<button type="button" class="close" onclick="if(confirm('Disabilitare questo widget?')) { $.post('{{ url('/') }}/actions.php?id_module={{ $widget->module->id }}', { op: 'disable_widget', id: '{{ $widget->id }}' }, function(response){ location.reload(); }); }" >
<span aria-hidden="true">&times;</span><span class="sr-only">{{ tr('Chiudi') }}</span>
</button>

View File

@ -9,7 +9,7 @@
@csrf
<div class="py-5 text-center">
<img class="d-block mx-auto mb-4" src="{{ base_url() }}/assets/img/full_logo.png" alt="{{ tr('Logo OpenSTAManager') }}">
<img class="d-block mx-auto mb-4" src="{{ url('/') }}/assets/img/full_logo.png" alt="{{ tr('Logo OpenSTAManager') }}">
<h2>{!! tr('Benvenuto in _NAME_!', ['_NAME_' => '<strong>'.tr('OpenSTAManager').'</strong>']) !!}</h2>
<p class="lead">{!! tr('Puoi procedere alla configurazione tecnica del software attraverso i parametri seguenti, che potranno essere corretti secondo necessità tramite il file _FILE_', ['_FILE_' => '<i>.env</i>']) !!}. </p>

View File

@ -6,7 +6,7 @@
@section('body')
<div class="container pb-5">
<div class="py-5 text-center">
<img class="d-block mx-auto mb-4" src="{{ base_url() }}/assets/img/full_logo.png" alt="{{ tr('Logo OpenSTAManager') }}">
<img class="d-block mx-auto mb-4" src="{{ url('/') }}/assets/img/full_logo.png" alt="{{ tr('Logo OpenSTAManager') }}">
<h2>{!! tr('Inizializzazione di _NAME_!', ['_NAME_' => '<strong>'.tr('OpenSTAManager').'</strong>']) !!}</h2>
<p class="lead">{{ tr("Completa la configurazione del gestionale inserendo le ultime informazioni di base") }}. </p>
</div>

View File

@ -10,19 +10,19 @@
<meta name="csrf-token" content="{{ csrf_token() }}">
<link href="{{ base_url() }}/assets/img/favicon.png" rel="icon" type="image/x-icon" />
<link rel="manifest" href="{{ base_url() }}/manifest.json">
<link href="{{ url('/') }}/assets/img/favicon.png" rel="icon" type="image/x-icon" />
<link rel="manifest" href="{{ url('/') }}/manifest.json">
<!--link rel="stylesheet" type="text/css" media="all" href="{{ base_url() }}{{ asset('/css/app.css') }}"/>
<link rel="stylesheet" type="text/css" media="all" href="{{ base_url() }}{{ asset('/css/style.css') }}"/>
<link rel="stylesheet" type="text/css" media="all" href="{{ base_url() }}{{ asset('/css/themes.css') }}"/>
<!--link rel="stylesheet" type="text/css" media="all" href="{{ asset('/css/app.css') }}"/>
<link rel="stylesheet" type="text/css" media="all" href="{{ asset('/css/style.css') }}"/>
<link rel="stylesheet" type="text/css" media="all" href="{{ asset('/css/themes.css') }}"/>
<link rel="stylesheet" type="text/css" media="print" href="{{ base_url() }}{{ asset('/css/print.css') }}"/>
<link rel="stylesheet" type="text/css" media="print" href="{{ asset('/css/print.css') }}"/>
<script type="text/javascript" charset="utf-8" src="{{ base_url() }}{{ asset('/js/manifest.js') }}"></script>
<script type="text/javascript" charset="utf-8" src="{{ base_url() }}{{ asset('/js/vendor.js') }}"></script>
<script type="text/javascript" charset="utf-8" src="{{ base_url() }}{{ asset('/js/app.js') }}"></script>
<script type="text/javascript" charset="utf-8" src="{{ base_url() }}{{ asset('/js/base.js') }}"></script--->
<script type="text/javascript" charset="utf-8" src="{{ asset('/js/manifest.js') }}"></script>
<script type="text/javascript" charset="utf-8" src="{{ asset('/js/vendor.js') }}"></script>
<script type="text/javascript" charset="utf-8" src="{{ asset('/js/app.js') }}"></script>
<script type="text/javascript" charset="utf-8" src="{{ asset('/js/base.js') }}"></script--->
@foreach (AppLegacy::getAssets()['css'] as $css)
<link rel="stylesheet" type="text/css" media="all" href="{{ $css }}"/>

View File

@ -4,4 +4,6 @@ use App\Http\Controllers\LegacyController;
use Illuminate\Support\Facades\Route;
// Route di fallback generale
Route::fallback([LegacyController::class, 'index']);
Route::any('/legacy/{path}', [LegacyController::class, 'index'])
->name('legacy')
->where('path', '.*');