Skip to content

Commit

Permalink
Merge pull request #1812 from coollabsio/next
Browse files Browse the repository at this point in the history
v4.0.0-beta.236
  • Loading branch information
andrasbacsai committed Mar 5, 2024
2 parents 3dd00dd + fadff79 commit 46ed17c
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 22 deletions.
39 changes: 21 additions & 18 deletions app/Http/Controllers/Api/Server.php
Expand Up @@ -19,11 +19,11 @@ public function servers(Request $request)
$server['is_usable'] = $server->settings->is_usable;
return $server;
});
ray($servers);
return response()->json($servers);
}
public function server_by_uuid(Request $request)
{
$with_resources = $request->query('resources');
$teamId = get_team_id_from_token();
if (is_null($teamId)) {
return response()->json(['error' => 'Invalid token.', 'docs' => 'https://coolify.io/docs/api/authentication'], 400);
Expand All @@ -32,23 +32,26 @@ public function server_by_uuid(Request $request)
if (is_null($server)) {
return response()->json(['error' => 'Server not found.'], 404);
}
$server->load(['settings']);
$server['resources'] = $server->definedResources()->map(function ($resource) {
$payload = [
'id' => $resource->id,
'uuid' => $resource->uuid,
'name' => $resource->name,
'type' => $resource->type(),
'created_at' => $resource->created_at,
'updated_at' => $resource->updated_at,
];
if ($resource->type() === 'service') {
$payload['status'] = $resource->status();
} else {
$payload['status'] = $resource->status;
}
return $payload;
});
if ($with_resources) {
$server['resources'] = $server->definedResources()->map(function ($resource) {
$payload = [
'id' => $resource->id,
'uuid' => $resource->uuid,
'name' => $resource->name,
'type' => $resource->type(),
'created_at' => $resource->created_at,
'updated_at' => $resource->updated_at,
];
if ($resource->type() === 'service') {
$payload['status'] = $resource->status();
} else {
$payload['status'] = $resource->status;
}
return $payload;
});
} else {
$server->load(['settings']);
}
return response()->json($server);
}
}
2 changes: 1 addition & 1 deletion app/Livewire/Boarding/Index.php
Expand Up @@ -199,7 +199,7 @@ public function saveServer()
}
public function installServer()
{
$this->dispatch('validateServer', true);
$this->dispatch('init', true);
}
public function validateServer()
{
Expand Down
2 changes: 1 addition & 1 deletion config/sentry.php
Expand Up @@ -7,7 +7,7 @@

// The release version of your application
// Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD'))
'release' => '4.0.0-beta.235',
'release' => '4.0.0-beta.236',
// When left empty or `null` the Laravel environment will be used
'environment' => config('app.env'),

Expand Down
2 changes: 1 addition & 1 deletion config/version.php
@@ -1,3 +1,3 @@
<?php

return '4.0.0-beta.235';
return '4.0.0-beta.236';
2 changes: 1 addition & 1 deletion versions.json
Expand Up @@ -4,7 +4,7 @@
"version": "3.12.36"
},
"v4": {
"version": "4.0.0-beta.235"
"version": "4.0.0-beta.236"
}
}
}
Expand Down

0 comments on commit 46ed17c

Please sign in to comment.