Skip to content

Commit

Permalink
Code review on commit b8fde4e
Browse files Browse the repository at this point in the history
  • Loading branch information
csavelief committed Jun 2, 2024
1 parent b8fde4e commit 051dfcc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 20 deletions.
2 changes: 1 addition & 1 deletion app/Models/YnhBackup.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ public function user(): BelongsTo

public function server(): BelongsTo
{
return $this->belongsTo(YnhServer::class);
return $this->belongsTo(YnhServer::class, 'ynh_server_id', 'id');
}
}
28 changes: 10 additions & 18 deletions resources/views/home/cards/_towerify_backups.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ function formatBytes($bytes, $precision = 2)
</h3>
</div>
</div>
<div id="result-8" class="alert alert-dismissible fade show m-2" style="display:none;">
<button type="button" class="btn-close" aria-label="Close" onclick="closeResult8()"></button>
<span id="result-message-8"></span>
</div>
@if($backups->isEmpty())
<div class="card-body">
<div class="row">
Expand All @@ -37,8 +33,8 @@ function formatBytes($bytes, $precision = 2)
<table class="table table-hover">
<thead>
<tr>
<th>{{ __('Date') }}</th>
<th>{{ __('Server') }}</th>
<th>{{ __('Date') }}</th>
<th>{{ __('Name') }}</th>
<th>{{ __('Size') }}</th>
<th></th>
Expand All @@ -48,10 +44,14 @@ function formatBytes($bytes, $precision = 2)
@foreach($backups->sortByDesc('updated_at') as $backup)
<tr>
<td>
{{ $backup->updated_at->format('Y-m-d H:i:s') }}
<span class="font-lg mb-3 fw-bold">
<a href="{{ route('ynh.servers.edit', $backup->server->id) }}">
{{ $backup->server->name }}
</a>
</span>
</td>
<td>
{{ $backup->server->name }}
{{ $backup->updated_at->format('Y-m-d H:i:s') }}
</td>
<td>
{{ $backup->name }}
Expand All @@ -60,8 +60,8 @@ function formatBytes($bytes, $precision = 2)
{{ formatBytes($backup->size) }}
</td>
<td>
@if($server->isReady() && Auth::user()->canManageServers())
<a href="/ynh/servers/{{ $server->id }}/backup/{{ $backup->id }}"
@if($backup->server->isReady() && Auth::user()->canManageServers())
<a href="/ynh/servers/{{ $backup->server->id }}/backup/{{ $backup->id }}"
class="cursor-pointer"
title="download">
<img src="{{ asset('images/download.png') }}" height="20" class="float-end">
Expand All @@ -70,7 +70,7 @@ class="cursor-pointer"
</td>
</tr>
<tr>
<td colspan="4">
<td colspan="5">
@foreach($backup->result['apps'] as $app => $status)
@if($status === 'Success')
<span class="tw-pill rounded-pill bg-success">{{ $app }}</span>
Expand All @@ -86,12 +86,4 @@ class="cursor-pointer"
</div>
@endif
</div>
<script>
function closeResult8() {
const resultDiv = document.getElementById('result-8');
resultDiv.style.display = 'none';
}
</script>
@endif
2 changes: 1 addition & 1 deletion resources/views/home/cards/_towerify_domains.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<table class="table table-hover">
<thead>
<tr>
<th>{{ __('Name') }}</th>
<th>{{ __('Server') }}</th>
<th>{{ __('IP V4') }}</th>
<th>{{ __('IP V6') }}</th>
<th>{{ __('Domain') }}</th>
Expand Down

0 comments on commit 051dfcc

Please sign in to comment.