Files
busbar-designer/static/holder.css
T
wenil 3418e01689 holder: cap total cells at 1000 to prevent runaway renders
User-triggered 120x120 = 14400 cells, which produces huge STL/long
renders. Total cells is the right metric (CSG cost scales with count,
not max axis), so cap by N = rows*cols (or rows*(rows+1)/2 for tria
style). 1000 covers any realistic pack (e.g. 20x50) while blocking
accidental misuse.

Backend:
- holder.py: MAX_CELLS env-tunable (default 1000); expected_cell_count
  and _check_cell_limit raise ValueError on exceed; both
  compute_cells() and render_stl() call it up-front.
- app.py: /api/holder/render now returns 400 on ValueError (not 500)
  so the frontend can distinguish bad input from server failure.
  /api/holder/params now publishes max_cells alongside the schema.

Frontend:
- holder-app.js: reads max_cells from the params endpoint; status
  shows "N cells / over limit (1000)" in red and disables the
  Render and "Design busbars" buttons when exceeded.
- holder.css: .topbar-status.over-limit style (red, bold).
2026-05-25 11:49:28 +03:00

114 lines
2.1 KiB
CSS

/* Holder-designer specific styles; complements styles.css. */
.holder-left { width: 340px; }
.viewer3d {
width: 100%;
height: 100%;
background: #0a0d12;
}
.right { position: relative; }
/* Parameter form */
.param-form {
display: flex;
flex-direction: column;
gap: 14px;
}
.param-group {
border: 1px solid var(--border);
border-radius: 4px;
background: var(--bg);
padding: 8px 10px;
}
.param-group-title {
font-size: 11px;
color: var(--muted);
text-transform: uppercase;
letter-spacing: 0.05em;
margin: 0 0 6px;
font-weight: 600;
}
.param-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
margin-bottom: 6px;
}
.param-row label {
flex: 1;
font-size: 12px;
color: var(--text);
text-transform: none;
letter-spacing: 0;
flex-direction: row;
align-items: center;
}
.param-row input[type=number],
.param-row select {
width: 110px;
flex-shrink: 0;
font-size: 12px;
padding: 3px 6px;
}
.param-row .param-help {
font-size: 10px;
color: var(--muted);
flex-basis: 100%;
margin-top: -2px;
}
/* Render progress (indeterminate bar + elapsed-time counter) */
.render-progress {
display: flex;
align-items: center;
gap: 8px;
margin: 6px 0;
}
.render-progress-bar {
flex: 1;
height: 6px;
border-radius: 3px;
background: var(--border, #2a2f3a);
overflow: hidden;
position: relative;
}
.render-progress-fill {
position: absolute;
inset: 0;
width: 35%;
border-radius: 3px;
background: linear-gradient(90deg, transparent, var(--accent, #4a9eff), transparent);
animation: render-progress-slide 1.2s linear infinite;
}
@keyframes render-progress-slide {
0% { left: -35%; }
100% { left: 100%; }
}
.render-elapsed {
font-size: 11px;
color: var(--muted);
font-variant-numeric: tabular-nums;
min-width: 42px;
text-align: right;
}
/* Dirty indicator on Render button when params changed since last render */
#btn-render.dirty {
box-shadow: 0 0 0 2px var(--accent, #4a9eff) inset;
}
/* Cell-count over the server limit — render is disabled, status flagged */
.topbar-status.over-limit {
color: var(--danger, #d94a4a);
font-weight: 600;
}