Add very basic cache busting

This commit is contained in:
Dane Everitt 2018-02-18 15:15:53 -06:00
parent 1eb76c4457
commit 0341dbdfad
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
11 changed files with 135 additions and 76 deletions

View file

@ -14,6 +14,9 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
### Changed
* Adjusted exception handler behavior to log more stack information for PDO exceptions while not exposing credentials.
### Added
* Very basic cache busting until asset management can be changed to make use of better systems.
## v0.7.0 (Derelict Dermodactylus)
### Fixed
* `[rc.2]` — Fixes bad API behavior on `/user` routes.

View file

@ -8,6 +8,7 @@ use Pterodactyl\Models\User;
use Pterodactyl\Models\Server;
use Pterodactyl\Models\Subuser;
use Illuminate\Support\Facades\Schema;
use Igaster\LaravelTheme\Facades\Theme;
use Illuminate\Support\ServiceProvider;
use Pterodactyl\Observers\UserObserver;
use Pterodactyl\Observers\ServerObserver;
@ -28,6 +29,7 @@ class AppServiceProvider extends ServiceProvider
View::share('appVersion', $this->versionData()['version'] ?? 'undefined');
View::share('appIsGit', $this->versionData()['is_git'] ?? false);
Theme::setSetting('cache-version', md5($this->versionData()['version'] ?? 'undefined'));
}
/**

View file

@ -22,7 +22,7 @@
"fideloper/proxy": "^3.3",
"guzzlehttp/guzzle": "^6.3",
"hashids/hashids": "^2.0",
"igaster/laravel-theme": "^1.16",
"igaster/laravel-theme": "^2.0.6",
"laracasts/utilities": "^3.0",
"laravel/framework": "5.5.*",
"laravel/tinker": "^1.0",

37
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "86cf8a899601833098c86cb505764e92",
"content-hash": "8c907d970c12c8d0722dbd21437dbfb6",
"packages": [
{
"name": "appstract/laravel-blade-directives",
@ -1113,36 +1113,43 @@
},
{
"name": "igaster/laravel-theme",
"version": "v1.16",
"version": "v2.0.6",
"source": {
"type": "git",
"url": "https://github.com/igaster/laravel-theme.git",
"reference": "7816c4497feb326d11447737e8477779a713fc96"
"reference": "d3835fd99418848ba130e3f7a73d3f78ab636471"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/igaster/laravel-theme/zipball/7816c4497feb326d11447737e8477779a713fc96",
"reference": "7816c4497feb326d11447737e8477779a713fc96",
"url": "https://api.github.com/repos/igaster/laravel-theme/zipball/d3835fd99418848ba130e3f7a73d3f78ab636471",
"reference": "d3835fd99418848ba130e3f7a73d3f78ab636471",
"shasum": ""
},
"require": {
"illuminate/support": ">=5.2.0",
"php": ">=5.4.0"
"illuminate/contracts": "5.4.*|5.5.*|5.6.*"
},
"require-dev": {
"illuminate/database": "~5.2",
"orchestra/testbench": "~3.0",
"phpunit/phpunit": "~4.0",
"vlucas/phpdotenv": "~2.0"
"orchestra/testbench": "~3.4",
"phpunit/phpunit": "^6.0"
},
"suggest": {
"orchestra/asset": "Use '@css' and '@js' in Blade files"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Igaster\\LaravelTheme\\themeServiceProvider"
],
"aliases": {
"Theme": "Igaster\\LaravelTheme\\Facades\\Theme"
}
}
},
"autoload": {
"psr-4": {
"igaster\\laravelTheme\\": "src/",
"igaster\\laravelTheme\\Tests\\": "tests/"
"Igaster\\LaravelTheme\\": "src/",
"Igaster\\LaravelTheme\\Tests\\": "tests/"
}
},
"notification-url": "https://packagist.org/downloads/",
@ -1156,7 +1163,7 @@
}
],
"description": "Laravel 5 Themes: Asset & Views folder per theme. Theme inheritance. Blade integration and more...",
"homepage": "https://github.com/igaster/laravel-theme",
"homepage": "https://github.com/Igaster/laravel-theme.git",
"keywords": [
"assets",
"blade",
@ -1165,7 +1172,7 @@
"themes",
"views"
],
"time": "2017-06-07T15:24:25+00:00"
"time": "2018-02-12T11:19:00+00:00"
},
{
"name": "jakub-onderka/php-console-color",

View file

@ -203,7 +203,7 @@ return [
/*
* Additional Dependencies
*/
igaster\laravelTheme\themeServiceProvider::class,
Igaster\LaravelTheme\themeServiceProvider::class,
Prologue\Alerts\AlertsServiceProvider::class,
Lord\Laroute\LarouteServiceProvider::class,
],
@ -253,7 +253,7 @@ return [
'Schema' => Illuminate\Support\Facades\Schema::class,
'Session' => Illuminate\Support\Facades\Session::class,
'Storage' => Illuminate\Support\Facades\Storage::class,
'Theme' => igaster\laravelTheme\Facades\Theme::class,
'Theme' => Igaster\LaravelTheme\Facades\Theme::class,
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,

View file

@ -2,10 +2,57 @@
return [
'enabled' => true,
'themes_path' => realpath(base_path('resources/themes')),
'asset_not_found' => 'LOG_ERROR',
'active' => env('APP_THEME', 'pterodactyl'),
/*
|--------------------------------------------------------------------------
| Root path where theme Views will be located.
| Can be outside default views path e.g.: resources/themes
| Leave it null if you will put your themes in the default views folder
| (as defined in config\views.php)
|--------------------------------------------------------------------------
*/
'themes_path' => realpath(base_path('resources/themes')),
/*
|--------------------------------------------------------------------------
| Set behavior if an asset is not found in a Theme hierarchy.
| Available options: THROW_EXCEPTION | LOG_ERROR | IGNORE
|--------------------------------------------------------------------------
*/
'asset_not_found' => 'LOG_ERROR',
/*
|--------------------------------------------------------------------------
| Do we want a theme activated by default? Can be set at runtime with:
| Theme::set('theme-name');
|--------------------------------------------------------------------------
*/
'default' => env('APP_THEME', 'pterodactyl'),
/*
|--------------------------------------------------------------------------
| Cache theme.json configuration files that are located in each theme's folder
| in order to avoid searching theme settings in the filesystem for each request
|--------------------------------------------------------------------------
*/
'cache' => true,
/*
|--------------------------------------------------------------------------
| Define available themes. Format:
|
| 'theme-name' => [
| 'extends' => 'theme-to-extend', // optional
| 'views-path' => 'path-to-views', // defaults to: resources/views/theme-name
| 'asset-path' => 'path-to-assets', // defaults to: public/theme-name
|
| // You can add your own custom keys
| // Use Theme::getSetting('key') & Theme::setSetting('key', 'value') to access them
| 'key' => 'value',
| ],
|
|--------------------------------------------------------------------------
*/
'themes' => [
'pterodactyl' => [
'extends' => null,

File diff suppressed because one or more lines are too long

View file

@ -24,13 +24,13 @@
@include('layouts.scripts')
@section('scripts')
{!! Theme::css('vendor/select2/select2.min.css') !!}
{!! Theme::css('vendor/bootstrap/bootstrap.min.css') !!}
{!! Theme::css('vendor/adminlte/admin.min.css') !!}
{!! Theme::css('vendor/adminlte/colors/skin-blue.min.css') !!}
{!! Theme::css('vendor/sweetalert/sweetalert.min.css') !!}
{!! Theme::css('vendor/animate/animate.min.css') !!}
{!! Theme::css('css/pterodactyl.css') !!}
{!! Theme::css('vendor/select2/select2.min.css?t={cache-version}') !!}
{!! Theme::css('vendor/bootstrap/bootstrap.min.css?t={cache-version}') !!}
{!! Theme::css('vendor/adminlte/admin.min.css?t={cache-version}') !!}
{!! Theme::css('vendor/adminlte/colors/skin-blue.min.css?t={cache-version}') !!}
{!! Theme::css('vendor/sweetalert/sweetalert.min.css?t={cache-version}') !!}
{!! Theme::css('vendor/animate/animate.min.css?t={cache-version}') !!}
{!! Theme::css('css/pterodactyl.css?t={cache-version}') !!}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">
@ -171,17 +171,17 @@
{!! Theme::js('js/keyboard.polyfill.js') !!}
<script>keyboardeventKeyPolyfill.polyfill();</script>
{!! Theme::js('js/laroute.js') !!}
{!! Theme::js('vendor/jquery/jquery.min.js') !!}
{!! Theme::js('vendor/sweetalert/sweetalert.min.js') !!}
{!! Theme::js('vendor/bootstrap/bootstrap.min.js') !!}
{!! Theme::js('vendor/slimscroll/jquery.slimscroll.min.js') !!}
{!! Theme::js('vendor/adminlte/app.min.js') !!}
{!! Theme::js('vendor/socketio/socket.io.v203.min.js') !!}
{!! Theme::js('vendor/bootstrap-notify/bootstrap-notify.min.js') !!}
{!! Theme::js('vendor/select2/select2.full.min.js') !!}
{!! Theme::js('js/admin/functions.js') !!}
{!! Theme::js('js/autocomplete.js') !!}
{!! Theme::js('js/laroute.js?t={cache-version}') !!}
{!! Theme::js('vendor/jquery/jquery.min.js?t={cache-version}') !!}
{!! Theme::js('vendor/sweetalert/sweetalert.min.js?t={cache-version}') !!}
{!! Theme::js('vendor/bootstrap/bootstrap.min.js?t={cache-version}') !!}
{!! Theme::js('vendor/slimscroll/jquery.slimscroll.min.js?t={cache-version}') !!}
{!! Theme::js('vendor/adminlte/app.min.js?t={cache-version}') !!}
{!! Theme::js('vendor/socketio/socket.io.v203.min.js?t={cache-version}') !!}
{!! Theme::js('vendor/bootstrap-notify/bootstrap-notify.min.js?t={cache-version}') !!}
{!! Theme::js('vendor/select2/select2.full.min.js?t={cache-version}') !!}
{!! Theme::js('js/admin/functions.js?t={cache-version}') !!}
{!! Theme::js('js/autocomplete.js?t={cache-version}') !!}
@if(Auth::user()->root_admin)
<script>

View file

@ -21,9 +21,9 @@
<meta name="theme-color" content="#367fa9">
@section('scripts')
{!! Theme::css('vendor/bootstrap/bootstrap.min.css') !!}
{!! Theme::css('vendor/adminlte/admin.min.css') !!}
{!! Theme::css('css/pterodactyl.css') !!}
{!! Theme::css('vendor/bootstrap/bootstrap.min.css?t={cache-version}') !!}
{!! Theme::css('vendor/adminlte/admin.min.css?t={cache-version}') !!}
{!! Theme::css('css/pterodactyl.css?t={cache-version}') !!}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">
@ -50,17 +50,17 @@
<strong><i class="fa fa-fw fa-clock-o"></i></strong> {{ round(microtime(true) - LARAVEL_START, 3) }}s
</div>
{!! Theme::js('vendor/jquery/jquery.min.js') !!}
{!! Theme::js('vendor/bootstrap/bootstrap.min.js') !!}
{!! Theme::js('js/autocomplete.js') !!}
{!! Theme::js('vendor/particlesjs/particles.min.js') !!}
{!! Theme::js('vendor/jquery/jquery.min.js?t={cache-version}') !!}
{!! Theme::js('vendor/bootstrap/bootstrap.min.js?t={cache-version}') !!}
{!! Theme::js('js/autocomplete.js?t={cache-version}') !!}
{!! Theme::js('vendor/particlesjs/particles.min.js?t={cache-version}') !!}
<script type="text/javascript">
/* particlesJS.load(@dom-id, @path-json, @callback (optional)); */
$(function () {
particlesJS.load('particles-js', '{!! Theme::url('vendor/particlesjs/particles.json') !!}', function() {});
particlesJS.load('particles-js', '{!! Theme::url('vendor/particlesjs/particles.json?t={cache-version}') !!}', function() {});
})
</script>
@if(config('pterodactyl.lang.in_context')) {!! Theme::js('vendor/phraseapp/phraseapp.js') !!} @endif
@if(config('pterodactyl.lang.in_context')) {!! Theme::js('vendor/phraseapp/phraseapp.js?t={cache-version}') !!} @endif
</body>
</html>

View file

@ -22,11 +22,11 @@
<meta name="theme-color" content="#367fa9">
@section('scripts')
{!! Theme::css('vendor/bootstrap/bootstrap.min.css') !!}
{!! Theme::css('vendor/adminlte/admin.min.css') !!}
{!! Theme::css('vendor/adminlte/colors/skin-blue.min.css') !!}
{!! Theme::css('vendor/sweetalert/sweetalert.min.css') !!}
{!! Theme::css('css/pterodactyl.css') !!}
{!! Theme::css('vendor/bootstrap/bootstrap.min.css?t={cache-version}') !!}
{!! Theme::css('vendor/adminlte/admin.min.css?t={cache-version}') !!}
{!! Theme::css('vendor/adminlte/colors/skin-blue.min.css?t={cache-version}') !!}
{!! Theme::css('vendor/sweetalert/sweetalert.min.css?t={cache-version}') !!}
{!! Theme::css('css/pterodactyl.css?t={cache-version}') !!}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">
@ -60,11 +60,11 @@
</footer>
</div>
@section('footer-scripts')
{!! Theme::js('js/laroute.js') !!}
{!! Theme::js('vendor/jquery/jquery.min.js') !!}
{!! Theme::js('vendor/bootstrap/bootstrap.min.js') !!}
{!! Theme::js('vendor/slimscroll/jquery.slimscroll.min.js') !!}
{!! Theme::js('vendor/adminlte/app.min.js') !!}
{!! Theme::js('js/laroute.js?t={cache-version}') !!}
{!! Theme::js('vendor/jquery/jquery.min.js?t={cache-version}') !!}
{!! Theme::js('vendor/bootstrap/bootstrap.min.js?t={cache-version}') !!}
{!! Theme::js('vendor/slimscroll/jquery.slimscroll.min.js?t={cache-version}') !!}
{!! Theme::js('vendor/adminlte/app.min.js?t={cache-version}') !!}
@show
</body>
</html>

View file

@ -24,12 +24,12 @@
@include('layouts.scripts')
@section('scripts')
{!! Theme::css('vendor/bootstrap/bootstrap.min.css') !!}
{!! Theme::css('vendor/adminlte/admin.min.css') !!}
{!! Theme::css('vendor/adminlte/colors/skin-blue.min.css') !!}
{!! Theme::css('vendor/sweetalert/sweetalert.min.css') !!}
{!! Theme::css('vendor/animate/animate.min.css') !!}
{!! Theme::css('css/pterodactyl.css') !!}
{!! Theme::css('vendor/bootstrap/bootstrap.min.css?t={cache-version}') !!}
{!! Theme::css('vendor/adminlte/admin.min.css?t={cache-version}') !!}
{!! Theme::css('vendor/adminlte/colors/skin-blue.min.css?t={cache-version}') !!}
{!! Theme::css('vendor/sweetalert/sweetalert.min.css?t={cache-version}') !!}
{!! Theme::css('vendor/animate/animate.min.css?t={cache-version}') !!}
{!! Theme::css('css/pterodactyl.css?t={cache-version}') !!}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">
@ -243,20 +243,20 @@
<div class="control-sidebar-bg"></div>
</div>
@section('footer-scripts')
{!! Theme::js('js/keyboard.polyfill.js') !!}
{!! Theme::js('js/keyboard.polyfill.js?t={cache-version}') !!}
<script>keyboardeventKeyPolyfill.polyfill();</script>
{!! Theme::js('js/laroute.js') !!}
{!! Theme::js('vendor/jquery/jquery.min.js') !!}
{!! Theme::js('vendor/sweetalert/sweetalert.min.js') !!}
{!! Theme::js('vendor/bootstrap/bootstrap.min.js') !!}
{!! Theme::js('vendor/slimscroll/jquery.slimscroll.min.js') !!}
{!! Theme::js('vendor/adminlte/app.min.js') !!}
{!! Theme::js('vendor/socketio/socket.io.v203.min.js') !!}
{!! Theme::js('vendor/bootstrap-notify/bootstrap-notify.min.js') !!}
{!! Theme::js('js/autocomplete.js') !!}
{!! Theme::js('js/laroute.js?t={cache-version}') !!}
{!! Theme::js('vendor/jquery/jquery.min.js?t={cache-version}') !!}
{!! Theme::js('vendor/sweetalert/sweetalert.min.js?t={cache-version}') !!}
{!! Theme::js('vendor/bootstrap/bootstrap.min.js?t={cache-version}') !!}
{!! Theme::js('vendor/slimscroll/jquery.slimscroll.min.js?t={cache-version}') !!}
{!! Theme::js('vendor/adminlte/app.min.js?t={cache-version}') !!}
{!! Theme::js('vendor/socketio/socket.io.v203.min.js?t={cache-version}') !!}
{!! Theme::js('vendor/bootstrap-notify/bootstrap-notify.min.js?t={cache-version}') !!}
{!! Theme::js('js/autocomplete.js?t={cache-version}') !!}
@if(config('pterodactyl.lang.in_context'))
{!! Theme::js('vendor/phraseapp/phraseapp.js') !!}
{!! Theme::js('vendor/phraseapp/phraseapp.js?t={cache-version}') !!}
@endif
@if(Auth::user()->root_admin)