update pulse

This commit is contained in:
2024-01-26 00:24:09 +05:00
parent aaf28aadff
commit 7eec5cce74
11 changed files with 315 additions and 1 deletions

View File

@@ -6,7 +6,9 @@
"license": "MIT", "license": "MIT",
"require": { "require": {
"php": "^8.1", "php": "^8.1",
"denniseilander/pulse-about-application": "^0.1.1",
"eolica/nova-locale-switcher": "dev-support-nova-4", "eolica/nova-locale-switcher": "dev-support-nova-4",
"geowrgetudor/disk-metrics": "^1.2",
"guzzlehttp/guzzle": "^7.2", "guzzlehttp/guzzle": "^7.2",
"konsulting/nova-target": "^1.0", "konsulting/nova-target": "^1.0",
"laravel/framework": "^10.10", "laravel/framework": "^10.10",

135
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": "432db39f5c2293c6cc4d8599ccdeff9b", "content-hash": "9f216ae907952d6c2ee506c0abbc712c",
"packages": [ "packages": [
{ {
"name": "brick/math", "name": "brick/math",
@@ -119,6 +119,71 @@
], ],
"time": "2023-09-23T21:17:11+00:00" "time": "2023-09-23T21:17:11+00:00"
}, },
{
"name": "denniseilander/pulse-about-application",
"version": "0.1.1",
"source": {
"type": "git",
"url": "https://github.com/denniseilander/pulse-about-application.git",
"reference": "e7ebbef460952a709afca7a0258b310b9b6e8b0b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/denniseilander/pulse-about-application/zipball/e7ebbef460952a709afca7a0258b310b9b6e8b0b",
"reference": "e7ebbef460952a709afca7a0258b310b9b6e8b0b",
"shasum": ""
},
"require": {
"illuminate/contracts": "^10.0",
"laravel/pulse": "^1.0@beta",
"php": "^8.1",
"spatie/laravel-package-tools": "^1.14.0"
},
"require-dev": {
"laravel/pint": "^1.0",
"nunomaduro/collision": "^7.8",
"orchestra/testbench": "^8.8",
"pestphp/pest": "^2.20",
"pestphp/pest-plugin-arch": "^2.0",
"pestphp/pest-plugin-laravel": "^2.0"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Denniseilander\\AboutApplication\\AboutApplicationServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Denniseilander\\AboutApplication\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Dennis Eilander",
"email": "eilander.dennis@gmail.com",
"role": "Developer"
}
],
"description": "A Laravel Pulse card that displays application information by leveraging the output of the php artisan about command.",
"homepage": "https://github.com/denniseilander/pulse-about-application",
"keywords": [
"Dennis Eilander",
"laravel",
"pulse-about-application"
],
"support": {
"issues": "https://github.com/denniseilander/pulse-about-application/issues",
"source": "https://github.com/denniseilander/pulse-about-application/tree/0.1.1"
},
"time": "2023-12-04T20:42:08+00:00"
},
{ {
"name": "dflydev/dot-access-data", "name": "dflydev/dot-access-data",
"version": "v3.0.2", "version": "v3.0.2",
@@ -1014,6 +1079,74 @@
], ],
"time": "2023-10-12T05:21:21+00:00" "time": "2023-10-12T05:21:21+00:00"
}, },
{
"name": "geowrgetudor/disk-metrics",
"version": "1.2",
"source": {
"type": "git",
"url": "https://github.com/geowrgetudor/disk-metrics.git",
"reference": "a6323b0ceae580c95b91b9181449678bc92afd04"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/geowrgetudor/disk-metrics/zipball/a6323b0ceae580c95b91b9181449678bc92afd04",
"reference": "a6323b0ceae580c95b91b9181449678bc92afd04",
"shasum": ""
},
"require": {
"illuminate/contracts": "^10.0",
"laravel/pulse": "^1.0@beta",
"php": "^8.1",
"spatie/laravel-package-tools": "^1.14.0"
},
"require-dev": {
"laravel/pint": "^1.0",
"nunomaduro/collision": "^7.8",
"orchestra/testbench": "^8.8",
"pestphp/pest": "^2.20",
"pestphp/pest-plugin-arch": "^2.0",
"pestphp/pest-plugin-laravel": "^2.0"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Geow\\DiskMetrics\\DiskMetricsServiceProvider"
],
"aliases": {
"DiskMetrics": "Geow\\DiskMetrics\\Facades\\DiskMetrics"
}
}
},
"autoload": {
"psr-4": {
"Geow\\DiskMetrics\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "George Tudor",
"email": "georgebitq@gmail.com",
"role": "Developer"
}
],
"description": "Monitor disk size, file & directory count for Laravel Pulse",
"homepage": "https://github.com/geowrgetudor/disk-metrics",
"keywords": [
"disk-metrics",
"laravel",
"pulse"
],
"support": {
"issues": "https://github.com/geowrgetudor/disk-metrics/issues",
"source": "https://github.com/geowrgetudor/disk-metrics/tree/1.2"
},
"time": "2023-12-06T10:46:42+00:00"
},
{ {
"name": "graham-campbell/result-type", "name": "graham-campbell/result-type",
"version": "v1.1.2", "version": "v1.1.2",

24
config/disk-metrics.php Normal file
View File

@@ -0,0 +1,24 @@
<?php
return [
/**
* Track disks defined in filesystems.php config file.
* Support only 'local' or 's3' driver.
*
* You can pass an array ['directories', 'files'] ONLY to a local disk
* which will determine what to be counted. To count both,
* you can pass an empty array.
*/
'disks' => [
'local' => [],
// 'public' => [],
// 's3' => []
],
/**
* How often (in minutes) should the Laravel Pulse capture data?
* The value should be greated than 1!
* Default: 10
*/
'record_interval' => 1
];

View File

@@ -0,0 +1,17 @@
<?php
declare(strict_types=1);
return [
/**
* Hide sections from the about command.
*
* Possible values are: "environment", "cache", "drivers", "livewire
*/
'hide' => [
// 'environment',
// 'cache',
// 'drivers',
// 'livewire',
],
];

View File

@@ -223,5 +223,9 @@ return [
'#^/pulse$#', // Pulse dashboard... '#^/pulse$#', // Pulse dashboard...
], ],
], ],
\Geow\DiskMetrics\Recorders\DiskRecorder::class => [
'enabled' => env('GEOW_DISK_METRICS', true),
]
], ],
]; ];

