deployer fixes

This commit is contained in:
Mark Gregory
2026-10-12 09:53:48 +01:00
parent 2139e55137
commit 85f9e56b03
9 changed files with 84 additions and 2 deletions
@@ -0,0 +1,12 @@
@extends('layouts.app', ['title' => 'Download products — Admin'])
@section('content')
<section class="portal-header"><div><span class="eyebrow">Distribution</span><h1>Other download products</h1><p class="lead compact">Add named products and files to the public downloads area.</p></div><a class="btn btn-secondary" href="{{ route('admin.releases.index') }}">Back to releases</a></section>
@if(session('status'))<div class="card"><p>{{ session('status') }}</p></div>@endif
@if($errors->any())<div class="card"><ul>@foreach($errors->all() as $error)<li>{{ $error }}</li>@endforeach</ul></div>@endif
<div class="editor-card"><h2>Add product</h2><form method="post" action="{{ route('admin.download-products.store') }}" enctype="multipart/form-data">@csrf
<label>Product name<input name="name" required maxlength="150"></label><label>Description<textarea name="description" rows="3"></textarea></label><label>Version<input name="version"></label><label>Platform<input name="platform" placeholder="macOS, Windows, Linux…"></label><label>Download file<input type="file" name="package" required></label><label><input type="checkbox" name="is_published" value="1"> Publish immediately</label><p><button class="btn btn-primary">Add product</button></p></form></div>
@foreach($products as $product)
<div class="editor-card" style="margin-top:20px"><h2>{{ $product->name }}</h2><p>{{ $product->download_count }} downloads · {{ $product->formatted_size }} · {{ $product->is_published ? 'Published' : 'Draft' }}</p><form method="post" action="{{ route('admin.download-products.update',$product) }}" enctype="multipart/form-data">@csrf @method('PUT')
<label>Product name<input name="name" value="{{ $product->name }}" required></label><label>Description<textarea name="description" rows="3">{{ $product->description }}</textarea></label><label>Version<input name="version" value="{{ $product->version }}"></label><label>Platform<input name="platform" value="{{ $product->platform }}"></label><label>Replace file (optional)<input type="file" name="package"></label><label><input type="checkbox" name="is_published" value="1" @checked($product->is_published)> Published</label><p><button class="btn btn-primary">Save changes</button></p></form><form method="post" action="{{ route('admin.download-products.destroy',$product) }}" onsubmit="return confirm('Delete this product and its file?')">@csrf @method('DELETE')<button class="danger-outline">Delete product</button></form></div>
@endforeach
@endsection
@@ -1,6 +1,6 @@
@extends('layouts.app', ['title' => 'Releases — SonarDesk Admin'])
@section('content')
<section class="portal-header admin-release-head"><div><span class="eyebrow">Distribution</span><h1>Release management</h1><p class="lead compact">Publish SonarDesk builds, manage the public download experience and keep Sparkle updates under control.</p></div><div class="support-actions"><a class="btn btn-secondary" href="{{ route('admin.releases.settings') }}">Download page settings</a><a class="btn btn-primary" href="{{ route('admin.releases.create') }}">New release</a></div></section>
<section class="portal-header admin-release-head"><div><span class="eyebrow">Distribution</span><h1>Release management</h1><p class="lead compact">Publish SonarDesk builds, manage the public download experience and keep Sparkle updates under control.</p></div><div class="support-actions"><a class="btn btn-secondary" href="{{ route('admin.download-products.index') }}">Other products</a><a class="btn btn-secondary" href="{{ route('admin.releases.settings') }}">Download page settings</a><a class="btn btn-primary" href="{{ route('admin.releases.create') }}">New release</a></div></section>
<div class="grid admin-metrics"><div class="card"><strong>{{ $releases->total() }}</strong><p>Total releases</p></div><div class="card"><strong>{{ $publishedCount }}</strong><p>Published</p></div><div class="card"><strong>{{ number_format($downloadCount) }}</strong><p>Total downloads</p></div><div class="card"><strong>Live</strong><p>Sparkle feed</p></div></div>
<div class="admin-table-card"><div class="admin-table-title"><div><h2>SonarDesk builds</h2><p>Only published builds with an uploaded package are available publicly.</p></div><a href="{{ route('release') }}" class="btn btn-secondary" target="_blank">View public page</a></div><div class="table-scroll"><table class="pro-table"><thead><tr><th>Release</th><th>Channel</th><th>Status</th><th>Package</th><th>Downloads</th><th>Published</th><th></th></tr></thead><tbody>@forelse($releases as $release)<tr><td><strong>SonarDesk {{ $release->version }}</strong><small>Build {{ $release->build_number }} · macOS {{ $release->minimum_macos ?: 'Any supported' }}</small></td><td><span class="status-chip">{{ ucfirst($release->channel) }}</span></td><td>@if($release->is_published)<span class="status-chip success">Published</span>@else<span class="status-chip muted">Draft</span>@endif</td><td>{{ $release->file_path ? $release->formatted_size : 'No package' }}</td><td>{{ number_format($release->download_count) }}</td><td>{{ $release->published_at?->format('j M Y H:i') ?: '—' }}</td><td class="table-actions"><a class="btn btn-secondary" href="{{ route('admin.releases.edit',$release) }}">Edit</a><form method="post" action="{{ route('admin.releases.destroy',$release) }}" onsubmit="return confirm('Delete this release and its package?')">@csrf @method('DELETE')<button class="danger-outline" type="submit">Delete</button></form></td></tr>@empty<tr><td colspan="7" class="empty-cell">No releases yet. Create your first signed SonarDesk build.</td></tr>@endforelse</tbody></table></div></div>
{{ $releases->links() }}