Версия 0.1.0-beta #1

Merged
kor-elf merged 5 commits from develop into main 2024-07-06 23:21:32 +05:00
4 changed files with 11 additions and 3 deletions
Showing only changes of commit f3b6c8cd49 - Show all commits

View File

@ -38,4 +38,9 @@ public static function shortDigest(string $digest): string
$digest = Str::of($digest)->explode(':', 2)->last();
return Str::of($digest)->take(12)->toString();
}
public static function dockerServiceAddress(): string
{
return Str::of(config('registry.service_http'))->remove(['http://', 'https://'])->toString();
}
}

View File

@ -5,6 +5,7 @@
use App\Dto\QuerySettingsDto;
use App\Dto\Service\Site\AccessTokens\StoreUpdate;
use App\Enums\AccessTokenPermission;
use App\Helpers\Helpers;
use App\Models\User;
use App\Repositories\AccessTokenRepository;
use App\ServiceResults\ServiceResultArray;
@ -39,7 +40,7 @@ public function create(User $user): ServiceResultError | ServiceResultArray
{
return $this->result([
'user' => $user,
'serviceAddress' => config('registry.service_http'),
'serviceAddress' => Helpers::dockerServiceAddress(),
'permissions' => AccessTokenPermission::toCollection()->pluck('title', 'value')->toArray(),
]);
}

View File

@ -5,6 +5,7 @@
use App\Dto\Builder\Repository as RepositoryBuilder;
use App\Dto\QuerySettingsDto;
use App\Dto\Service\Site\Repository\StoreUpdate;
use App\Helpers\Helpers;
use App\Models\Repository;
use App\Models\User;
use App\Repositories\RepositoryRepository;
@ -65,7 +66,7 @@ public function repository(string $username, string $repositoryName, ?User $user
return $this->result([
'repository' => $repository,
'pageUser' => $pageUser,
'serviceAddress' => config('registry.service_http'),
'serviceAddress' => Helpers::dockerServiceAddress(),
]);
}

View File

@ -3,6 +3,7 @@
namespace App\Services\Site;
use App\Dto\QuerySettingsDto;
use App\Helpers\Helpers;
use App\Models\User;
use App\Repositories\RepositoryRepository;
use App\Repositories\TagRepositoryRepository;
@ -55,7 +56,7 @@ public function tags(string $username, string $repositoryName, QuerySettingsDto
'tags' => $tags,
'repository' => $repository,
'pageUser' => $pageUser,
'serviceAddress' => config('registry.service_http'),
'serviceAddress' => Helpers::dockerServiceAddress(),
]);
}