fix: pass rooms and depots to artery template to fix 500 error
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"showcase_url": "https://sample.spr.mcrn.ar",
|
||||
"framework": {
|
||||
"name": "soleprint",
|
||||
"slug": "soleprint",
|
||||
|
||||
@@ -17,4 +17,4 @@ COPY . .
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
CMD ["uvicorn", "run:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
|
||||
@@ -419,6 +419,21 @@
|
||||
<div class="component"><h4>Depot</h4></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="composition" style="margin-top: 1rem">
|
||||
<h3>Shunt</h3>
|
||||
<div class="components">
|
||||
<div class="component"><h4>Vein Interface</h4></div>
|
||||
<div class="component"><h4>Mock Data</h4></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="composition" style="margin-top: 1rem">
|
||||
<h3>Plexus</h3>
|
||||
<div class="components">
|
||||
<div class="component"><h4>Backend</h4></div>
|
||||
<div class="component"><h4>Frontend</h4></div>
|
||||
<div class="component"><h4>Infra</h4></div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
@@ -428,7 +443,14 @@
|
||||
<div
|
||||
class="vein{% if vein.status == 'live' or vein.status == 'building' %} active{% else %} disabled{% endif %}{% if loop.first %} selected{% endif %}"
|
||||
data-tab="{{ vein.slug }}"
|
||||
{% if vein.status == "planned" %}data-disabled="true"{% endif %}
|
||||
{%
|
||||
if
|
||||
vein.status=""
|
||||
="planned"
|
||||
%}data-disabled="true"
|
||||
{%
|
||||
endif
|
||||
%}
|
||||
>
|
||||
<h3>{{ vein.title }}</h3>
|
||||
</div>
|
||||
|
||||
@@ -214,6 +214,36 @@
|
||||
font-size: 0.85rem;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.showcase-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
.showcase-link {
|
||||
display: inline-block;
|
||||
background: linear-gradient(135deg, #d4a574, #b8956a);
|
||||
color: #0a0a0a;
|
||||
padding: 0.75rem 1.5rem;
|
||||
border-radius: 8px;
|
||||
text-decoration: none;
|
||||
font-weight: 600;
|
||||
transition: transform 0.15s, box-shadow 0.15s;
|
||||
}
|
||||
.showcase-link:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 12px rgba(212, 165, 116, 0.3);
|
||||
}
|
||||
.showcase-hint {
|
||||
color: #666;
|
||||
font-size: 0.8rem;
|
||||
text-decoration: none;
|
||||
}
|
||||
.showcase-hint:hover {
|
||||
color: #d4a574;
|
||||
}
|
||||
</style>
|
||||
{% if managed %}
|
||||
<link rel="stylesheet" href="/sidebar.css">
|
||||
@@ -244,6 +274,14 @@
|
||||
</header>
|
||||
<p class="tagline">Cada paso deja huella</p>
|
||||
|
||||
{% if showcase_url %}
|
||||
<div class="showcase-container">
|
||||
<a href="{{ showcase_url }}" class="showcase-link">Managed Room Demo</a>
|
||||
<a href="/artery" class="showcase-hint">what's a room?</a>
|
||||
<a href="https://mariano.mcrn.ar/docs/soleprint/" class="showcase-hint">see docs</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<p class="mission" style="display: none">
|
||||
<!-- placeholder for session alerts -->
|
||||
</p>
|
||||
|
||||
@@ -351,6 +351,10 @@ def artery_index(request: Request):
|
||||
|
||||
from jinja2 import Template
|
||||
|
||||
# Load rooms and depots
|
||||
rooms = load_data("rooms.json") or []
|
||||
depots = load_data("depots.json") or []
|
||||
|
||||
template = Template(html_path.read_text())
|
||||
return HTMLResponse(
|
||||
template.render(
|
||||
@@ -361,6 +365,8 @@ def artery_index(request: Request):
|
||||
pulses=pulses,
|
||||
shunts=shunts,
|
||||
plexuses=plexuses,
|
||||
rooms=rooms,
|
||||
depots=depots,
|
||||
soleprint_url="/",
|
||||
)
|
||||
)
|
||||
@@ -601,6 +607,7 @@ def index(request: Request):
|
||||
config = load_config()
|
||||
managed = config.get("managed", {})
|
||||
managed_url = get_managed_url(request, managed)
|
||||
showcase_url = config.get("showcase_url")
|
||||
|
||||
return templates.TemplateResponse(
|
||||
"index.html",
|
||||
@@ -611,6 +618,7 @@ def index(request: Request):
|
||||
"station": "/station",
|
||||
"managed": managed,
|
||||
"managed_url": managed_url,
|
||||
"showcase_url": showcase_url,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user