feat: add Integration Credentials CRUD and Deploy UI
Integration Credentials: - Add IntegrationCredential model with encrypted payload - Add full CRUD: ManageIntegrationCredentialsAction, 4 Tasks, Controller, Requests - Add migration for integration_credentials table - Add Vue pages: Index, Create, Edit - AI tasks now read API keys from DB instead of .env - Add sidebar menu item Deploy UI: - Add DeployTask with full deploy lifecycle management - Extend DeployController with index, log, history endpoints - Add Deploy/Index.vue with live polling and deploy log viewer - Add sidebar menu item and QuickAction for Sveden UI: - Add 'key' icon to SidebarNavItem - Change deploy button color to amber in Main.vue
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Containers\Dashboard\Tasks\IntegrationCredentials;
|
||||
|
||||
use App\Containers\Dashboard\Models\IntegrationCredential;
|
||||
use App\Ship\Enums\CacheKeys;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
|
||||
class DeleteIntegrationCredentialTask
|
||||
{
|
||||
public function run(IntegrationCredential $credential): bool
|
||||
{
|
||||
$provider = $credential->provider;
|
||||
$deleted = $credential->delete();
|
||||
|
||||
Cache::forget(CacheKeys::INTEGRATION_CREDENTIAL_PREFIX->value . $provider);
|
||||
|
||||
return $deleted;
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Containers\Dashboard\Tasks\IntegrationCredentials;
|
||||
|
||||
use App\Containers\Dashboard\Models\IntegrationCredential;
|
||||
use App\Ship\Enums\CacheKeys;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
|
||||
class GetIntegrationCredentialTask
|
||||
{
|
||||
public function run(string $provider): ?IntegrationCredential
|
||||
{
|
||||
$cacheKey = CacheKeys::INTEGRATION_CREDENTIAL_PREFIX->value . $provider;
|
||||
|
||||
return Cache::remember($cacheKey, now()->addHour(), function () use ($provider) {
|
||||
return IntegrationCredential::where('provider', $provider)
|
||||
->where('is_active', true)
|
||||
->first();
|
||||
});
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Containers\Dashboard\Tasks\IntegrationCredentials;
|
||||
|
||||
use App\Containers\Dashboard\Models\IntegrationCredential;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
|
||||
class ListIntegrationCredentialsTask
|
||||
{
|
||||
public function run(): Collection
|
||||
{
|
||||
return IntegrationCredential::orderByDesc('id')->get();
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Containers\Dashboard\Tasks\IntegrationCredentials;
|
||||
|
||||
use App\Containers\Dashboard\Models\IntegrationCredential;
|
||||
use App\Ship\Enums\CacheKeys;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
|
||||
class SaveIntegrationCredentialTask
|
||||
{
|
||||
public function run(string $provider, array $payload, bool $isActive = true): IntegrationCredential
|
||||
{
|
||||
$credential = IntegrationCredential::updateOrCreate(
|
||||
['provider' => $provider],
|
||||
['payload' => $payload, 'is_active' => $isActive]
|
||||
);
|
||||
|
||||
Cache::forget(CacheKeys::INTEGRATION_CREDENTIAL_PREFIX->value . $provider);
|
||||
|
||||
return $credential;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user