feat: implement web UI for provider and model configuration

- Added 'provider_configs' and 'model_configs' tables to database.
- Refactored ProviderManager to support thread-safe dynamic updates and database overrides.
- Implemented 'Models' tab in dashboard to manage model visibility, mapping, and pricing.
- Added provider configuration modal to 'Providers' tab.
- Integrated database overrides into chat completion logic (enabled state, mapping, and cost).
This commit is contained in:
2026-02-26 18:13:04 -05:00
parent c5fb2357ff
commit 3165aa1859
14 changed files with 707 additions and 103 deletions

View File

@@ -137,6 +137,7 @@ class Dashboard {
case 'overview': return this.getOverviewTemplate();
case 'clients': return this.getClientsTemplate();
case 'providers': return this.getProvidersTemplate();
case 'models': return this.getModelsTemplate();
case 'logs': return this.getLogsTemplate();
case 'monitoring': return this.getMonitoringTemplate();
case 'settings': return '<div class="loading-placeholder">Loading settings...</div>';
@@ -253,6 +254,30 @@ class Dashboard {
`;
}
getModelsTemplate() {
return `
<div class="card">
<div class="card-header">
<div>
<h3 class="card-title">Model Registry</h3>
<p class="card-subtitle">Manage model availability and custom pricing</p>
</div>
<div class="card-actions">
<input type="text" id="model-search" placeholder="Search models..." class="form-control" style="margin-bottom: 0; padding: 4px 8px; width: 250px;">
</div>
</div>
<div class="table-container">
<table class="table" id="models-table">
<thead>
<tr><th>ID</th><th>Display Name</th><th>Provider</th><th>Pricing (In/Out)</th><th>Context</th><th>Status</th><th>Actions</th></tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
`;
}
getLogsTemplate() {
return `
<div class="card">