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": {
|
"framework": {
|
||||||
"name": "soleprint",
|
"name": "soleprint",
|
||||||
"slug": "soleprint",
|
"slug": "soleprint",
|
||||||
|
|||||||
@@ -17,4 +17,4 @@ COPY . .
|
|||||||
|
|
||||||
EXPOSE 8000
|
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 class="component"><h4>Depot</h4></div>
|
||||||
</div>
|
</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>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
@@ -428,7 +443,14 @@
|
|||||||
<div
|
<div
|
||||||
class="vein{% if vein.status == 'live' or vein.status == 'building' %} active{% else %} disabled{% endif %}{% if loop.first %} selected{% endif %}"
|
class="vein{% if vein.status == 'live' or vein.status == 'building' %} active{% else %} disabled{% endif %}{% if loop.first %} selected{% endif %}"
|
||||||
data-tab="{{ vein.slug }}"
|
data-tab="{{ vein.slug }}"
|
||||||
{% if vein.status == "planned" %}data-disabled="true"{% endif %}
|
{%
|
||||||
|
if
|
||||||
|
vein.status=""
|
||||||
|
="planned"
|
||||||
|
%}data-disabled="true"
|
||||||
|
{%
|
||||||
|
endif
|
||||||
|
%}
|
||||||
>
|
>
|
||||||
<h3>{{ vein.title }}</h3>
|
<h3>{{ vein.title }}</h3>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -214,6 +214,36 @@
|
|||||||
font-size: 0.85rem;
|
font-size: 0.85rem;
|
||||||
color: #666;
|
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>
|
</style>
|
||||||
{% if managed %}
|
{% if managed %}
|
||||||
<link rel="stylesheet" href="/sidebar.css">
|
<link rel="stylesheet" href="/sidebar.css">
|
||||||
@@ -244,6 +274,14 @@
|
|||||||
</header>
|
</header>
|
||||||
<p class="tagline">Cada paso deja huella</p>
|
<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">
|
<p class="mission" style="display: none">
|
||||||
<!-- placeholder for session alerts -->
|
<!-- placeholder for session alerts -->
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -351,6 +351,10 @@ def artery_index(request: Request):
|
|||||||
|
|
||||||
from jinja2 import Template
|
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())
|
template = Template(html_path.read_text())
|
||||||
return HTMLResponse(
|
return HTMLResponse(
|
||||||
template.render(
|
template.render(
|
||||||
@@ -361,6 +365,8 @@ def artery_index(request: Request):
|
|||||||
pulses=pulses,
|
pulses=pulses,
|
||||||
shunts=shunts,
|
shunts=shunts,
|
||||||
plexuses=plexuses,
|
plexuses=plexuses,
|
||||||
|
rooms=rooms,
|
||||||
|
depots=depots,
|
||||||
soleprint_url="/",
|
soleprint_url="/",
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -601,6 +607,7 @@ def index(request: Request):
|
|||||||
config = load_config()
|
config = load_config()
|
||||||
managed = config.get("managed", {})
|
managed = config.get("managed", {})
|
||||||
managed_url = get_managed_url(request, managed)
|
managed_url = get_managed_url(request, managed)
|
||||||
|
showcase_url = config.get("showcase_url")
|
||||||
|
|
||||||
return templates.TemplateResponse(
|
return templates.TemplateResponse(
|
||||||
"index.html",
|
"index.html",
|
||||||
@@ -611,6 +618,7 @@ def index(request: Request):
|
|||||||
"station": "/station",
|
"station": "/station",
|
||||||
"managed": managed,
|
"managed": managed,
|
||||||
"managed_url": managed_url,
|
"managed_url": managed_url,
|
||||||
|
"showcase_url": showcase_url,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user