Enhance API response handling and implement unified API standard across multiple modules. Added feature flags for unified exception handling and debug throttling in settings. Updated pagination and response formats in various viewsets to align with the new standard. Improved error handling and response validation in frontend components for better user feedback.

This commit is contained in:
IGNY8 VPS (Salman)
2025-11-15 20:18:42 +00:00
parent 94f243f4a2
commit a75ebf2584
18 changed files with 1974 additions and 642 deletions

View File

@@ -65,13 +65,13 @@ export default function UsageChartWidget() {
<div>
<h4 className="text-sm font-semibold mb-2">By Operation</h4>
<div className="space-y-2">
{Object.entries(usageSummary.by_operation).map(([op, stats]) => (
{usageSummary.by_operation && Object.entries(usageSummary.by_operation).map(([op, stats]) => (
<div key={op} className="flex justify-between items-center text-sm">
<span className="capitalize">{op.replace('_', ' ')}</span>
<span className="font-medium">{stats.credits} credits (${(Number(stats.cost) || 0).toFixed(2)})</span>
</div>
))}
{Object.keys(usageSummary.by_operation).length === 0 && (
{(!usageSummary.by_operation || Object.keys(usageSummary.by_operation || {}).length === 0) && (
<div className="text-sm text-gray-500 dark:text-gray-400">No usage data available</div>
)}
</div>