1
1
mirror of https://github.com/pterodactyl/panel.git synced 2024-11-22 09:02:28 +01:00

Replace debug bar with clockwork

This commit is contained in:
DaneEveritt 2022-05-04 19:19:00 -04:00
parent 4252014d18
commit f5ad9b9e11
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53
5 changed files with 74 additions and 402 deletions

View File

@ -43,11 +43,11 @@
"webmozart/assert": "~1.10.0" "webmozart/assert": "~1.10.0"
}, },
"require-dev": { "require-dev": {
"barryvdh/laravel-debugbar": "^3.6",
"barryvdh/laravel-ide-helper": "^2.12", "barryvdh/laravel-ide-helper": "^2.12",
"facade/ignition": "^2.17", "facade/ignition": "^2.17",
"fakerphp/faker": "^1.19", "fakerphp/faker": "^1.19",
"friendsofphp/php-cs-fixer": "^3.8", "friendsofphp/php-cs-fixer": "^3.8",
"itsgoingd/clockwork": "^5.1",
"laravel/dusk": "^6.23", "laravel/dusk": "^6.23",
"mockery/mockery": "^1.5", "mockery/mockery": "^1.5",
"nunomaduro/collision": "^5.11", "nunomaduro/collision": "^5.11",

289
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "257d04481ad578251164aa3124c2ee2f", "content-hash": "d51c727b5c04b52d1d56e2e64e8355b9",
"packages": [ "packages": [
{ {
"name": "aws/aws-crt-php", "name": "aws/aws-crt-php",
@ -7228,91 +7228,6 @@
} }
], ],
"packages-dev": [ "packages-dev": [
{
"name": "barryvdh/laravel-debugbar",
"version": "v3.6.7",
"source": {
"type": "git",
"url": "https://github.com/barryvdh/laravel-debugbar.git",
"reference": "b96f9820aaf1ff9afe945207883149e1c7afb298"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/b96f9820aaf1ff9afe945207883149e1c7afb298",
"reference": "b96f9820aaf1ff9afe945207883149e1c7afb298",
"shasum": ""
},
"require": {
"illuminate/routing": "^6|^7|^8|^9",
"illuminate/session": "^6|^7|^8|^9",
"illuminate/support": "^6|^7|^8|^9",
"maximebf/debugbar": "^1.17.2",
"php": ">=7.2",
"symfony/debug": "^4.3|^5|^6",
"symfony/finder": "^4.3|^5|^6"
},
"require-dev": {
"mockery/mockery": "^1.3.3",
"orchestra/testbench-dusk": "^4|^5|^6|^7",
"phpunit/phpunit": "^8.5|^9.0",
"squizlabs/php_codesniffer": "^3.5"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.6-dev"
},
"laravel": {
"providers": [
"Barryvdh\\Debugbar\\ServiceProvider"
],
"aliases": {
"Debugbar": "Barryvdh\\Debugbar\\Facades\\Debugbar"
}
}
},
"autoload": {
"files": [
"src/helpers.php"
],
"psr-4": {
"Barryvdh\\Debugbar\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Barry vd. Heuvel",
"email": "barryvdh@gmail.com"
}
],
"description": "PHP Debugbar integration for Laravel",
"keywords": [
"debug",
"debugbar",
"laravel",
"profiler",
"webprofiler"
],
"support": {
"issues": "https://github.com/barryvdh/laravel-debugbar/issues",
"source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.6.7"
},
"funding": [
{
"url": "https://fruitcake.nl",
"type": "custom"
},
{
"url": "https://github.com/barryvdh",
"type": "github"
}
],
"time": "2022-02-09T07:52:32+00:00"
},
{ {
"name": "barryvdh/laravel-ide-helper", "name": "barryvdh/laravel-ide-helper",
"version": "v2.12.3", "version": "v2.12.3",
@ -8293,6 +8208,74 @@
}, },
"time": "2020-07-09T08:09:16+00:00" "time": "2020-07-09T08:09:16+00:00"
}, },
{
"name": "itsgoingd/clockwork",
"version": "v5.1.6",
"source": {
"type": "git",
"url": "https://github.com/itsgoingd/clockwork.git",
"reference": "9df41432da1d8cb39c7fda383ddcc02231c83ff3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/itsgoingd/clockwork/zipball/9df41432da1d8cb39c7fda383ddcc02231c83ff3",
"reference": "9df41432da1d8cb39c7fda383ddcc02231c83ff3",
"shasum": ""
},
"require": {
"ext-json": "*",
"php": ">=5.6"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Clockwork\\Support\\Laravel\\ClockworkServiceProvider"
],
"aliases": {
"Clockwork": "Clockwork\\Support\\Laravel\\Facade"
}
}
},
"autoload": {
"psr-4": {
"Clockwork\\": "Clockwork/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "itsgoingd",
"email": "itsgoingd@luzer.sk",
"homepage": "https://twitter.com/itsgoingd"
}
],
"description": "php dev tools in your browser",
"homepage": "https://underground.works/clockwork",
"keywords": [
"Devtools",
"debugging",
"laravel",
"logging",
"lumen",
"profiling",
"slim"
],
"support": {
"issues": "https://github.com/itsgoingd/clockwork/issues",
"source": "https://github.com/itsgoingd/clockwork/tree/v5.1.6"
},
"funding": [
{
"url": "https://github.com/itsgoingd",
"type": "github"
}
],
"time": "2022-04-12T21:35:47+00:00"
},
{ {
"name": "laravel/dusk", "name": "laravel/dusk",
"version": "v6.23.1", "version": "v6.23.1",
@ -8366,72 +8349,6 @@
}, },
"time": "2022-05-02T14:01:47+00:00" "time": "2022-05-02T14:01:47+00:00"
}, },
{
"name": "maximebf/debugbar",
"version": "v1.18.0",
"source": {
"type": "git",
"url": "https://github.com/maximebf/php-debugbar.git",
"reference": "0d44b75f3b5d6d41ae83b79c7a4bceae7fbc78b6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/0d44b75f3b5d6d41ae83b79c7a4bceae7fbc78b6",
"reference": "0d44b75f3b5d6d41ae83b79c7a4bceae7fbc78b6",
"shasum": ""
},
"require": {
"php": "^7.1|^8",
"psr/log": "^1|^2|^3",
"symfony/var-dumper": "^2.6|^3|^4|^5|^6"
},
"require-dev": {
"phpunit/phpunit": "^7.5.20 || ^9.4.2",
"twig/twig": "^1.38|^2.7|^3.0"
},
"suggest": {
"kriswallsmith/assetic": "The best way to manage assets",
"monolog/monolog": "Log using Monolog",
"predis/predis": "Redis storage"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.17-dev"
}
},
"autoload": {
"psr-4": {
"DebugBar\\": "src/DebugBar/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Maxime Bouroumeau-Fuseau",
"email": "maxime.bouroumeau@gmail.com",
"homepage": "http://maximebf.com"
},
{
"name": "Barry vd. Heuvel",
"email": "barryvdh@gmail.com"
}
],
"description": "Debug bar in the browser for php application",
"homepage": "https://github.com/maximebf/php-debugbar",
"keywords": [
"debug",
"debugbar"
],
"support": {
"issues": "https://github.com/maximebf/php-debugbar/issues",
"source": "https://github.com/maximebf/php-debugbar/tree/v1.18.0"
},
"time": "2021-12-27T18:49:48+00:00"
},
{ {
"name": "mockery/mockery", "name": "mockery/mockery",
"version": "1.5.0", "version": "1.5.0",
@ -10680,74 +10597,6 @@
], ],
"time": "2020-09-28T06:39:44+00:00" "time": "2020-09-28T06:39:44+00:00"
}, },
{
"name": "symfony/debug",
"version": "v4.4.41",
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
"reference": "6637e62480b60817b9a6984154a533e8e64c6bd5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/debug/zipball/6637e62480b60817b9a6984154a533e8e64c6bd5",
"reference": "6637e62480b60817b9a6984154a533e8e64c6bd5",
"shasum": ""
},
"require": {
"php": ">=7.1.3",
"psr/log": "^1|^2|^3"
},
"conflict": {
"symfony/http-kernel": "<3.4"
},
"require-dev": {
"symfony/http-kernel": "^3.4|^4.0|^5.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Symfony\\Component\\Debug\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Provides tools to ease debugging PHP code",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/debug/tree/v4.4.41"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2022-04-12T15:19:55+00:00"
},
{ {
"name": "symfony/filesystem", "name": "symfony/filesystem",
"version": "v5.4.7", "version": "v5.4.7",

View File

@ -1,167 +0,0 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Debugbar Settings
|--------------------------------------------------------------------------
|
| Debugbar is enabled by default, when debug is set to true in app.php.
| You can override the value by setting enable to true or false instead of null.
|
*/
'enabled' => null,
/*
|--------------------------------------------------------------------------
| Storage settings
|--------------------------------------------------------------------------
|
| DebugBar stores data for session/ajax requests.
| You can disable this, so the debugbar stores data in headers/session,
| but this can cause problems with large data collectors.
| By default, file storage (in the storage folder) is used. Redis and PDO
| can also be used. For PDO, run the package migrations first.
|
*/
'storage' => [
'enabled' => true,
'driver' => env('DEBUGBAR_DRIVER', 'file'), // redis, file, pdo
'path' => storage_path() . '/debugbar', // For file driver
'connection' => null, // Leave null for default connection (Redis/PDO)
],
/*
|--------------------------------------------------------------------------
| Vendors
|--------------------------------------------------------------------------
|
| Vendor files are included by default, but can be set to false.
| This can also be set to 'js' or 'css', to only include javascript or css vendor files.
| Vendor files are for css: font-awesome (including fonts) and highlight.js (css files)
| and for js: jquery and and highlight.js
| So if you want syntax highlighting, set it to true.
| jQuery is set to not conflict with existing jQuery scripts.
|
*/
'include_vendors' => true,
/*
|--------------------------------------------------------------------------
| Capture Ajax Requests
|--------------------------------------------------------------------------
|
| The Debugbar can capture Ajax requests and display them. If you don't want this (ie. because of errors),
| you can use this option to disable sending the data through the headers.
|
*/
'capture_ajax' => true,
/*
|--------------------------------------------------------------------------
| Clockwork integration
|--------------------------------------------------------------------------
|
| The Debugbar can emulate the Clockwork headers, so you can use the Chrome
| Extension, without the server-side code. It uses Debugbar collectors instead.
|
*/
'clockwork' => false,
/*
|--------------------------------------------------------------------------
| DataCollectors
|--------------------------------------------------------------------------
|
| Enable/disable DataCollectors
|
*/
'collectors' => [
'phpinfo' => true, // Php version
'messages' => true, // Messages
'time' => true, // Time Datalogger
'memory' => true, // Memory usage
'exceptions' => true, // Exception displayer
'log' => true, // Logs from Monolog (merged in messages if enabled)
'db' => true, // Show database (PDO) queries and bindings
'views' => true, // Views with their data
'route' => true, // Current route information
'laravel' => false, // Laravel version and environment
'events' => true, // All events fired
'default_request' => false, // Regular or special Symfony request logger
'symfony_request' => true, // Only one can be enabled..
'mail' => true, // Catch mail messages
'logs' => false, // Add the latest log messages
'files' => false, // Show the included files
'config' => false, // Display config settings
'auth' => false, // Display Laravel authentication status
'gate' => false, // Display Laravel Gate checks
'session' => true, // Display session data
],
/*
|--------------------------------------------------------------------------
| Extra options
|--------------------------------------------------------------------------
|
| Configure some DataCollectors
|
*/
'options' => [
'auth' => [
'show_name' => false, // Also show the users name/email in the debugbar
],
'db' => [
'with_params' => true, // Render SQL with the parameters substituted
'timeline' => true, // Add the queries to the timeline
'backtrace' => true, // EXPERIMENTAL: Use a backtrace to find the origin of the query in your files.
'explain' => [ // EXPERIMENTAL: Show EXPLAIN output on queries
'enabled' => false,
'types' => ['SELECT', 'INSERT', 'UPDATE', 'DELETE'], // array('SELECT', 'INSERT', 'UPDATE', 'DELETE'); for MySQL 5.6.3+
],
'hints' => false, // Show hints for common mistakes
],
'mail' => [
'full_log' => false,
],
'views' => [
'data' => false, // Note: Can slow down the application, because the data can be quite large..
],
'route' => [
'label' => true, // show complete route on bar
],
'logs' => [
'file' => null,
],
],
/*
|--------------------------------------------------------------------------
| Inject Debugbar in Response
|--------------------------------------------------------------------------
|
| Usually, the debugbar is added just before <body>, by listening to the
| Response after the App is done. If you disable this, you have to add them
| in your template yourself. See http://phpdebugbar.com/docs/rendering.html
|
*/
'inject' => true,
/*
|--------------------------------------------------------------------------
| DebugBar route prefix
|--------------------------------------------------------------------------
|
| Sometimes you want to set route prefix to be used by DebugBar to load
| its resources from. Usually the need comes from misconfigured web server or
| from trying to overcome bugs like this: http://trac.nginx.org/nginx/ticket/97
|
*/
'route_prefix' => '_debugbar',
];

View File

@ -23,7 +23,7 @@ http.interceptors.request.use(req => {
}); });
http.interceptors.request.use(req => { http.interceptors.request.use(req => {
if (!req.url?.endsWith('/resources') && (req.url?.indexOf('_debugbar') || -1) < 0) { if (!req.url?.endsWith('/resources')) {
store.getActions().progress.startContinuous(); store.getActions().progress.startContinuous();
} }
@ -31,7 +31,7 @@ http.interceptors.request.use(req => {
}); });
http.interceptors.response.use(resp => { http.interceptors.response.use(resp => {
if (!resp.request?.url?.endsWith('/resources') && (resp.request?.url?.indexOf('_debugbar') || -1) < 0) { if (!resp.request?.url?.endsWith('/resources')) {
store.getActions().progress.setComplete(); store.getActions().progress.setComplete();
} }
@ -42,18 +42,6 @@ http.interceptors.response.use(resp => {
throw error; throw error;
}); });
// If we have a phpdebugbar instance registered at this point in time go
// ahead and route the response data through to it so things show up.
// @ts-ignore
if (typeof window.phpdebugbar !== 'undefined') {
http.interceptors.response.use(response => {
// @ts-ignore
window.phpdebugbar.ajaxHandler.handle(response.request);
return response;
});
}
export default http; export default http;
/** /**

2
storage/clockwork/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore