Implemented interaction with docker registry.

This commit is contained in:
2024-07-06 18:07:13 +05:00
parent a8d656148a
commit 10ccf2f800
155 changed files with 5142 additions and 89 deletions

View File

@@ -0,0 +1,3 @@
*
!.gitignore
!readme.txt

View File

@@ -0,0 +1,2 @@
openssl req -nodes -newkey rsa:4096 -keyout registry-auth1.key -out registry-auth1.csr -subj "/CN=token_issuer"
openssl x509 -in registry-auth1.csr -out registry-auth1.crt -req -signkey registry-auth1.key -days 3650

View File

@@ -0,0 +1,3 @@
<svg data-slot="icon" fill="none" stroke-width="1.5" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"></path>
</svg>

After

Width:  |  Height:  |  Size: 335 B

View File

@@ -3,3 +3,4 @@ import.meta.glob([
]);
import './bootstrap';
import './_menu.js';
import './block-copy.js';

View File

@@ -0,0 +1,21 @@
[].slice.call(document.querySelectorAll('.block-copy')).map(function(el) {
let button = el.querySelector('button');
button.addEventListener('click', () => {
navigator.clipboard.writeText(el.querySelector('.block-copy-text').textContent)
.then(() => {
button.textContent = button.getAttribute('data-copy-success');
setTimeout(function () {
button.textContent = button.getAttribute('data-default');
}, 3000);
})
.catch(err => {
button.textContent = button.getAttribute('data-copy-error');
setTimeout(function () {
button.textContent = button.getAttribute('data-default');
}, 3000);
console.log('Something went wrong', err);
});
});
});

View File

@@ -1,6 +1,11 @@
@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,700;1,400;1,700&display=swap');
@import "reset";
@import "layout";
@import "table";
@import "forms";
@import "header";
@import "footer";
@import "pagination";
@import "block-profile";
@import "repository";
@import "generated-token";

View File

@@ -0,0 +1,18 @@
.block-profile {
border-radius: 9px;
border: 1px solid #ddd;
background: #eee;
margin-top: 20px;
margin-bottom: 10px;
padding: 10px;
h1 {
font-size: 22px;
padding: 0;
margin: 0;
}
}
.block-profile__line {
padding-top: 10px;
font-size: 16px;
}

View File

@@ -23,6 +23,10 @@
border: 1px solid #ddd;
}
textarea.form-control {
resize: vertical;
}
.form-control.is-invalid {
border-color: #dc3545;
}
@@ -54,12 +58,20 @@
padding: 12px 30px;
color: #fff;
transition: opacity 0.2s ease-out;
text-decoration: none;
display: inline-block;
vertical-align: top;
text-align: center;
}
.button:hover {
opacity: 0.8;
border-color: #006ce7;
color: #ccc;
}
.button.button-red {
border: 1px solid #FF2D20;
background: #9a241f;
}
.captcha-service-kor-elf {
position: relative;
@@ -70,6 +82,7 @@
border-radius: 6px;
font-size: 16px;
padding: 14px 24px;
margin-bottom: 15px;
ul {
padding: 0;
@@ -85,3 +98,11 @@
border: 1px solid #dc3545;
color: #dc3545;
}
.form__example {
font-size: 14px;
font-style: italic;
color: #333;
}
.form__example__block {
display: block;
}

View File

@@ -0,0 +1,33 @@
#generated-token {
background: rgba(0, 0, 0, 0.78);
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
}
.generated-token__content {
background: #fff;
max-width: 600px;
margin: 30px auto;
padding-left: 20px;
padding-right: 20px;
padding-bottom: 20px;
.warning {
border-radius: 3px;
border: 1px solid #FF2D20;
color: #88302a;
padding: 10px;
margin-bottom: 20px;
}
}
.generated-token__content__head {
font-size: 20px;
font-weight: bold;
border-bottom: 1px solid #ddd;
padding-top: 20px;
padding-bottom: 20px;
}

View File

