Skip to content

Commit

Permalink
feat: added filters
Browse files Browse the repository at this point in the history
  • Loading branch information
czernika committed Jan 10, 2024
1 parent 49c3423 commit f8970af
Show file tree
Hide file tree
Showing 50 changed files with 1,285 additions and 187 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.github export-ignore
/skeleton export-ignore
/tests export-ignore
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,21 @@

Orchid-style table layout to view and manage Laravel application storage logs within admin panel

## Requirements
## Support

...
Version 1.x requires PHP at least 8.1, Orchid version 14 or higher and Laravel version 10+

| Version | PHP | Laravel | Orchid |
|---------|------|---------|--------|
| 1.x | 8.1+ | 10.x | 14.x |

## Installation

...
Install package via composer

```php
composer require czernika/orchid-log-viewer
```

## Configuration

Expand All @@ -22,6 +30,8 @@ Using [Pest](https://pestphp.com/) as testing tool
composer test
```

**TODO** Feature tests are now falling apart, need to rewrite everything from scratch

## License

Open-source under [MIT](LICENSE)
10 changes: 7 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "czernika/orchid-log-viewer",
"description": "",
"license": "MIT",
"version": "0.0.1",
"version": "1.0.0",
"authors": [
{
"name": "Aliakseyenka Ihar",
Expand All @@ -12,13 +12,16 @@
],
"require": {
"php": "^8.1",
"orchid/platform": "^14.17"
"orchid/platform": "^14.17",
"rap2hpoutre/laravel-log-viewer": "^2.3"
},
"require-dev": {
"ergebnis/composer-normalize": "^2.41",
"laravel/pint": "^1.13",
"orchestra/testbench": "^8.19",
"pestphp/pest": "^2.30",
"plannr/laravel-fast-refresh-database": "^1.1"
"plannr/laravel-fast-refresh-database": "^1.1",
"mockery/mockery": "^1.6"
},
"autoload": {
"psr-4": {
Expand Down Expand Up @@ -56,6 +59,7 @@
],
"build": "@php vendor/bin/testbench workbench:build --ansi",
"clear": "@php vendor/bin/testbench package:purge-skeleton --ansi",
"pint": "./vendor/bin/pint",
"prepare": "@php vendor/bin/testbench package:discover --ansi",
"serve": [
"Composer\\Config::disableProcessTimeout",
Expand Down
131 changes: 130 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 59 additions & 6 deletions config/orchid-log.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,71 @@

return [

'screen' => [

/*
|--------------------------------------------------------------------------
| Auto-discover default screen or not
|--------------------------------------------------------------------------
|
| Should be Screen discovered with provided settings (e.g. name, url, etc) or not.
| If set to `false` you need to register Screen manually within `routes/platform.php` file
| Useful when you need to override conflicting names, slugs or add an extra middleware to a route
|
*/
'discover' => true,


/*
|--------------------------------------------------------------------------
| Screen route name
|--------------------------------------------------------------------------
|
| Route for log screen will be registered under this name
|
*/
'route' => 'platform.logs',
],

/*
|--------------------------------------------------------------------------
| Auto-discover default screen or not
| Default file
|--------------------------------------------------------------------------
|
| Should be Screen discovered with provided settings (e.g. name, url, etc) or not.
| If set to `false` you need to register Screen manually within `routes/platform.php` file
| Useful when you need to override conflicting names, slugs or add an extra middleware to a route
| Name of the default file to be selected. If filters are disabled this file will be selected by default
| to show only its logs. Useful when log channel set to stack
|
*/

'screen' => [
'discover' => true,
'default' => 'laravel.log',

/*
|--------------------------------------------------------------------------
| Filters
|--------------------------------------------------------------------------
|
| Manage storage logs filters
|
*/

'filters' => [
/*
|--------------------------------------------------------------------------
| Disable filters completely
|--------------------------------------------------------------------------
|
*/
'enabled' => true,

/*
|--------------------------------------------------------------------------
| Filter keys
|--------------------------------------------------------------------------
|
| If you encounter some issues or conflicts with the name of used filter keys,
| you can change them here
*/
'fileKey' => 'file',
'levelKey' => 'level',
],
];
39 changes: 39 additions & 0 deletions lang/en/messages.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

return [
'screen' => [
'name' => 'Logs',
'description' => 'Manage app storage logs',
],

'layout' => [
'level' => 'Level',
'text' => 'Log text',
'stack' => 'Stack trace',
'date' => 'Date',
],

'filter' => [
'file' => 'File',
'level' => 'Level',

'headings' => [
'file' => 'Select log file',
'level' => 'Choose log level',
],
],

'actions' => [
'clear' => [
'btn_label' => 'Clear :file',
'confirm_message' => 'All logs will be removed from :file file',
'success_message' => 'File :file was cleared',
],

'delete' => [
'btn_label' => 'Delete :file',
'confirm_message' => 'File :file will be removed',
'success_message' => 'File :file was removed',
],
],
];

0 comments on commit f8970af

Please sign in to comment.