Add fork display, version selector, and admin cleanup features
Registry Features: - Fork tracking with forked_from/forked_version metadata - Forked tools show "Forked from" notice on detail page - Original tools display "Forks" section listing all forks - Fork count in tool stats - API: GET /api/v1/tools/<owner>/<name>/forks GUI Improvements: - Version selector dropdown for registry installs - Fetch available versions via GET /api/v1/tools/<owner>/<name>/versions - "Latest" option plus all available versions listed Admin Features: - POST /api/v1/admin/cleanup/rejected endpoint - Maintenance section in admin dashboard - "Dry Run" and "Run Cleanup" buttons for rejected version cleanup - Configurable grace period (default 7 days) Documentation: - Updated CHANGELOG.md with all recent changes Co-Authored-By: Claude Opus 4.5 <[email protected]>
This commit is contained in:
@@ -66,7 +66,24 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if tool.source %}
|
||||
{% if tool.forked_from %}
|
||||
<div class="mt-4 p-3 bg-purple-50 border border-purple-200 rounded-lg">
|
||||
<div class="flex items-start">
|
||||
<svg class="w-5 h-5 text-purple-600 mr-2 mt-0.5 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"/>
|
||||
</svg>
|
||||
<div class="text-sm text-purple-800">
|
||||
<span class="font-medium">Forked from</span>
|
||||
{% set fork_parts = tool.forked_from.split('/') %}
|
||||
<a href="{{ url_for('web.tool_detail', owner=fork_parts[0], name=fork_parts[1]) }}"
|
||||
class="font-medium underline hover:text-purple-900">{{ tool.forked_from }}</a>
|
||||
{% if tool.forked_version %}
|
||||
<span class="text-purple-600">v{{ tool.forked_version }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% elif tool.source %}
|
||||
<div class="mt-4 p-3 bg-amber-50 border border-amber-200 rounded-lg">
|
||||
<div class="flex items-start">
|
||||
<svg class="w-5 h-5 text-amber-600 mr-2 mt-0.5 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
@@ -330,6 +347,44 @@
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- Forks -->
|
||||
{% if forks %}
|
||||
<div class="bg-white rounded-lg border border-purple-200 p-6">
|
||||
<h3 class="text-lg font-semibold text-gray-900 mb-4">
|
||||
<span class="flex items-center">
|
||||
<svg class="w-5 h-5 text-purple-500 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"/>
|
||||
</svg>
|
||||
Forks
|
||||
<span class="ml-2 px-2 py-0.5 text-xs font-medium text-purple-700 bg-purple-100 rounded-full">{{ forks|length }}</span>
|
||||
</span>
|
||||
</h3>
|
||||
<ul class="space-y-3">
|
||||
{% for fork in forks[:5] %}
|
||||
<li>
|
||||
<a href="{{ url_for('web.tool_detail', owner=fork.owner, name=fork.name) }}"
|
||||
class="block hover:bg-purple-50 -mx-2 px-2 py-1 rounded">
|
||||
<div class="flex items-center justify-between">
|
||||
<span class="text-sm font-medium text-gray-900 hover:text-purple-600">
|
||||
{{ fork.owner }}/{{ fork.name }}
|
||||
</span>
|
||||
<span class="text-xs text-gray-400">v{{ fork.latest_version }}</span>
|
||||
</div>
|
||||
{% if fork.description %}
|
||||
<p class="text-xs text-gray-500 truncate mt-0.5">{{ fork.description|truncate(60) }}</p>
|
||||
{% endif %}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% if forks|length > 5 %}
|
||||
<p class="mt-3 text-sm text-center text-purple-600">
|
||||
+ {{ forks|length - 5 }} more fork{{ 's' if forks|length - 5 != 1 else '' }}
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Stats -->
|
||||
<div class="bg-white rounded-lg border border-gray-200 p-6">
|
||||
<h3 class="text-lg font-semibold text-gray-900 mb-4">Stats</h3>
|
||||
@@ -359,6 +414,12 @@
|
||||
<dd class="text-sm font-medium text-gray-900">{{ rating.unique_users|format_number }}</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if tool.fork_count %}
|
||||
<div class="flex items-center justify-between">
|
||||
<dt class="text-sm text-gray-500">Forks</dt>
|
||||
<dd class="text-sm font-medium text-purple-600">{{ tool.fork_count }}</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user