Rename content_hash/output_hash to cid throughout
Refactor to use IPFS CID as the primary content identifier: - Update database schema: content_hash -> cid, output_hash -> output_cid - Update all services, routers, and tasks to use cid terminology - Update HTML templates to display CID instead of hash - Update cache_manager parameter names - Update README documentation This completes the transition to CID-only content addressing. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -44,9 +44,9 @@
|
||||
<span class="text-xs text-gray-500 mr-1">In:</span>
|
||||
{% for inp in run.input_previews %}
|
||||
{% if inp.media_type and inp.media_type.startswith('image/') %}
|
||||
<img src="/cache/{{ inp.hash }}/raw" alt="" class="w-10 h-10 object-cover rounded">
|
||||
<img src="/cache/{{ inp.cid }}/raw" alt="" class="w-10 h-10 object-cover rounded">
|
||||
{% elif inp.media_type and inp.media_type.startswith('video/') %}
|
||||
<video src="/cache/{{ inp.hash }}/raw" class="w-10 h-10 object-cover rounded" muted></video>
|
||||
<video src="/cache/{{ inp.cid }}/raw" class="w-10 h-10 object-cover rounded" muted></video>
|
||||
{% else %}
|
||||
<div class="w-10 h-10 bg-gray-700 rounded flex items-center justify-center text-gray-500 text-xs">?</div>
|
||||
{% endif %}
|
||||
@@ -65,13 +65,13 @@
|
||||
<span class="text-gray-600">-></span>
|
||||
|
||||
{# Output preview #}
|
||||
{% if run.output_hash %}
|
||||
{% if run.output_cid %}
|
||||
<div class="flex items-center space-x-1">
|
||||
<span class="text-xs text-gray-500 mr-1">Out:</span>
|
||||
{% if run.output_media_type and run.output_media_type.startswith('image/') %}
|
||||
<img src="/cache/{{ run.output_hash }}/raw" alt="" class="w-10 h-10 object-cover rounded">
|
||||
<img src="/cache/{{ run.output_cid }}/raw" alt="" class="w-10 h-10 object-cover rounded">
|
||||
{% elif run.output_media_type and run.output_media_type.startswith('video/') %}
|
||||
<video src="/cache/{{ run.output_hash }}/raw" class="w-10 h-10 object-cover rounded" muted></video>
|
||||
<video src="/cache/{{ run.output_cid }}/raw" class="w-10 h-10 object-cover rounded" muted></video>
|
||||
{% else %}
|
||||
<div class="w-10 h-10 bg-gray-700 rounded flex items-center justify-center text-gray-500 text-xs">?</div>
|
||||
{% endif %}
|
||||
@@ -82,8 +82,8 @@
|
||||
|
||||
<div class="flex-grow"></div>
|
||||
|
||||
{% if run.output_hash %}
|
||||
<span class="font-mono text-xs text-gray-600">{{ run.output_hash[:12] }}...</span>
|
||||
{% if run.output_cid %}
|
||||
<span class="font-mono text-xs text-gray-600">{{ run.output_cid[:12] }}...</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</a>
|
||||
|
||||
@@ -211,20 +211,20 @@
|
||||
{% if artifacts %}
|
||||
<div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4">
|
||||
{% for artifact in artifacts %}
|
||||
<a href="/cache/{{ artifact.hash }}"
|
||||
<a href="/cache/{{ artifact.cid }}"
|
||||
class="bg-gray-800 rounded-lg p-4 hover:bg-gray-750 transition-colors">
|
||||
{% if artifact.media_type and artifact.media_type.startswith('image/') %}
|
||||
<img src="/cache/{{ artifact.hash }}/raw" alt=""
|
||||
<img src="/cache/{{ artifact.cid }}/raw" alt=""
|
||||
class="w-full h-32 object-cover rounded mb-2">
|
||||
{% elif artifact.media_type and artifact.media_type.startswith('video/') %}
|
||||
<video src="/cache/{{ artifact.hash }}/raw"
|
||||
<video src="/cache/{{ artifact.cid }}/raw"
|
||||
class="w-full h-32 object-cover rounded mb-2" muted></video>
|
||||
{% else %}
|
||||
<div class="w-full h-32 bg-gray-900 rounded mb-2 flex items-center justify-center text-gray-600">
|
||||
{{ artifact.media_type or 'Unknown' }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="font-mono text-xs text-gray-500 truncate">{{ artifact.hash[:16] }}...</div>
|
||||
<div class="font-mono text-xs text-gray-500 truncate">{{ artifact.cid[:16] }}...</div>
|
||||
<div class="text-sm text-gray-400">{{ artifact.step_name }}</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
@@ -242,8 +242,8 @@
|
||||
<div class="bg-gray-800 rounded-lg p-6">
|
||||
<div class="flex items-center justify-between mb-4">
|
||||
<h3 class="text-lg font-semibold">{{ item.input_name }}</h3>
|
||||
<a href="/cache/{{ item.input_hash }}" class="font-mono text-xs text-blue-400 hover:text-blue-300">
|
||||
{{ item.input_hash[:16] }}...
|
||||
<a href="/cache/{{ item.input_cid }}" class="font-mono text-xs text-blue-400 hover:text-blue-300">
|
||||
{{ item.input_cid[:16] }}...
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -330,21 +330,21 @@
|
||||
<div class="bg-gray-800 rounded-lg overflow-hidden">
|
||||
<!-- Media Preview -->
|
||||
{% if input.media_type and input.media_type.startswith('image/') %}
|
||||
<a href="/cache/{{ input.hash }}" class="block">
|
||||
<img src="/cache/{{ input.hash }}/raw" alt="{{ input.name or 'Input' }}"
|
||||
<a href="/cache/{{ input.cid }}" class="block">
|
||||
<img src="/cache/{{ input.cid }}/raw" alt="{{ input.name or 'Input' }}"
|
||||
class="w-full h-48 object-cover">
|
||||
</a>
|
||||
{% elif input.media_type and input.media_type.startswith('video/') %}
|
||||
<a href="/cache/{{ input.hash }}" class="block">
|
||||
<video src="/cache/{{ input.hash }}/raw"
|
||||
<a href="/cache/{{ input.cid }}" class="block">
|
||||
<video src="/cache/{{ input.cid }}/raw"
|
||||
class="w-full h-48 object-cover" muted controls></video>
|
||||
</a>
|
||||
{% elif input.media_type and input.media_type.startswith('audio/') %}
|
||||
<div class="p-4 bg-gray-900">
|
||||
<audio src="/cache/{{ input.hash }}/raw" controls class="w-full"></audio>
|
||||
<audio src="/cache/{{ input.cid }}/raw" controls class="w-full"></audio>
|
||||
</div>
|
||||
{% else %}
|
||||
<a href="/cache/{{ input.hash }}" class="block">
|
||||
<a href="/cache/{{ input.cid }}" class="block">
|
||||
<div class="w-full h-48 bg-gray-900 flex items-center justify-center text-gray-600">
|
||||
<div class="text-center">
|
||||
<div class="text-4xl mb-2">📄</div>
|
||||
@@ -358,8 +358,8 @@
|
||||
{% if input.name %}
|
||||
<div class="font-medium text-white mb-1">{{ input.name }}</div>
|
||||
{% endif %}
|
||||
<a href="/cache/{{ input.hash }}" class="font-mono text-xs text-blue-400 hover:text-blue-300 block truncate">
|
||||
{{ input.hash }}
|
||||
<a href="/cache/{{ input.cid }}" class="font-mono text-xs text-blue-400 hover:text-blue-300 block truncate">
|
||||
{{ input.cid }}
|
||||
</a>
|
||||
{% if input.media_type %}
|
||||
<div class="text-xs text-gray-500 mt-1">{{ input.media_type }}</div>
|
||||
@@ -384,22 +384,22 @@
|
||||
</div>
|
||||
|
||||
<!-- Output -->
|
||||
{% if run.output_hash %}
|
||||
{% if run.output_cid %}
|
||||
<div class="mt-8 bg-gray-800 rounded-lg p-6">
|
||||
<h3 class="text-lg font-semibold mb-4">Output</h3>
|
||||
|
||||
{# Inline media preview #}
|
||||
<div class="mb-4">
|
||||
{% if output_media_type and output_media_type.startswith('image/') %}
|
||||
<a href="/cache/{{ run.output_hash }}" class="block">
|
||||
<img src="/cache/{{ run.output_hash }}/raw" alt="Output"
|
||||
<a href="/cache/{{ run.output_cid }}" class="block">
|
||||
<img src="/cache/{{ run.output_cid }}/raw" alt="Output"
|
||||
class="max-w-full max-h-96 rounded-lg mx-auto">
|
||||
</a>
|
||||
{% elif output_media_type and output_media_type.startswith('video/') %}
|
||||
<video src="/cache/{{ run.output_hash }}/raw" controls
|
||||
<video src="/cache/{{ run.output_cid }}/raw" controls
|
||||
class="max-w-full max-h-96 rounded-lg mx-auto"></video>
|
||||
{% elif output_media_type and output_media_type.startswith('audio/') %}
|
||||
<audio src="/cache/{{ run.output_hash }}/raw" controls class="w-full"></audio>
|
||||
<audio src="/cache/{{ run.output_cid }}/raw" controls class="w-full"></audio>
|
||||
{% else %}
|
||||
<div class="bg-gray-900 rounded-lg p-8 text-center text-gray-500">
|
||||
<div class="text-4xl mb-2">?</div>
|
||||
@@ -409,8 +409,8 @@
|
||||
</div>
|
||||
|
||||
<div class="flex items-center justify-between">
|
||||
<a href="/cache/{{ run.output_hash }}" class="font-mono text-sm text-blue-400 hover:text-blue-300">
|
||||
{{ run.output_hash }}
|
||||
<a href="/cache/{{ run.output_cid }}" class="font-mono text-sm text-blue-400 hover:text-blue-300">
|
||||
{{ run.output_cid }}
|
||||
</a>
|
||||
{% if run.output_ipfs_cid %}
|
||||
<a href="https://ipfs.io/ipfs/{{ run.output_ipfs_cid }}"
|
||||
|
||||
Reference in New Issue
Block a user