Add CLI client download
- Include artdag-client.tar.gz package - Add /download/client route to serve the package - Add "Download Client" link in nav bar Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
BIN
artdag-client.tar.gz
Normal file
BIN
artdag-client.tar.gz
Normal file
Binary file not shown.
19
server.py
19
server.py
@@ -28,7 +28,7 @@ logging.basicConfig(
|
|||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
from fastapi import FastAPI, HTTPException, Request, Response, Depends, Cookie
|
from fastapi import FastAPI, HTTPException, Request, Response, Depends, Cookie
|
||||||
from fastapi.responses import JSONResponse, HTMLResponse, RedirectResponse
|
from fastapi.responses import JSONResponse, HTMLResponse, RedirectResponse, FileResponse
|
||||||
from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
|
from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
import requests
|
import requests
|
||||||
@@ -319,6 +319,7 @@ def base_html(title: str, content: str, username: str = None) -> str:
|
|||||||
<a href="/activities" class="text-gray-400 hover:text-white transition-colors">Activities</a>
|
<a href="/activities" class="text-gray-400 hover:text-white transition-colors">Activities</a>
|
||||||
<a href="/users" class="text-gray-400 hover:text-white transition-colors">Users</a>
|
<a href="/users" class="text-gray-400 hover:text-white transition-colors">Users</a>
|
||||||
<a href="/anchors/ui" class="text-gray-400 hover:text-white transition-colors">Anchors</a>
|
<a href="/anchors/ui" class="text-gray-400 hover:text-white transition-colors">Anchors</a>
|
||||||
|
<a href="/download/client" class="text-gray-400 hover:text-white transition-colors ml-auto" title="Download CLI client">Download Client</a>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<main class="bg-dark-700 rounded-lg p-6">
|
<main class="bg-dark-700 rounded-lg p-6">
|
||||||
@@ -2761,6 +2762,22 @@ async def test_ots_connection():
|
|||||||
''')
|
''')
|
||||||
|
|
||||||
|
|
||||||
|
# ============ Client Download ============
|
||||||
|
|
||||||
|
CLIENT_TARBALL = Path(__file__).parent / "artdag-client.tar.gz"
|
||||||
|
|
||||||
|
@app.get("/download/client")
|
||||||
|
async def download_client():
|
||||||
|
"""Download the Art DAG CLI client."""
|
||||||
|
if not CLIENT_TARBALL.exists():
|
||||||
|
raise HTTPException(404, "Client package not found")
|
||||||
|
return FileResponse(
|
||||||
|
CLIENT_TARBALL,
|
||||||
|
media_type="application/gzip",
|
||||||
|
filename="artdag-client.tar.gz"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import uvicorn
|
import uvicorn
|
||||||
uvicorn.run("server:app", host="0.0.0.0", port=8200, workers=4)
|
uvicorn.run("server:app", host="0.0.0.0", port=8200, workers=4)
|
||||||
|
|||||||
Reference in New Issue
Block a user