Add IPFS info display to L2 asset detail page
- Add IPFS_GATEWAY_URL config - Show IPFS CID on asset detail page - Add gateway links (local, ipfs.io, dweb.link) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
12
server.py
12
server.py
@@ -38,6 +38,7 @@ DOMAIN = os.environ.get("ARTDAG_DOMAIN", "artdag.rose-ash.com")
|
||||
DATA_DIR = Path(os.environ.get("ARTDAG_DATA", str(Path.home() / ".artdag" / "l2")))
|
||||
L1_PUBLIC_URL = os.environ.get("L1_PUBLIC_URL", "https://celery-artdag.rose-ash.com")
|
||||
EFFECTS_REPO_URL = os.environ.get("EFFECTS_REPO_URL", "https://git.rose-ash.com/art-dag/effects")
|
||||
IPFS_GATEWAY_URL = os.environ.get("IPFS_GATEWAY_URL", "")
|
||||
|
||||
# Cookie domain for sharing auth across subdomains (e.g., ".rose-ash.com")
|
||||
# If not set, derives from DOMAIN (strips first subdomain, adds leading dot)
|
||||
@@ -738,6 +739,7 @@ async def ui_asset_detail(name: str, request: Request):
|
||||
asset = assets[name]
|
||||
owner = asset.get("owner", "unknown")
|
||||
content_hash = asset.get("content_hash", "")
|
||||
ipfs_cid = asset.get("ipfs_cid", "")
|
||||
asset_type = asset.get("asset_type", "")
|
||||
tags = asset.get("tags", [])
|
||||
description = asset.get("description", "")
|
||||
@@ -936,6 +938,16 @@ async def ui_asset_detail(name: str, request: Request):
|
||||
<code class="text-green-300 text-sm break-all">{content_hash}</code>
|
||||
</div>
|
||||
|
||||
<div class="bg-dark-600 rounded-lg p-4">
|
||||
<h3 class="text-sm font-medium text-gray-400 mb-2">IPFS</h3>
|
||||
{f'''<code class="text-purple-300 text-sm break-all mb-2 block">{ipfs_cid}</code>
|
||||
<div class="flex flex-wrap gap-1 mt-2">
|
||||
{f'<a href="{IPFS_GATEWAY_URL}/ipfs/{ipfs_cid}" target="_blank" class="px-2 py-1 bg-green-600 hover:bg-green-700 text-white text-xs rounded">Local</a>' if IPFS_GATEWAY_URL else ''}
|
||||
<a href="https://ipfs.io/ipfs/{ipfs_cid}" target="_blank" class="px-2 py-1 bg-purple-600 hover:bg-purple-700 text-white text-xs rounded">ipfs.io</a>
|
||||
<a href="https://dweb.link/ipfs/{ipfs_cid}" target="_blank" class="px-2 py-1 bg-purple-600 hover:bg-purple-700 text-white text-xs rounded">dweb.link</a>
|
||||
</div>''' if ipfs_cid else '<span class="text-gray-500">Not on IPFS</span>'}
|
||||
</div>
|
||||
|
||||
<div class="bg-dark-600 rounded-lg p-4">
|
||||
<h3 class="text-sm font-medium text-gray-400 mb-2">Created</h3>
|
||||
<span class="text-white">{created_at}</span>
|
||||
|
||||
Reference in New Issue
Block a user