View File

View File

@@ -0,0 +1,65 @@
<x-pulse::card :cols="$cols" :rows="$rows" :class="$class">
<x-pulse::card-header name="{{ __('Disk Metrics') }}">
<x-slot:icon>
<x-dynamic-component :component="'pulse::icons.sparkles'" />
</x-slot:icon>
</x-pulse::card-header>
<x-pulse::scroll :expand="$expand" wire:poll.5s="">
@if (empty($data))
<x-pulse::no-results />
@else
<x-pulse::table>
<colgroup>
<col width="100%" />
<col width="0%" />
<col width="0%" />
</colgroup>
<x-pulse::thead>
<tr>
<x-pulse::th>{{ __('Disk') }}</x-pulse::th>
<x-pulse::th class="text-right">{{ __('Directories') }}</x-pulse::th>
<x-pulse::th class="text-right">{{ __('Files') }}</x-pulse::th>
<x-pulse::th class="text-right">{{ __('Size') }}</x-pulse::th>
</tr>
</x-pulse::thead>
<tbody>
@foreach ($data as $diskName => $details)
<tr class="h-2 first:h-0"></tr>
<tr wire:key="{{ $diskName }}">
<x-pulse::td class="max-w-[1px]">
<code class="block text-xs text-gray-900 dark:text-gray-100 truncate"
title="{{ $diskName }}">
{{ ucfirst($diskName) }}
</code>
<p class="mt-1 text-xs text-gray-500 dark:text-gray-400 truncate" title="">
@if ($details['disk_data']['root'])
{{ $details['disk_data']['root'] }}
@endif
@if ($details['disk_data']['bucket'])
{{ $details['disk_data']['bucket'] }}
@endif
</p>
</x-pulse::td>
<x-pulse::td numeric class="text-gray-700 dark:text-gray-300 font-bold">
@if (isset($details['metrics']['directory_count']))
{{ $details['metrics']['directory_count']->value }}
@endif
</x-pulse::td>
<x-pulse::td numeric class="text-gray-700 dark:text-gray-300 font-bold">
@if (isset($details['metrics']['file_count']))
{{ $details['metrics']['file_count']->value }}
@endif
</x-pulse::td>
<x-pulse::td numeric class="text-gray-700 dark:text-gray-300 font-bold">
@if (isset($details['metrics']['total_size']))
{{ $details['metrics']['total_size']->value }}
@endif
</x-pulse::td>
</tr>
@endforeach
</tbody>
</x-pulse::table>
@endif
</x-pulse::scroll>
</x-pulse::card>

View File

