performance updates
This commit is contained in:
Executable → Regular
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||||
<head>
|
<head>
|
||||||
@include('partials.head')
|
@include('partials.head', ['loadModuleAssets' => false, 'loadLayoutAssets' => false])
|
||||||
</head>
|
</head>
|
||||||
<body class="min-h-screen bg-neutral-100 antialiased dark:bg-linear-to-b dark:from-neutral-950 dark:to-neutral-900">
|
<body class="min-h-screen bg-neutral-100 antialiased dark:bg-linear-to-b dark:from-neutral-950 dark:to-neutral-900">
|
||||||
<div class="bg-muted flex min-h-svh flex-col items-center justify-center gap-6 p-6 md:p-10">
|
<div class="bg-muted flex min-h-svh flex-col items-center justify-center gap-6 p-6 md:p-10">
|
||||||
|
|||||||
Executable → Regular
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||||
<head>
|
<head>
|
||||||
@include('partials.head')
|
@include('partials.head', ['loadModuleAssets' => false, 'loadLayoutAssets' => false])
|
||||||
</head>
|
</head>
|
||||||
<body class="hd-auth-surface min-h-screen bg-white antialiased dark:bg-linear-to-b dark:from-neutral-950 dark:to-neutral-900">
|
<body class="hd-auth-surface min-h-screen bg-white antialiased dark:bg-linear-to-b dark:from-neutral-950 dark:to-neutral-900">
|
||||||
<div class="bg-background flex min-h-svh flex-col items-center justify-center gap-6 p-6 md:p-10">
|
<div class="bg-background flex min-h-svh flex-col items-center justify-center gap-6 p-6 md:p-10">
|
||||||
|
|||||||
Executable → Regular
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||||
<head>
|
<head>
|
||||||
@include('partials.head')
|
@include('partials.head', ['loadModuleAssets' => false, 'loadLayoutAssets' => false])
|
||||||
</head>
|
</head>
|
||||||
<body class="min-h-screen bg-white antialiased dark:bg-linear-to-b dark:from-neutral-950 dark:to-neutral-900">
|
<body class="min-h-screen bg-white antialiased dark:bg-linear-to-b dark:from-neutral-950 dark:to-neutral-900">
|
||||||
<div class="relative grid h-dvh flex-col items-center justify-center px-8 sm:px-0 lg:max-w-none lg:grid-cols-2 lg:px-0">
|
<div class="relative grid h-dvh flex-col items-center justify-center px-8 sm:px-0 lg:max-w-none lg:grid-cols-2 lg:px-0">
|
||||||
|
|||||||
Executable → Regular
+26
-18
@@ -11,35 +11,43 @@
|
|||||||
<title>{{ filled($title ?? null) ? $title.' - '.config('app.name', 'Laravel') : config('app.name', 'Laravel') }}</title>
|
<title>{{ filled($title ?? null) ? $title.' - '.config('app.name', 'Laravel') : config('app.name', 'Laravel') }}</title>
|
||||||
@fonts
|
@fonts
|
||||||
@php
|
@php
|
||||||
|
// Guest/authentication pages only need the shared theme stylesheet. Loading
|
||||||
|
// every enabled module here made /login download each module's CSS/JS even
|
||||||
|
// though none of those assets are used on the authentication screen.
|
||||||
|
$loadModuleAssets = $loadModuleAssets ?? auth()->check();
|
||||||
|
$loadLayoutAssets = $loadLayoutAssets ?? auth()->check();
|
||||||
|
|
||||||
$backendCssEntry = is_file(resource_path('themes/backend/assets/css/app.css'))
|
$backendCssEntry = is_file(resource_path('themes/backend/assets/css/app.css'))
|
||||||
? 'resources/themes/backend/assets/css/app.css'
|
? 'resources/themes/backend/assets/css/app.css'
|
||||||
: 'resources/themes/backend/assets/css/helpdesk.css';
|
: 'resources/themes/backend/assets/css/helpdesk.css';
|
||||||
|
|
||||||
$viteAssets = [
|
$viteAssets = [$backendCssEntry];
|
||||||
$backendCssEntry,
|
|
||||||
'resources/themes/backend/assets/js/passkeys.js',
|
|
||||||
'resources/themes/backend/assets/js/layout.js',
|
|
||||||
];
|
|
||||||
|
|
||||||
$moduleStatuses = [];
|
if ($loadLayoutAssets) {
|
||||||
$moduleStatusFile = base_path('modules_statuses.json');
|
$viteAssets[] = 'resources/themes/backend/assets/js/layout.js';
|
||||||
|
|
||||||
if (is_file($moduleStatusFile)) {
|
|
||||||
$moduleStatuses = json_decode((string) file_get_contents($moduleStatusFile), true) ?: [];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (glob(base_path('Modules/*'), GLOB_ONLYDIR) ?: [] as $moduleDirectory) {
|
if ($loadModuleAssets) {
|
||||||
$moduleName = basename($moduleDirectory);
|
$moduleStatuses = [];
|
||||||
|
$moduleStatusFile = base_path('modules_statuses.json');
|
||||||
|
|
||||||
if (array_key_exists($moduleName, $moduleStatuses) && ! $moduleStatuses[$moduleName]) {
|
if (is_file($moduleStatusFile)) {
|
||||||
continue;
|
$moduleStatuses = json_decode((string) file_get_contents($moduleStatusFile), true) ?: [];
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (['Resources/assets/css/app.css', 'Resources/assets/js/app.js'] as $entry) {
|
foreach (glob(base_path('Modules/*'), GLOB_ONLYDIR) ?: [] as $moduleDirectory) {
|
||||||
$absoluteEntry = $moduleDirectory.DIRECTORY_SEPARATOR.str_replace('/', DIRECTORY_SEPARATOR, $entry);
|
$moduleName = basename($moduleDirectory);
|
||||||
|
|
||||||
if (is_file($absoluteEntry)) {
|
if (array_key_exists($moduleName, $moduleStatuses) && ! $moduleStatuses[$moduleName]) {
|
||||||
$viteAssets[] = str_replace('\\', '/', substr($absoluteEntry, strlen(base_path()) + 1));
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (['Resources/assets/css/app.css', 'Resources/assets/js/app.js'] as $entry) {
|
||||||
|
$absoluteEntry = $moduleDirectory.DIRECTORY_SEPARATOR.str_replace('/', DIRECTORY_SEPARATOR, $entry);
|
||||||
|
|
||||||
|
if (is_file($absoluteEntry)) {
|
||||||
|
$viteAssets[] = str_replace('\\', '/', substr($absoluteEntry, strlen(base_path()) + 1));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user