Runware/ComfyUI fixes, dashboard links, import action, Leonardo plugin, widget, added status field and test connection button

This commit is contained in:
2025-12-03 14:48:45 +01:00
parent 3ec8e471bc
commit 090ec2c44b
16 changed files with 1019 additions and 142 deletions

View File

@@ -2,8 +2,11 @@
namespace App\Filament\Resources\ApiProviders\Pages;
use App\Api\Plugins\PluginLoader;
use App\Filament\Resources\ApiProviders\ApiProviderResource;
use Filament\Actions;
use Filament\Actions\Action;
use Filament\Notifications\Notification;
use Filament\Resources\Pages\EditRecord;
use Livewire\Attributes\On;
@@ -22,6 +25,34 @@ class EditApiProvider extends EditRecord
protected function getHeaderActions(): array
{
return [
Action::make('test_connection')
->label('Verbindung testen')
->icon('heroicon-o-bolt')
->color('gray')
->action(function (): void {
try {
$provider = $this->record;
$plugin = PluginLoader::getPlugin($provider->plugin, $provider);
$plugin->testConnection($provider->toArray());
Notification::make()
->title('Verbindung erfolgreich')
->success()
->send();
} catch (\Throwable $e) {
Notification::make()
->title('Verbindung fehlgeschlagen')
->body($e->getMessage())
->danger()
->send();
}
}),
Action::make('dashboard')
->label('Provider Dashboard')
->icon('heroicon-o-arrow-top-right-on-square')
->visible(fn () => $this->record?->getDashboardUrl())
->url(fn () => $this->record?->getDashboardUrl())
->openUrlInNewTab(),
Actions\DeleteAction::make(),
];
}
@@ -30,4 +61,4 @@ class EditApiProvider extends EditRecord
{
return $this->getResource()::getUrl('index');
}
}
}