Consolidate OpenCode Chain into OpenCode Models section

- Removed separate OpenCode Chain card
- Integrated chain functionality as subsection within OpenCode Models
- Chain form and list now appear below the models list
- Added styling to distinguish the chain subsection
This commit is contained in:
southseact-3d
2026-02-18 15:28:04 +00:00
parent b961c6e302
commit 4bb54d38ad

View File

@@ -16,6 +16,18 @@
} }
/* Slightly tighten cards on the build page */ /* Slightly tighten cards on the build page */
body[data-page="build"] .admin-card { padding: 12px; } body[data-page="build"] .admin-card { padding: 12px; }
/* Chain section styling */
.chain-section {
margin-top: 24px;
padding-top: 16px;
border-top: 2px solid var(--border);
}
.chain-section h4 {
margin: 0 0 8px 0;
font-size: 14px;
color: var(--muted);
}
</style> </style>
<!-- PostHog Analytics --> <!-- PostHog Analytics -->
@@ -67,15 +79,15 @@
</div> </div>
</div> </div>
<!-- Section 1: OpenCode Models --> <!-- Section 1: OpenCode Models (with integrated Chain) -->
<div class="admin-card"> <div class="admin-card">
<header> <header>
<h3>OpenCode Models</h3> <h3>OpenCode Models</h3>
<div class="pill">Backend</div> <div class="pill">Backend</div>
</header> </header>
<p style="margin-top:0; color: var(--muted);">Add models from OpenCode. These models process requests and use the OpenCode Chain below for fallback when rate limits are reached.</p> <p style="margin-top:0; color: var(--muted);">Add models from OpenCode. These models process requests and can fall back to the provider chain when rate limits are reached.</p>
<!-- Add Form --> <!-- Add Model Form -->
<form id="opencode-model-form" class="admin-form" style="margin-bottom: 24px;"> <form id="opencode-model-form" class="admin-form" style="margin-bottom: 24px;">
<label> <label>
Choose from OpenCode Choose from OpenCode
@@ -112,25 +124,21 @@
<div class="status-line" id="opencode-model-status"></div> <div class="status-line" id="opencode-model-status"></div>
</form> </form>
<!-- List --> <!-- Models List -->
<header style="margin-top: 24px; border-top: 1px solid var(--border); padding-top: 16px;"> <header style="margin-top: 24px; border-top: 1px solid var(--border); padding-top: 16px;">
<h3>OpenCode Models List</h3> <h3>OpenCode Models List</h3>
<div class="pill" id="opencode-models-count">0</div> <div class="pill" id="opencode-models-count">0</div>
</header> </header>
<p class="muted" style="margin-top:0;">Arrange the order below. This controls which model is primary for OpenCode requests.</p> <p class="muted" style="margin-top:0;">Arrange the order below. This controls which model is primary for OpenCode requests.</p>
<div id="opencode-models-list" class="admin-list"></div> <div id="opencode-models-list" class="admin-list"></div>
</div>
<!-- Section 2: OpenCode Chain (Fallback) --> <!-- Chain Section (integrated) -->
<div class="admin-card" style="margin-top: 16px;"> <div class="chain-section">
<header> <h4>Fallback Chain (for when rate limits are reached)</h4>
<h3>OpenCode Chain</h3> <p class="muted" style="margin-top:0; margin-bottom: 12px;">When the primary OpenCode model hits rate limits, the system falls back through these providers in order.</p>
<div class="pill">Fallback</div>
</header>
<p style="margin-top:0; color: var(--muted);">When rate limits are reached or errors occur, the system falls back through this chain of providers.</p>
<!-- Add Form --> <!-- Add to Chain Form -->
<form id="chain-form" class="admin-form" style="margin-bottom: 24px;"> <form id="chain-form" class="admin-form" style="margin-bottom: 16px;">
<div class="admin-grid" style="grid-template-columns: 1fr 2fr; gap: 12px;"> <div class="admin-grid" style="grid-template-columns: 1fr 2fr; gap: 12px;">
<label> <label>
Provider Provider
@@ -151,22 +159,24 @@
<input id="chain-model" type="text" placeholder="e.g., anthropic/claude-3.5-sonnet" required /> <input id="chain-model" type="text" placeholder="e.g., anthropic/claude-3.5-sonnet" required />
</label> </label>
</div> </div>
<div class="admin-actions"> <div class="admin-actions" style="margin-top: 12px;">
<button type="submit" class="primary">Add to Chain</button> <button type="submit" class="primary">Add to Fallback Chain</button>
</div> </div>
<div class="status-line" id="chain-status"></div> <div class="status-line" id="chain-status"></div>
</form> </form>
<!-- List --> <!-- Chain List -->
<header style="margin-top: 24px; border-top: 1px solid var(--border); padding-top: 16px;"> <div style="margin-top: 16px;">
<h3>Chain Order</h3> <div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;">
<div class="pill" id="chain-count">0</div> <span class="muted">Fallback Chain Order</span>
</header> <span class="pill" id="chain-count">0</span>
<p class="muted" style="margin-top:0;">The system tries providers in this order. Use arrows to reorder.</p> </div>
<div id="chain-list" class="admin-list"></div> <div id="chain-list" class="admin-list"></div>
</div> </div>
</div>
</div>
<!-- Section 3: Public Models (Completely Separate) --> <!-- Section 2: Public Models (Completely Separate) -->
<div class="admin-card" style="margin-top: 16px;"> <div class="admin-card" style="margin-top: 16px;">
<header> <header>
<h3>Public Models</h3> <h3>Public Models</h3>