diff --git a/Modules/M3/Resources/public/liberty-theme/css/styles.css b/Modules/M3/Resources/public/liberty-theme/css/styles.css index f3dc164c..3b469c3e 100644 --- a/Modules/M3/Resources/public/liberty-theme/css/styles.css +++ b/Modules/M3/Resources/public/liberty-theme/css/styles.css @@ -52,7 +52,7 @@ --bs-white-rgb: 255, 255, 255; --bs-black-rgb: 0, 0, 0; --bs-body-rgb: 33, 37, 41; - --bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; + --bs-font-sans-serif: "Instrument Sans", ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; --bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; --bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0)); --bs-body-font-family: var(--bs-font-sans-serif); @@ -11794,7 +11794,7 @@ a:link { } .highcharts-data-table table { - font-family: Verdana, sans-serif; + font-family: var(--bs-font-sans-serif); border-collapse: collapse; border: 1px solid #EBEBEB; margin: 10px auto; @@ -11820,3 +11820,9 @@ a:link { .highcharts-data-table tr:hover { background: #f1f7ff; } + + +/* Core typography integration: keep Liberty layout but use WMS/Core typography. */ +html, body, button, input, select, textarea, .navbar, .nav, .dropdown-menu, .table { + font-family: "Instrument Sans", ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; +} diff --git a/Modules/M3/Resources/views/liberty-theme/layout/main.blade.php b/Modules/M3/Resources/views/liberty-theme/layout/main.blade.php index 7f0db1ce..7d92798c 100644 --- a/Modules/M3/Resources/views/liberty-theme/layout/main.blade.php +++ b/Modules/M3/Resources/views/liberty-theme/layout/main.blade.php @@ -67,7 +67,21 @@ - @yield('title') + @yield('title') - {{ config('app.name', 'WMS') }} + + {{-- Use Core's favicon set so M3 keeps the same browser identity as WMS. --}} + + + + + + + + + + + {{-- Load the same locally managed font family used by Core. --}} + @fonts @include('m3::liberty-theme.partials.styles') diff --git a/Modules/M3/Resources/views/liberty-theme/partials/scripts.blade.php b/Modules/M3/Resources/views/liberty-theme/partials/scripts.blade.php index 4ce96e57..a02b93fc 100644 --- a/Modules/M3/Resources/views/liberty-theme/partials/scripts.blade.php +++ b/Modules/M3/Resources/views/liberty-theme/partials/scripts.blade.php @@ -1,5 +1,5 @@ - + @@ -15,12 +15,12 @@ @endphp @if($controller != 'ReplenishSettingsController' && $controller != 'M3ErrorsDispController') - + @endif - - + + @@ -28,17 +28,17 @@ - + {{-- Data Bootstrap Responsive --}} - + - - + + diff --git a/Modules/M3/Resources/views/liberty-theme/partials/styles.blade.php b/Modules/M3/Resources/views/liberty-theme/partials/styles.blade.php index e1ba095b..28476112 100644 --- a/Modules/M3/Resources/views/liberty-theme/partials/styles.blade.php +++ b/Modules/M3/Resources/views/liberty-theme/partials/styles.blade.php @@ -1,6 +1,6 @@ - - + + diff --git a/Modules/M3/Routes/web.php b/Modules/M3/Routes/web.php index f601e457..644c0c99 100644 --- a/Modules/M3/Routes/web.php +++ b/Modules/M3/Routes/web.php @@ -39,11 +39,34 @@ use Modules\M3\Http\Controllers\WhsPerfMetrics; Route::get('/assets/{path}', function (string $path) { - abort_if(str_contains($path, '..'), 404); - $file = module_path('M3', 'Resources/public/' . $path); - abort_unless(is_file($file), 404); - return response()->file($file); -})->where('path', '.*')->name('assets'); + abort_if(str_contains($path, '..') || str_contains($path, "\0"), 404); + + $root = realpath(module_path('M3', 'Resources/public')); + $file = realpath(module_path('M3', 'Resources/public/' . ltrim($path, '/'))); + + abort_unless($root && $file && str_starts_with($file, $root . DIRECTORY_SEPARATOR) && is_file($file), 404); + + $extension = strtolower(pathinfo($file, PATHINFO_EXTENSION)); + $contentTypes = [ + 'css' => 'text/css; charset=UTF-8', + 'js' => 'application/javascript; charset=UTF-8', + 'svg' => 'image/svg+xml', + 'png' => 'image/png', + 'jpg' => 'image/jpeg', + 'jpeg' => 'image/jpeg', + 'gif' => 'image/gif', + 'ico' => 'image/x-icon', + 'woff' => 'font/woff', + 'woff2' => 'font/woff2', + 'ttf' => 'font/ttf', + ]; + + return response(file_get_contents($file), 200, [ + 'Content-Type' => $contentTypes[$extension] ?? 'application/octet-stream', + 'Cache-Control' => app()->environment('local') ? 'no-cache, no-store, must-revalidate' : 'public, max-age=86400', + 'X-Content-Type-Options' => 'nosniff', + ]); +})->where('path', '.+')->name('assets'); Route::get('/health', fn () => response()->json(['module' => 'M3', 'status' => 'ok', 'database' => config('m3.connection', 'pgsql')]))->name('health'); diff --git a/resources/views/layouts/app/sidebar.blade.php b/resources/views/layouts/app/sidebar.blade.php index 6436db0c..77724be2 100644 --- a/resources/views/layouts/app/sidebar.blade.php +++ b/resources/views/layouts/app/sidebar.blade.php @@ -241,12 +241,12 @@
- @if (Route::has('m3-integration.index')) - - - {{ __('M3 Integration') }} + @if (Route::has('m3.index')) + + + {{ __('M3') }} @endif