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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user