mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-17 15:20:40 +00:00
feat: Refactor service database management and backup functionalities
- Introduced a new sidebar component for service database navigation. - Updated routes for database import and backup functionalities. - Refactored the database import view to improve clarity and maintainability. - Consolidated service application and database views into a more cohesive structure. - Removed deprecated service application view and integrated its functionalities into the service index. - Enhanced user experience with modal confirmations for critical actions. - Improved code readability and organization across various components.
This commit is contained in:
@@ -551,7 +551,21 @@ function getResourceByUuid(string $uuid, ?int $teamId = null)
|
||||
return null;
|
||||
}
|
||||
$resource = queryResourcesByUuid($uuid);
|
||||
if (! is_null($resource) && $resource->environment->project->team_id === $teamId) {
|
||||
if (is_null($resource)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// ServiceDatabase has a different relationship path: service->environment->project->team_id
|
||||
if ($resource instanceof \App\Models\ServiceDatabase) {
|
||||
if ($resource->service?->environment?->project?->team_id === $teamId) {
|
||||
return $resource;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
// Standard resources: environment->project->team_id
|
||||
if ($resource->environment->project->team_id === $teamId) {
|
||||
return $resource;
|
||||
}
|
||||
|
||||
@@ -638,6 +652,12 @@ function queryResourcesByUuid(string $uuid)
|
||||
return $clickhouse;
|
||||
}
|
||||
|
||||
// Check for ServiceDatabase by its own UUID
|
||||
$serviceDatabase = ServiceDatabase::whereUuid($uuid)->first();
|
||||
if ($serviceDatabase) {
|
||||
return $serviceDatabase;
|
||||
}
|
||||
|
||||
return $resource;
|
||||
}
|
||||
function generateTagDeployWebhook($tag_name)
|
||||
|
||||
Reference in New Issue
Block a user