@@ -0,0 +1,43 @@
<x-pulse::card :cols="$cols" :rows="$rows" :class="$class">
<x-pulse::card-header
name="Application information"
title="About the application"
details="Information about the application."
>
<x-slot:icon>
<x-pulse-about-application::icons.laravel />
</x-slot:icon>
</x-pulse::card-header>
<x-pulse::scroll :expand="$expand" wire:poll.5s="">
<div class="min-h-full flex flex-col bg-red-500">
@foreach ($information as $category => $items)
<x-pulse::table class="h-6 mt-2">
<colgroup>
<col width="80%" />
<col width="20%" />
</colgroup>
<x-pulse::thead>
<tr>
<x-pulse::th>{{ ucfirst($category) }}</x-pulse::th>
<x-pulse::th class="text-right"></x-pulse::th>
</tr>
</x-pulse::thead>
<tbody>
@foreach ($items as $key => $value)
<tr class="h-2 first:h-0"></tr>
<tr wire:key="log-file-{{ $key }}">
<x-pulse::td>
<div class="flex items-center" title="{{ $key }}">{{ str($key)->headline() }}</div>
</x-pulse::td>
<x-pulse::td numeric class="text-gray-700 dark:text-gray-300 font-bold">
{{ is_array($value) ? implode(', ', $value) : $value }}
</x-pulse::td>
</tr>
@endforeach
</tbody>
</x-pulse::table>
@endforeach
</div>
</x-pulse::scroll>
</x-pulse::card>

View File

@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="50" height="52" viewBox="0 0 50 52"><title>Laravel Logo</title>
<path d="M49.626 11.564a.809.809 0 0 1 .028.209v10.972a.8.8 0 0 1-.402.694l-9.209 5.302V39.25c0 .286-.152.55-.4.694L20.42 51.01c-.044.025-.092.041-.14.058-.018.006-.035.017-.054.022a.805.805 0 0 1-.41 0c-.022-.006-.042-.018-.063-.026-.044-.016-.09-.03-.132-.054L.402 39.944A.801.801 0 0 1 0 39.25V6.334c0-.072.01-.142.028-.21.006-.023.02-.044.028-.067.015-.042.029-.085.051-.124.015-.026.037-.047.055-.071.023-.032.044-.065.071-.093.023-.023.053-.04.079-.06.029-.024.055-.05.088-.069h.001l9.61-5.533a.802.802 0 0 1 .8 0l9.61 5.533h.002c.032.02.059.045.088.068.026.02.055.038.078.06.028.029.048.062.072.094.017.024.04.045.054.071.023.04.036.082.052.124.008.023.022.044.028.068a.809.809 0 0 1 .028.209v20.559l8.008-4.611v-10.51c0-.07.01-.141.028-.208.007-.024.02-.045.028-.068.016-.042.03-.085.052-.124.015-.026.037-.047.054-.071.024-.032.044-.065.072-.093.023-.023.052-.04.078-.06.03-.024.056-.05.088-.069h.001l9.611-5.533a.801.801 0 0 1 .8 0l9.61 5.533c.034.02.06.045.09.068.025.02.054.038.077.06.028.029.048.062.072.094.018.024.04.045.054.071.023.039.036.082.052.124.009.023.022.044.028.068zm-1.574 10.718v-9.124l-3.363 1.936-4.646 2.675v9.124l8.01-4.611zm-9.61 16.505v-9.13l-4.57 2.61-13.05 7.448v9.216l17.62-10.144zM1.602 7.719v31.068L19.22 48.93v-9.214l-9.204-5.209-.003-.002-.004-.002c-.031-.018-.057-.044-.086-.066-.025-.02-.054-.036-.076-.058l-.002-.003c-.026-.025-.044-.056-.066-.084-.02-.027-.044-.05-.06-.078l-.001-.003c-.018-.03-.029-.066-.042-.1-.013-.03-.03-.058-.038-.09v-.001c-.01-.038-.012-.078-.016-.117-.004-.03-.012-.06-.012-.09v-.002-21.481L4.965 9.654 1.602 7.72zm8.81-5.994L2.405 6.334l8.005 4.609 8.006-4.61-8.006-4.608zm4.164 28.764l4.645-2.674V7.719l-3.363 1.936-4.646 2.675v20.096l3.364-1.937zM39.243 7.164l-8.006 4.609 8.006 4.609 8.005-4.61-8.005-4.608zm-.801 10.605l-4.646-2.675-3.363-1.936v9.124l4.645 2.674 3.364 1.937v-9.124zM20.02 38.33l11.743-6.704 5.87-3.35-8-4.606-9.211 5.303-8.395 4.833 7.993 4.524z" fill="#FF2D20" fill-rule="evenodd"/>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -0,0 +1,23 @@
<x-pulse>
<livewire:pulse.about-application />
<livewire:disk-metrics />
<livewire:pulse.servers cols="full" />
<livewire:pulse.usage cols="4" rows="2" />
<livewire:pulse.queues cols="4" />
<livewire:pulse.cache cols="4" />
<livewire:pulse.slow-queries cols="8" />
<livewire:pulse.exceptions cols="6" />
<livewire:pulse.slow-requests cols="6" />
<livewire:pulse.slow-jobs cols="6" />
<livewire:pulse.slow-outgoing-requests cols="6" />
</x-pulse>