commandline_options
This commit is contained in:
1 parent
85003004cc
commit
28189cd1ce
4 files changed
+34
-1
No files matched your search
@@ -33,7 +33,11 @@ class SupervisorMaker
|
|||||||
}
|
}
|
||||||
|
|
||||||
$content = '[program:'.$process.']'.PHP_EOL;
|
$content = '[program:'.$process.']'.PHP_EOL;
|
||||||
$content .= 'command=/usr/bin/php '.base_path().'/artisan nuh '.$supervisor->id.PHP_EOL;
|
if ($supervisor->commandline_options) {
|
||||||
|
$content .= 'command=/usr/bin/php '.base_path().'/artisan nuh '.$supervisor->id.' '.$supervisor->commandline_options.PHP_EOL;
|
||||||
|
} else {
|
||||||
|
$content .= 'command=/usr/bin/php '.base_path().'/artisan nuh '.$supervisor->id.PHP_EOL;
|
||||||
|
}
|
||||||
$content .= 'autostart=true'.PHP_EOL;
|
$content .= 'autostart=true'.PHP_EOL;
|
||||||
$content .= 'autorestart=true'.PHP_EOL;
|
$content .= 'autorestart=true'.PHP_EOL;
|
||||||
|
|
||||||
|
|||||||
@@ -2,17 +2,21 @@
|
|||||||
|
|
||||||
namespace App\Filament\Resources\Supervisors\Tables;
|
namespace App\Filament\Resources\Supervisors\Tables;
|
||||||
|
|
||||||
|
use App\Models\Supervisor;
|
||||||
|
use Filament\Actions\BulkAction;
|
||||||
use Filament\Actions\BulkActionGroup;
|
use Filament\Actions\BulkActionGroup;
|
||||||
use Filament\Actions\DeleteBulkAction;
|
use Filament\Actions\DeleteBulkAction;
|
||||||
use Filament\Actions\EditAction;
|
use Filament\Actions\EditAction;
|
||||||
use Filament\Tables\Columns\IconColumn;
|
use Filament\Tables\Columns\IconColumn;
|
||||||
use Filament\Tables\Columns\SelectColumn;
|
use Filament\Tables\Columns\SelectColumn;
|
||||||
use Filament\Tables\Columns\TextColumn;
|
use Filament\Tables\Columns\TextColumn;
|
||||||
|
use Filament\Tables\Columns\TextInputColumn;
|
||||||
use Filament\Tables\Columns\ToggleColumn;
|
use Filament\Tables\Columns\ToggleColumn;
|
||||||
use Filament\Tables\Enums\FiltersLayout;
|
use Filament\Tables\Enums\FiltersLayout;
|
||||||
use Filament\Tables\Filters\SelectFilter;
|
use Filament\Tables\Filters\SelectFilter;
|
||||||
use Filament\Tables\Filters\TernaryFilter;
|
use Filament\Tables\Filters\TernaryFilter;
|
||||||
use Filament\Tables\Table;
|
use Filament\Tables\Table;
|
||||||
|
use Illuminate\Support\Collection;
|
||||||
|
|
||||||
class SupervisorsTable
|
class SupervisorsTable
|
||||||
{
|
{
|
||||||
@@ -42,6 +46,8 @@ class SupervisorsTable
|
|||||||
TextColumn::make('days_to')->label('To'),
|
TextColumn::make('days_to')->label('To'),
|
||||||
TextColumn::make('sleep')->numeric(),
|
TextColumn::make('sleep')->numeric(),
|
||||||
TextColumn::make('runtime')->label('Run Time'),
|
TextColumn::make('runtime')->label('Run Time'),
|
||||||
|
TextInputColumn::make('commandline_options')->width('2rem'),
|
||||||
|
|
||||||
// TextColumn::make('maxsconds')->label('Max Time'),
|
// TextColumn::make('maxsconds')->label('Max Time'),
|
||||||
// IconColumn::make('is_cron')->boolean()->label('Cron')->falseColor('gray'),
|
// IconColumn::make('is_cron')->boolean()->label('Cron')->falseColor('gray'),
|
||||||
ToggleColumn::make('is_cron')->label('Cron'),
|
ToggleColumn::make('is_cron')->label('Cron'),
|
||||||
@@ -61,6 +67,27 @@ class SupervisorsTable
|
|||||||
])
|
])
|
||||||
->toolbarActions([
|
->toolbarActions([
|
||||||
BulkActionGroup::make([
|
BulkActionGroup::make([
|
||||||
|
BulkAction::make('Switch On')
|
||||||
|
->icon('phosphor-play')
|
||||||
|
->action(function (Collection $records, array $data): void {
|
||||||
|
foreach ($records as $record) {
|
||||||
|
Supervisor::where('id', '=', $record->id)
|
||||||
|
->update(
|
||||||
|
['is_active' => 1]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
BulkAction::make('Switch Off')
|
||||||
|
->icon('phosphor-stop')
|
||||||
|
->action(function (Collection $records, array $data): void {
|
||||||
|
foreach ($records as $record) {
|
||||||
|
Supervisor::where('id', '=', $record->id)
|
||||||
|
->update(
|
||||||
|
['is_active' => 0]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
|
||||||
DeleteBulkAction::make(),
|
DeleteBulkAction::make(),
|
||||||
]),
|
]),
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ class Supervisor extends Model
|
|||||||
'sleep',
|
'sleep',
|
||||||
'limit',
|
'limit',
|
||||||
'runtime',
|
'runtime',
|
||||||
|
'commandline_options',
|
||||||
'maxsconds',
|
'maxsconds',
|
||||||
'lastcall',
|
'lastcall',
|
||||||
'is_cron',
|
'is_cron',
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ return new class extends Migration
|
|||||||
$table->integer('limit')->default(0);
|
$table->integer('limit')->default(0);
|
||||||
|
|
||||||
$table->string('runtime')->nullable();
|
$table->string('runtime')->nullable();
|
||||||
|
$table->string('commandline_options')->nullable();
|
||||||
$table->integer('maxsconds')->default(30);
|
$table->integer('maxsconds')->default(30);
|
||||||
$table->integer('lastcall')->default(0);
|
$table->integer('lastcall')->default(0);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user