@@ -20,7 +20,7 @@ hr {
display: flex;
flex-direction: column;
position: relative;
min-height: 100vh;
min-height: calc(100vh - 69px);
}
#menu {
@@ -77,13 +77,36 @@ hr {
}
}
.block-copy {
background: #eee;
border: 1px solid #ccc;
padding: 7px 10px;
border-radius: 9px;
position: relative;
min-height: 40px;
margin-top: 30px;
.block-copy-text {
white-space: break-spaces;
overflow-wrap: break-word;
word-break: break-all;
}
button {
position: absolute;
right: 0;
top: -20px;
cursor: pointer;
}
}
.container-width {
padding-left: 15px;
padding-right: 15px;
}
.section-content {
h1 {
.h1 {
font-size: 27px;
font-weight: bold;
padding-bottom: 10px;
@@ -92,6 +115,33 @@ hr {
}
}
.margin-bottom-20 {
margin-bottom: 20px;
}
.quantity_pulls {
font-size: 14px;
color: #333;
display: inline-block;
vertical-align: middle;
}
.quantity_pulls:before {
content: ' ';
background: url('../images/icons/download.svg') left top no-repeat;
background-size: contain;
display: inline-block;
vertical-align: middle;
width: 13px;
height: 13px;
margin-right: 5px;
}
.dot {
padding-left: 7px;
padding-right: 7px;
color: #999;
}
@media (min-width: 1000px) {
.container-width {
max-width: 1200px;
@@ -123,4 +173,19 @@ hr {
#content {
grid-area: section-content;
}
.block-copy {
margin-top: 0;
button {
display: none;
right: 5px;
top: 7px;
}
}
.block-copy:hover {
button {
display: block;
}
}
}

View File

@@ -0,0 +1,41 @@
.pagination {
list-style: none;
font-size: 0;
padding: 0;
margin: 0;
overflow: auto;
white-space: nowrap;
li {
display: inline-block;
vertical-align: top;
border: 1px solid #ddd;
margin-right: 10px;
span, a {
text-decoration: none;
display: block;
text-align: center;
padding: 7px 5px;
width: 40px;
color: #000;
font-size: 16px;
transition: background 0.3s ease-out;
}
a:hover {
background: #dddddd;
}
}
li.active {
font-weight: bold;
background: #ddd;
}
li.disabled {
a, span {
color: #999;
}
}
}

View File

@@ -0,0 +1,155 @@
.content-repositories {
padding-top: 10px;
.h1 {
.button__create {
display: block;
margin-bottom: 0;
}
}
}
.content-repositories__list__item {
border: 1px solid #ddd;
margin-bottom: 20px;
padding: 10px;
display: block;
text-decoration: none;
color: #000;
}
.content-repositories__list__item__head {
display: flex;
flex-direction: row;
-moz-box-pack: justify;
justify-content: space-between;
-moz-box-align: center;
align-items: center;
}
.content-repositories__list__item__line {
display: block;
padding-top: 10px;
}
.content-repositories__list__item__updated {
color: #777;
}
.content-repositories__menu {
list-style: none;
margin: 0 0 20px;
padding: 0;
border-bottom: 1px solid #ddd;
font-size: 0;
li {
margin: 0;
padding: 0;
display: inline-block;
vertical-align: top;
margin-right: 10px;
padding-bottom: 10px;
a {
color: #000;
text-decoration: none;
font-size: 18px;
transition: opacity 0.2s ease-out;
padding-left: 7px;
padding-right: 7px;
}
a:hover {
opacity: 0.65;
}
}
li.active {
padding-bottom: 8px;
border-bottom: 2px solid #006400;
a {
font-weight: bold;
}
}
}
.content-repositories__overview__command {
background: #eee;
margin-bottom: 20px;
}
.content-repositories__overview__command__head {
font-weight: bold;
font-size: 18px;
margin-bottom: 15px;
}
.content-repositories__overview__content {
margin-bottom: 20px;
}
.content-repositories__overview__border {
border: 1px solid #ddd;
padding: 15px 10px;
}
.content-repositories__tag__content {
margin-bottom: 20px;
}
.content-repositories__tag__info {
p {
margin-top: 0;
padding-bottom: 10px;
}
}
.content-repositories__tag {
border: 1px solid #ddd;
padding: 15px 10px;
margin-bottom: 20px;
}
@media (min-width: 550px) {
.content-repositories {
.h1 {
display: flex;
flex-direction: row;
-moz-box-pack: justify;
justify-content: space-between;
-moz-box-align: center;
align-items: center;
}
}
.content-repositories__buttons {
display: flex;
flex-direction: row;
-moz-box-pack: justify;
justify-content: space-between;
-moz-box-align: center;
align-items: center;
}
}
@media (min-width: 1000px) {
.content-repositories__overview {
display: flex;
flex-direction: row;
-moz-box-pack: justify;
justify-content: space-between;
}
.content-repositories__overview__content {
order: 1;
width: 100%;
}
.content-repositories__overview__command {
order: 2;
width: 350px;
margin-left: 20px;
}
.content-repositories__tag__content {
display: flex;
flex-direction: row;
-moz-box-pack: justify;
justify-content: space-between;
margin-bottom: 10px;
}
.content-repositories__tag__command {
padding-top: 20px;
}
}

View File

@@ -0,0 +1,18 @@
.block-table {
overflow: auto;
}
.table {
width: 100%;
border-collapse: collapse;
border-spacing: 0px;
margin-bottom: 20px;
th, td {
border: 1px solid #ddd;
padding: 10px 20px;
}
th {
text-transform: uppercase;
}
}

View File

@@ -2,7 +2,7 @@
<x-volt.forms.checkbox :title="__('validation.attributes.is_active')" name="is_active" checkboxValue="1" notCheckedValue="0" :userValue="(string) $user->is_active" />
<x-volt.forms.input :title="__('validation.attributes.name')" name="name" type="text" :value="$user->name" required autofocus />
<x-volt.forms.input :title="__('validation.attributes.email')" name="email" type="email" :value="$user->email" required />
<x-volt.forms.input :title="__('validation.attributes.username')" name="username" type="text" allowed-characters="a-z0-9.-_" :example="'test-1 ' . __('or') . ' 1.2'" :value="$user->username" required />
<x-volt.forms.input :title="__('validation.attributes.username')" name="username" type="text" :disabled="!empty($user->id)" allowed-characters="a-z0-9.-_" :example="'test-1 ' . __('or') . ' 1.2'" :value="$user->username" required />
@if (empty($user->id))
<x-volt.forms.input :title="__('validation.attributes.password')" name="password" type="password" value="" required autocomplete="off" />
@endif

View File

@@ -6,6 +6,14 @@
@endif
</label>
<input id="form-input-{{ $requestName }}" class="form-control @error($requestName) is-invalid @enderror" name="{{ $name }}" type="{{ $type }}" @if($type !== 'password') value="{{ $value }}" @endif {{ $attributes }}>
<div class="form__example">
@if(!empty($allowedCharacters))
<span class="form__example__block">{{ __('allowed characters:') }} <strong>{{ $allowedCharacters }}</strong></span>
@endif
@if(!empty($example))
<span class="form__example__block">{{ __('example:') }} {!! $example !!}</span>
@endif
</div>
@error($requestName)
<span class="invalid-feedback">{{ $message }}</span>
@enderror

View File

@@ -0,0 +1,12 @@
<div class="form-block">
<label for="form-textarea-{{ $requestName }}">
{{ $title }}
@if($attributes->get('required'))
<span>{{ __('site.required field') }}</span>
@endif
</label>
<textarea id="form-textarea-{{ $requestName }}" class="form-control @error($requestName) is-invalid @enderror" name="{{ $name }}" {{ $attributes }}>{{ $value }}</textarea>
@error($requestName)
<span class="invalid-feedback">{{ $message }}</span>
@enderror
</div>

View File

@@ -58,9 +58,11 @@
<li><a href="{{ route('login') }}" @class(['active' => request()->route()->named(['login'])])>{{ __('Log In') }}</a></li>
@endguest
@auth
@can('AdminPanel')
<li><a href="{{ route('admin.home') }}">{{ __('admin-sections.AdminPanel') }}</a></li>
@endif
@can('AdminPanel')
<li><a href="{{ route('admin.home') }}">{{ __('admin-sections.AdminPanel') }}</a></li>
@endif
<li><a href="{{ route('user.repositories', ['username' => auth()->user()->username]) }}" @class(['active' => request()->route()->named(['user.repositories', 'repository.create'])])>{{ __('My repositories') }}</a></li>
<li><a href="{{ route('profile.access-tokens.index') }}" @class(['active' => request()->route()->named(['profile.access-tokens.*'])])>{{ __('Access Tokens') }}</a></li>
<li><a href="{{ route('profile.edit') }}" @class(['active' => request()->route()->named(['profile.edit'])])>{{ __('Profile') }}</a></li>
<li><a href="{{ route('profile.settings') }}" @class(['active' => request()->route()->named(['profile.settings'])])>{{ __('Settings') }}</a></li>
<li>
@@ -73,10 +75,13 @@
</li>
@endauth
</ul>
<li><a href="{{ route('home') }}" @class(['active' => request()->route()->named(['home'])])>{{ __('Repositories') }}</a></li>
</ul>
</nav>
<div id="content">
<h1>@yield('h1', '')</h1>
@hasSection('h1')
<h1 class="h1">@yield('h1')</h1>
@endif
@includeWhen($errors->any(), 'layout.site._errors', ['errors' => $errors->all()])
@includeWhen(Session::has('success'), 'layout.site._success', ['success' => Session::get('success')])
{{ $slot }}
@@ -86,7 +91,7 @@
</div>
<footer class="footer">
<div class="container-width">
<div class="footer__powered"><a href="https://projects.kor-elf.net/mdhub/" target="_blank">{{ __('Powered by MDHub') }}</a></div>
<div class="footer__powered"><a href="https://mdhub.projects.kor-elf.net" target="_blank">{{ __('Powered by MDHub') }}</a></div>
</div>
</footer>

View File

@@ -0,0 +1,46 @@
@if ($paginator->hasPages())
<nav>
<ul class="pagination">
{{-- Previous Page Link --}}
@if ($paginator->onFirstPage())
<li class="disabled" aria-disabled="true" aria-label="@lang('pagination.previous')">
<span aria-hidden="true">&lsaquo;</span>
</li>
@else
<li>
<a href="{{ $paginator->previousPageUrl() }}" rel="prev" aria-label="@lang('pagination.previous')">&lsaquo;</a>
</li>
@endif
{{-- Pagination Elements --}}
@foreach ($elements as $element)
{{-- "Three Dots" Separator --}}
@if (is_string($element))
<li class="disabled" aria-disabled="true"><span>{{ $element }}</span></li>
@endif
{{-- Array Of Links --}}
@if (is_array($element))
@foreach ($element as $page => $url)
@if ($page == $paginator->currentPage())
<li class="active" aria-current="page"><span>{{ $page }}</span></li>
@else
<li><a href="{{ $url }}">{{ $page }}</a></li>
@endif
@endforeach
@endif
@endforeach
{{-- Next Page Link --}}
@if ($paginator->hasMorePages())
<li>
<a href="{{ $paginator->nextPageUrl() }}" rel="next" aria-label="@lang('pagination.next')">&rsaquo;</a>
</li>
@else
<li class="disabled" aria-disabled="true" aria-label="@lang('pagination.next')">
<span aria-hidden="true">&rsaquo;</span>
</li>
@endif
</ul>
</nav>
@endif

View File

@@ -0,0 +1,89 @@
@section('meta_title', __('site.Create an access token'))
@section('h1', __('site.Create an access token'))
<x-layout.site>
<form method="post" id="token-store">
@csrf
<x-site.forms.input :title="__('validation.attributes.name')" name="name" type="text" value="" required autofocus />
<x-site.forms.select :title="__('validation.attributes.permissions')" name="permissions" :list="$permissions"></x-site.forms.select>
<div class="form-block">
<button class="button" type="submit">{{ __('Create') }}</button>
</div>
</form>
@push('scripts')
<div id="generated-token" style="display: none;">
<div class="generated-token__content">
<div class="generated-token__content__head">
{{ __('Token created') }}
</div>
<p>{{ __('Token Name') }}:<br><span id="generated-token-name"></span></p>
<p>{{ __('Access Permissions') }}:<br><span id="generated-token-permissions"></span></p>
<p><strong>{{ __('To use the access token from your Docker CLI client:') }}</strong></p>
<p><strong>1. {{ __('Run command') }}</strong></p>
<div class="block-copy">
<span class="block-copy-text">docker login {{ $serviceAddress }} -u {{ $user->username }}</span>
<button type="button" data-default="{{ __('Copy') }}" data-copy-error="{{ __('Error copy') }}" data-copy-success="{{ __('Copied') }}">{{ __('Copy') }}</button>
</div>
<p><strong>2. {{ __('At the password prompt, enter the personal access token.') }}</strong></p>
<div class="block-copy">
<span class="block-copy-text" id="generated-token-text"></span>
<button type="button" data-default="{{ __('Copy') }}" data-copy-error="{{ __('Error copy') }}" data-copy-success="{{ __('Copied') }}">{{ __('Copy') }}</button>
</div>
<p class="warning"><strong>{{ __('WARNING') }}</strong>: {{ __('This access token will only be displayed once. It will not be stored and cannot be retrieved. Please be sure to save it now.') }}</p>
<a href="{{ route('profile.access-tokens.index') }}" class="button">{{ __('OK, I saved it') }}</a>
</div>
</div>
<script>
(function() {
let formTokenStore = document.querySelector('#token-store');
if (formTokenStore) {
formTokenStore.addEventListener('submit', function(event) {
event.preventDefault();
[].slice.call(document.querySelector('#content').querySelectorAll('.alert.alert-danger')).map(function(el) {
el.remove();
});
axios.post(
'{{ route('profile.access-tokens.store') }}',
formTokenStore,
{
headers: {
'Content-Type': 'application/json'
},
}
)
.then(response => {
let blockToken = document.querySelector('#generated-token');
if (!blockToken) {
return null;
}
blockToken.querySelector('#generated-token-name').textContent = response.data.name;
blockToken.querySelector('#generated-token-permissions').textContent = response.data.permission;
blockToken.querySelector('#generated-token-text').textContent = response.data.token;
blockToken.style.display = 'block';
})
.catch(error => {
let messages = '<ul>';
if (error.response && error.response.data && error.response.data.errors) {
for (let key in error.response.data.errors) {
messages += '<li>' + error.response.data.errors[key] + '</li>';
}
} else {
messages += '<li>{{ __('Server Error') }}</li>';
messages += '<li>' + error + '</li>';
}
messages += '</ul>';
let container = document.createElement("div");
container.classList = 'alert alert-danger';
container.setAttribute('role', 'alert');
container.innerHTML = messages;
document.querySelector('#content').querySelector('h1').after(container);
});
});
}
})();
</script>
@endpush
</x-layout.site>

View File

@@ -0,0 +1,16 @@
@section('meta_title', __('site.Editing a token'))
@section('h1', __('site.Editing a token'))
<x-layout.site>
<form method="post" action="{{ route('profile.access-tokens.update', $token) }}">
@method('PUT')
@csrf
<x-site.forms.input :title="__('validation.attributes.name')" name="name" type="text" :value="$token->name" required autofocus />
<x-site.forms.select :title="__('validation.attributes.permissions')" name="permissions" :list="$permissions" required :value="$token->abilities[0] ?? ''">
<option value=""></option>
</x-site.forms.select>
<div class="form-block">
<button class="button" type="submit">{{ __('Edit') }}</button>
</div>
</form>
</x-layout.site>

View File

@@ -0,0 +1,47 @@
@section('meta_title', __('Access Tokens'))
@section('h1', __('Access Tokens'))
<x-layout.site>
<a href="{{ route('profile.access-tokens.create') }}" class="button button__create margin-bottom-20">{{ __('site.Create an access token') }}</a>
<div class="block-table">
<table class="table">
<tr>
<th>{{ __('validation.attributes.name') }}</th>
<th>{{ __('validation.attributes.permissions') }}</th>
<th>{{ __('Last Used') }}</th>
<th>{{ __('Created') }}</th>
<th></th>
</tr>
@foreach($tokens as $token)
<tr>
<td>
<a href="{{ route('profile.access-tokens.edit', $token) }}">{{ $token->name }}</a>
</td>
<td>
@foreach($token->abilities as $ability)
{{ \App\Enums\AccessTokenPermission::tryFrom($ability)?->getTitle() }}<br>
@endforeach
</td>
<td>
{{ $token->last_used_at?->diffForHumans() ?? __('Never') }}
</td>
<td>
{{ $token->created_at->diffForHumans() }}
</td>
<td>
<form method="post" action="{{ route('profile.access-tokens.destroy', $token) }}">
@csrf
@method('DELETE')
<button type="submit" class="button button-red click-confirm">
{{ __('Delete') }}
</button>
</form>
</td>
</tr>
@endforeach
</table>
</div>
{{ $tokens->links() }}
@push('scripts')
@include('_scripts._click-confirm', ['alert' => __('Do you want to delete?')])
@endpush
</x-layout.site>

View File

@@ -1,6 +0,0 @@
@section('meta_title', "")
@section('h1', "123")
<x-layout.site>
789
</x-layout.site>

View File

@@ -0,0 +1,8 @@
@csrf
<x-site.forms.checkbox :title="__('validation.attributes.is_public')" name="is_public" checkboxValue="1" notCheckedValue="0" :userValue="(string) $repository->is_public" />
<x-site.forms.input :title="__('validation.attributes.name')" name="name" type="text" :disabled="!empty($repository->id)" allowed-characters="a-z0-9.-_" :example="'test-1 ' . __('or') . ' 1.2'" :value="$repository->name" :required="empty($repository->id)" autofocus />
<x-site.forms.textarea :title="__('validation.attributes.description')" name="description" :value="$repository->description" />
<x-site.forms.textarea :title="__('validation.attributes.overview')" name="overview" :value="$repository->overview" />
<div class="form-block">
<button class="button" type="submit">{{ __('Save') }}</button>
</div>

View File

@@ -0,0 +1,39 @@
<div class="content-repositories__buttons">
@can('update', $repository)
<a href="{{ route('repository.edit', ['username' => $repository->user->username, 'repository_name' => $repository->name]) }}" class="button button__create margin-bottom-20">{{ __('Edit') }}</a>
@endcan
@can('delete', $repository)
<form method="post" action="{{ route('repository.destroy', ['username' => $repository->user->username, 'repository_name' => $repository->name]) }}">
@csrf
@method('DELETE')
<button type="submit" class="button button-red click-confirm margin-bottom-20">
{{ __('Delete') }}
</button>
</form>
@endcan
</div>
<div class="content-repositories__list">
<div class="content-repositories__list__item">
<span class="content-repositories__list__item__head">
<span><strong>{{ $repository->repository }}</strong></span>
<span class="quantity_pulls">@abbreviate_int($repository->quantity_pulls)</span>
</span>
<span class="content-repositories__list__item__line">
<span class="content-repositories__list__item__username">{{ __('by') }} <strong><a href="{{ route('user.repositories', ['username' => $repository->user->username]) }}">{{ $repository->user->username }}</a></strong></span>
<span class="dot"></span>
<span class="content-repositories__list__item__updated">{{ __('site.Updated :date', ['date' => $repository->updated_at->diffForHumans()]) }}</span>
</span>
<span class="content-repositories__list__item__line">
{{ $repository->description }}
</span>
</div>
</div>
<ul class="content-repositories__menu">
<li @class(['active' => request()->route()->named('repository.view')])><a href="{{ route('repository.view', ['username' => $repository->user->username, 'repository_name' => $repository->name]) }}">{{ __('site.Overview') }}</a></li>
<li @class(['active' => request()->route()->named('repository.tags')])><a href="{{ route('repository.tags', ['username' => $repository->user->username, 'repository_name' => $repository->name]) }}">{{ __('site.Tags') }}</a></li>
</ul>
@push('scripts')
@can('delete', $repository)
@include('_scripts._click-confirm', ['alert' => __('Do you want to delete?')])
@endcanany
@endpush

View File

@@ -0,0 +1,8 @@
@section('meta_title', __('site.Create repository'))
@section('h1', __('site.Create repository'))
<x-layout.site>
<form method="post" action="{{ route('repository.store', ['username' => $pageUser->username]) }}">
@include('site.repositories._from')
</form>
</x-layout.site>

View File

@@ -0,0 +1,9 @@
@section('meta_title', __('site.Update repository :name', ['name' => $repository->name]))
@section('h1', __('site.Update repository :name', ['name' => $repository->name]))
<x-layout.site>
<form method="post" action="{{ route('repository.update', ['username' => $pageUser->username, 'repository_name' => $repository->name]) }}">
@method('PUT')
@include('site.repositories._from')
</form>
</x-layout.site>

View File

@@ -0,0 +1,26 @@
@section('meta_title', __('site.Repositories'))
@section('h1', __('site.Repositories'))
<x-layout.site>
<div class="content-repositories">
<div class="content-repositories__list">
@foreach($repositories as $repository)
<a class="content-repositories__list__item" href="{{ route('repository.view', ['repository_name' => $repository->name, 'username' => $repository->user->username]) }}">
<span class="content-repositories__list__item__head">
<span><strong>{{ $repository->repository }}</strong></span>
<span class="quantity_pulls">@abbreviate_int($repository->quantity_pulls)</span>
</span>
<span class="content-repositories__list__item__line">
<span class="content-repositories__list__item__username">{{ __('by') }} <strong>{{ $repository->user->username }}</strong></span>
<span class="dot"></span>
<span class="content-repositories__list__item__updated">{{ __('site.Updated :date', ['date' => $repository->updated_at->diffForHumans()]) }}</span>
</span>
<span class="content-repositories__list__item__line">
{{ $repository->description }}
</span>
</a>
@endforeach
</div>
{{ $repositories->links() }}
</div>
</x-layout.site>

View File

@@ -0,0 +1,23 @@
@section('meta_title', __('site.Repository :repository', ['repository' => $repository->repository]))
@section('h1', $repository->user->username . '/' . $repository->name)
<x-layout.site>
<div class="content-repositories">
@include('site.repositories._repository-page', ['repository' => $repository])
<div class="content-repositories__overview">
<div class="content-repositories__overview__command">
<div class="content-repositories__overview__border">
<div class="content-repositories__overview__command__head">{{ __('site.Docker Pull Command') }}</div>
<div class="block-copy">
<span class="block-copy-text">docker pull {{ $serviceAddress }}/{{ $repository->repository }}@if($repository->tag):{{ $repository->tag->name }}@endif</span>
<button type="button" data-default="{{ __('Copy') }}" data-copy-error="{{ __('Error copy') }}" data-copy-success="{{ __('Copied') }}">{{ __('Copy') }}</button>
</div>
</div>
</div>
<div class="content-repositories__overview__content">
<div class="content-repositories__overview__border">
{{ $repository->overview }}
</div>
</div>
</div>
</div>
</x-layout.site>

View File

@@ -0,0 +1,64 @@
@section('meta_title', __('site.Repository :repository', ['repository' => $repository->user->username . '/' . $repository->name]))
@section('h1', $repository->user->username . '/' . $repository->name)
<x-layout.site>
<div class="content-repositories">
@include('site.repositories._repository-page', ['repository' => $repository])
<div class="content-repositories__tags">
@foreach($tags as $tag)
<div class="content-repositories__tag">
<div class="content-repositories__tag__content">
<div class="content-repositories__tag__info">
<p><strong>{{ $tag->name }}</strong></p>
<p>{{ __('site.Updated :date', ['date' => $tag->updated_at->diffForHumans()]) }} {{ __('by') }} <strong><a href="{{ route('user.repositories', ['username' => $repository->user->username]) }}">{{ $repository->user->username }}</a></strong></p>
</div>
<div class="content-repositories__tag__command">
<div class="block-copy">
<span class="block-copy-text">docker pull {{ $serviceAddress }}/{{ $repository->repository }}:{{ $tag->name }}</span>
<button type="button" data-default="{{ __('Copy') }}" data-copy-error="{{ __('Error copy') }}" data-copy-success="{{ __('Copied') }}">{{ __('Copy') }}</button>
</div>
</div>
</div>
<div class="block-table">
<table class="table">
<tr>
<th>Digest</th>
<th>OS/ARCH</th>
<th>Compressed Size</th>
<th>Pulls</th>
@can('delete', $tag)
<th style="width: 100px;"></th>
@endcanany
</tr>
<tr>
<td>
@short_digest($tag->digest)
</td>
<td>
{{ $tag->architecture->os->name }}/{{ $tag->architecture->name }}
</td>
<td>
@size_for_humans($tag->size)
</td>
<td>
<span class="quantity_pulls">@abbreviate_int($tag->quantity_pulls)</span>
</td>
@can('delete', $tag)
<td>
<form method="post" action="{{ route('repository.tag.destroy', ['username' => $repository->user->username, 'repository_name' => $repository->name, 'tag_id' => $tag->id]) }}">
@csrf
@method('DELETE')
<button type="submit" class="button button-red click-confirm margin-bottom-20">
{{ __('Delete') }}
</button>
</form>
</td>
@endcan
</tr>
</table>
</div>
</div>
@endforeach
</div>
{{ $tags->links() }}
</div>
</x-layout.site>

View File

@@ -0,0 +1,37 @@
@section('meta_title', __('site.profile_repositories :username', ['username' => $pageUser->username]))
<x-layout.site>
<div class="block-profile">
<h1>{{ $pageUser->username }}</h1>
<div class="block-profile__line">{{ __('site.Name') }} <i>{{ $pageUser->name }}</i></div>
<div class="block-profile__line">{{ __('site.Joined :date', ['date' => $pageUser->updated_at->isoFormat('LL')]) }}</div>
</div>
<div class="content-repositories">
<div class="h1">
{{ __('site.Repositories') }}
@can('create', [\App\Models\Repository::class, $pageUser])
<a href="{{ route('repository.create', ['username' => $pageUser->username]) }}" class="button button__create">{{ __('site.Create repository') }}</a>
@endcan
</div>
<div class="content-repositories__list">
@foreach($repositories as $repository)
<a class="content-repositories__list__item" href="{{ route('repository.view', ['repository_name' => $repository->name, 'username' => $repository->user->username]) }}">
<span class="content-repositories__list__item__head">
<span><strong>{{ $repository->repository }}</strong></span>
<span class="quantity_pulls">@abbreviate_int($repository->quantity_pulls)</span>
</span>
<span class="content-repositories__list__item__line">
<span class="content-repositories__list__item__username">{{ __('by') }} <strong>{{ $repository->user->username }}</strong></span>
<span class="dot"></span>
<span class="content-repositories__list__item__updated">{{ __('site.Updated :date', ['date' => $repository->updated_at->diffForHumans()]) }}</span>
</span>
<span class="content-repositories__list__item__line">
{{ $repository->description }}
</span>
</a>
@endforeach
</div>
{{ $repositories->links() }}
</div>
</x-layout.site>