Skip to content

Commit

Permalink
Change Namespace of Jobs (#246)
Browse files Browse the repository at this point in the history
  • Loading branch information
mooxbot committed Dec 7, 2023
1 parent 39d73df commit 6b34702
Show file tree
Hide file tree
Showing 32 changed files with 213 additions and 278 deletions.
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

2 changes: 0 additions & 2 deletions .gitignore

This file was deleted.

22 changes: 11 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
# Changelog

All notable changes to `filament-job-manager` will be documented in this file.
All notable changes to `jobs` will be documented in this file.

## v0.6.1 - 2022-12-08

- focus relevant information in failed jobs index table
- focus relevant information in failed jobs index table

## v0.6.0 - 2022-10-06

- introduce https://github.com/invaders-xx/filament-jsoneditor for `payload`
- introduce https://github.com/invaders-xx/filament-jsoneditor for `payload`

## v0.5.1 - 2022-09-08

- do not show 'options' column in JobBatchesResource
- do not show 'options' column in JobBatchesResource

## v0.5.0 - 2022-09-08

- place FailedJobResource and JobBatchesResource in 'jobs' Navigation Group
- place FailedJobResource and JobBatchesResource in 'jobs' Navigation Group

## v0.4.0 - 2022-08-29

- introduced ability to delete failed jobs or job batches
- introduced ability to delete failed jobs or job batches

## v0.3.2 - 2022-08-29

- introduced `job_batches` Resource (if the sql table is present)
- introduced `job_batches` Resource (if the sql table is present)

## v0.2.0 - 2022-08-09

- introduced 'view' ViewAction to see job details as popup
- introduced Bulk Action for Retry
- introduced 'Retry all failed jobs' Button
- introduced 'view' ViewAction to see job details as popup
- introduced Bulk Action for Retry
- introduced 'Retry all failed jobs' Button

## v0.1.0 - 2022-08-09

- initial release
- initial release
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![Moox Jobs](https://github.com/mooxphp/moox/raw/main/_other/art/banner/jobs.jpg)
![filament-banner](./docs/filament-banner.jpg)

# Moox Jobs
# Filament Job Manager

Filament panel for managing job queues including failed jobs and batches.

Expand Down Expand Up @@ -41,13 +41,13 @@ This Laravel package is made for Filament 3 and the awesome TALL-Stack.
Install the package via Composer:

```bash
composer require adrolli/filament-job-manager
composer require adrolli/jobs
```

Create the necessary tables:

```bash
php artisan vendor:publish --tag="filament-job-manager-migrations"
php artisan vendor:publish --tag="jobs-migrations"

# Queue tables, if using the database driver instead of Redis queue backend
php artisan queue:table
Expand All @@ -60,7 +60,7 @@ php artisan migrate
Publish the config file with:

```bash
php artisan vendor:publish --tag="filament-job-manager-config"
php artisan vendor:publish --tag="jobs-config"
```

This is the content of the published config file:
Expand All @@ -76,7 +76,7 @@ return [
'navigation_icon' => 'heroicon-o-play',
'navigation_sort' => 1,
'navigation_count_badge' => true,
'resource' => Adrolli\FilamentJobManager\Resources\JobsResource::class,
'resource' => Moox\Jobs\Resources\JobsResource::class,
],
'jobs_waiting' => [
'enabled' => true,
Expand All @@ -86,7 +86,7 @@ return [
'navigation_icon' => 'heroicon-o-pause',
'navigation_sort' => 2,
'navigation_count_badge' => true,
'resource' => Adrolli\FilamentJobManager\Resources\WaitingJobsResource::class,
'resource' => Moox\Jobs\Resources\WaitingJobsResource::class,
],
'failed_jobs' => [
'enabled' => true,
Expand All @@ -96,7 +96,7 @@ return [
'navigation_icon' => 'heroicon-o-exclamation-triangle',
'navigation_sort' => 3,
'navigation_count_badge' => true,
'resource' => Adrolli\FilamentJobManager\Resources\FailedJobsResource::class,
'resource' => Moox\Jobs\Resources\FailedJobsResource::class,
],
'job_batches' => [
'enabled' => true,
Expand All @@ -106,7 +106,7 @@ return [
'navigation_icon' => 'heroicon-o-inbox-stack',
'navigation_sort' => 4,
'navigation_count_badge' => true,
'resource' => Adrolli\FilamentJobManager\Resources\JobBatchesResource::class,
'resource' => Moox\Jobs\Resources\JobBatchesResource::class,
],
],
'pruning' => [
Expand All @@ -120,18 +120,18 @@ Register the Plugins in `app/Providers/Filament/AdminPanelProvider.php`:

```php
->plugins([
FilamentJobsPlugin::make(),
FilamentWaitingJobsPlugin::make(),
FilamentFailedJobsPlugin::make(),
FilamentJobBatchesPlugin::make(),
JobsPlugin::make(),
JobsWaitingPlugin::make(),
JobsFailedPlugin::make(),
JobsBatchesPlugin::make(),
])
```

Instead of publishing and modifying the config-file, you can also do all settings in AdminPanelProvider like so:

```php
->plugins([
FilamentJobsPlugin::make()
JobsPlugin::make()
->label('Job runs')
->pluralLabel('Jobs that seems to run')
->enableNavigation(true)
Expand All @@ -141,15 +141,15 @@ Instead of publishing and modifying the config-file, you can also do all setting
->navigationCountBadge(true)
->enablePruning(true)
->pruningRetention(7),
FilamentWaitingJobsPlugin::make()
JobsWaitingPlugin::make()
->label('Job waiting')
->pluralLabel('Jobs waiting in line')
->enableNavigation(true)
->navigationIcon('heroicon-o-calendar')
->navigationGroup('My Jobs and Queues')
->navigationSort(5)
->navigationCountBadge(true)
FilamentFailedJobsPlugin::make()
JobsFailedPlugin::make()
->label('Job failed')
->pluralLabel('Jobs that failed hard')
->enableNavigation(true)
Expand Down Expand Up @@ -180,7 +180,7 @@ You do not need to change anything in your Jobs to work with Filament Job Monito

namespace App\Jobs;

use Adrolli\FilamentJobManager\Traits\JobProgress;
use Moox\Jobs\Traits\JobProgress;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
Expand Down Expand Up @@ -219,9 +219,9 @@ If you would like to prevent certain users from accessing your page, you can reg

```php
use App\Policies\JobMonitorPolicy;
use Adrolli\FilamentJobManager\Models\FailedJob;
use Adrolli\FilamentJobManager\Models\JobBatch;
use Adrolli\FilamentJobManager\Models\JobMonitor;
use Moox\Jobs\Models\FailedJob;
use Moox\Jobs\Models\JobBatch;
use Moox\Jobs\Models\JobMonitor;

class AuthServiceProvider extends ServiceProvider
{
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "adrolli/filament-job-manager",
"description": "A Filament panel for managing job queues including failed jobs and batches.",
"name": "moox/jobs",
"description": "Manage Job Queues, Failed Jobs and Batches in Filament.",
"keywords": [
"laravel",
"filament",
Expand All @@ -11,7 +11,7 @@
"monitor",
"redis"
],
"homepage": "https://github.com/adrolli/filament-job-manager",
"homepage": "https://github.com/mooxphp/jobs",
"license": "MIT",
"authors": [
{
Expand All @@ -29,7 +29,7 @@
"require-dev": {},
"autoload": {
"psr-4": {
"Adrolli\\FilamentJobManager\\": "src"
"Moox\\Jobs\\": "src"
}
},
"config": {
Expand All @@ -38,11 +38,11 @@
"extra": {
"laravel": {
"providers": [
"Adrolli\\FilamentJobManager\\FilamentJobManagerServiceProvider",
"Adrolli\\FilamentJobManager\\JobManagerProvider"
"Moox\\Jobs\\JobsServiceProvider",
"Moox\\Jobs\\JobManagerProvider"
],
"aliases": {
"JobMonitor": "Adrolli\\FilamentJobManager\\JobManagerProvider\\Facade"
"JobMonitor": "Moox\\Jobs\\JobManagerProvider\\Facade"
}
}
},
Expand Down
8 changes: 4 additions & 4 deletions config/filament-job-manager.php → config/jobs.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
'navigation_icon' => 'heroicon-o-play',
'navigation_sort' => 1,
'navigation_count_badge' => true,
'resource' => Adrolli\FilamentJobManager\Resources\JobsResource::class,
'resource' => Moox\Jobs\Resources\JobsResource::class,
],
'jobs_waiting' => [
'enabled' => true,
Expand All @@ -20,7 +20,7 @@
'navigation_icon' => 'heroicon-o-pause',
'navigation_sort' => 2,
'navigation_count_badge' => true,
'resource' => Adrolli\FilamentJobManager\Resources\WaitingJobsResource::class,
'resource' => Moox\Jobs\Resources\WaitingJobsResource::class,
],
'failed_jobs' => [
'enabled' => true,
Expand All @@ -30,7 +30,7 @@
'navigation_icon' => 'heroicon-o-exclamation-triangle',
'navigation_sort' => 3,
'navigation_count_badge' => true,
'resource' => Adrolli\FilamentJobManager\Resources\FailedJobsResource::class,
'resource' => Moox\Jobs\Resources\FailedJobsResource::class,
],
'job_batches' => [
'enabled' => true,
Expand All @@ -40,7 +40,7 @@
'navigation_icon' => 'heroicon-o-inbox-stack',
'navigation_sort' => 4,
'navigation_count_badge' => true,
'resource' => Adrolli\FilamentJobManager\Resources\JobBatchesResource::class,
'resource' => Moox\Jobs\Resources\JobBatchesResource::class,
],
],
'pruning' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ return new class extends Migration
{
Schema::dropIfExists('job_manager');
}
};
};
11 changes: 0 additions & 11 deletions routes/web.php

This file was deleted.

49 changes: 0 additions & 49 deletions src/Controllers/QueueController.php

This file was deleted.

18 changes: 0 additions & 18 deletions src/FilamentJobManagerServiceProvider.php

This file was deleted.

10 changes: 5 additions & 5 deletions src/JobManagerProvider.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php

namespace Adrolli\FilamentJobManager;
namespace Moox\Jobs;

use Adrolli\FilamentJobManager\Models\JobManager;
use Illuminate\Contracts\Queue\Job as JobContract;
use Illuminate\Queue\Events\JobExceptionOccurred;
use Illuminate\Queue\Events\JobFailed;
use Illuminate\Queue\Events\JobProcessed;
use Illuminate\Queue\Events\JobProcessing;
use Illuminate\Support\Facades\Queue;
use Illuminate\Support\ServiceProvider;
use Moox\Jobs\Models\JobManager;

class JobManagerProvider extends ServiceProvider
{
Expand Down Expand Up @@ -86,7 +86,7 @@ protected static function jobFinished(JobContract $job, bool $failed = false, ?\
->orderByDesc('started_at')
->first();

if (null === $monitor) {
if ($monitor === null) {
return;
}

Expand All @@ -96,12 +96,12 @@ protected static function jobFinished(JobContract $job, bool $failed = false, ?\
'failed' => $failed,
];

if (null !== $exception) {
if ($exception !== null) {
$attributes += [
'exception_message' => mb_strcut($exception->getMessage(), 0, 65535),
];
}

$monitor->update($attributes);
}
}
}
Loading

0 comments on commit 6b34702

Please sign in to comment.