|
219 | 219 | <div class="mb-6"> |
220 | 220 | <div class="flex items-start justify-between"> |
221 | 221 | <div> |
222 | | - <h1 class="text-gray-900 dark:text-gray-100"> |
| 222 | + <h1 class="text-3xl font-bold text-gray-900 dark:text-gray-100 mb-2"> |
223 | 223 | Rate Limits: {consumer.app_name} |
224 | 224 | </h1> |
225 | 225 | <p class="mt-1 text-sm text-gray-600 dark:text-gray-400"> |
|
244 | 244 | </span> |
245 | 245 | </div> |
246 | 246 | </div> |
| 247 | + |
| 248 | + <!-- Caching Information --> |
| 249 | + <div class="mt-4 text-sm text-gray-600 dark:text-gray-400"> |
| 250 | + <svg |
| 251 | + class="inline-block mr-1 h-4 w-4" |
| 252 | + fill="currentColor" |
| 253 | + viewBox="0 0 20 20" |
| 254 | + > |
| 255 | + <path |
| 256 | + fill-rule="evenodd" |
| 257 | + d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" |
| 258 | + clip-rule="evenodd" |
| 259 | + /> |
| 260 | + </svg> |
| 261 | + Note: Rate limit records and active rate limits are cached for up to an hour. |
| 262 | + </div> |
247 | 263 | </div> |
248 | 264 |
|
249 | 265 | <!-- Current Usage Card --> |
|
263 | 279 |
|
264 | 280 | <div class="grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-6"> |
265 | 281 | <!-- Per Second --> |
266 | | - {#if !activeRateLimits || activeRateLimits.active_per_second_rate_limit > 0} |
267 | | - <div> |
268 | | - <div class="mb-1 text-xs text-blue-700 dark:text-blue-300"> |
269 | | - Per Second |
270 | | - </div> |
271 | | - <div class="text-sm font-medium text-blue-900 dark:text-blue-100"> |
272 | | - {formatUsageValue(callCounters, "per_second")} |
273 | | - {#if activeRateLimits} |
274 | | - / {formatNumber(activeRateLimits.active_per_second_rate_limit)} |
275 | | - {/if} |
276 | | - </div> |
| 282 | + <div> |
| 283 | + <div class="mb-1 text-xs text-blue-700 dark:text-blue-300"> |
| 284 | + Per Second |
277 | 285 | </div> |
278 | | - {/if} |
| 286 | + <div class="text-sm font-medium text-blue-900 dark:text-blue-100"> |
| 287 | + {formatUsageValue(callCounters, "per_second")} |
| 288 | + {#if activeRateLimits && activeRateLimits.active_per_second_rate_limit > 0} |
| 289 | + / {formatNumber(activeRateLimits.active_per_second_rate_limit)} |
| 290 | + {/if} |
| 291 | + </div> |
| 292 | + </div> |
279 | 293 |
|
280 | 294 | <!-- Per Minute --> |
281 | | - {#if !activeRateLimits || activeRateLimits.active_per_minute_rate_limit > 0} |
282 | | - <div> |
283 | | - <div class="mb-1 text-xs text-blue-700 dark:text-blue-300"> |
284 | | - Per Minute |
285 | | - </div> |
286 | | - <div class="text-sm font-medium text-blue-900 dark:text-blue-100"> |
287 | | - {formatUsageValue(callCounters, "per_minute")} |
288 | | - {#if activeRateLimits} |
289 | | - / {formatNumber(activeRateLimits.active_per_minute_rate_limit)} |
290 | | - {/if} |
291 | | - </div> |
| 295 | + <div> |
| 296 | + <div class="mb-1 text-xs text-blue-700 dark:text-blue-300"> |
| 297 | + Per Minute |
292 | 298 | </div> |
293 | | - {/if} |
| 299 | + <div class="text-sm font-medium text-blue-900 dark:text-blue-100"> |
| 300 | + {formatUsageValue(callCounters, "per_minute")} |
| 301 | + {#if activeRateLimits && activeRateLimits.active_per_minute_rate_limit > 0} |
| 302 | + / {formatNumber(activeRateLimits.active_per_minute_rate_limit)} |
| 303 | + {/if} |
| 304 | + </div> |
| 305 | + </div> |
294 | 306 |
|
295 | 307 | <!-- Per Hour --> |
296 | | - {#if !activeRateLimits || activeRateLimits.active_per_hour_rate_limit > 0} |
297 | | - <div> |
298 | | - <div class="mb-1 text-xs text-blue-700 dark:text-blue-300"> |
299 | | - Per Hour |
300 | | - </div> |
301 | | - <div class="text-sm font-medium text-blue-900 dark:text-blue-100"> |
302 | | - {formatUsageValue(callCounters, "per_hour")} |
303 | | - {#if activeRateLimits} |
304 | | - / {formatNumber(activeRateLimits.active_per_hour_rate_limit)} |
305 | | - {/if} |
306 | | - </div> |
| 308 | + <div> |
| 309 | + <div class="mb-1 text-xs text-blue-700 dark:text-blue-300">Per Hour</div> |
| 310 | + <div class="text-sm font-medium text-blue-900 dark:text-blue-100"> |
| 311 | + {formatUsageValue(callCounters, "per_hour")} |
| 312 | + {#if activeRateLimits && activeRateLimits.active_per_hour_rate_limit > 0} |
| 313 | + / {formatNumber(activeRateLimits.active_per_hour_rate_limit)} |
| 314 | + {/if} |
307 | 315 | </div> |
308 | | - {/if} |
| 316 | + </div> |
309 | 317 |
|
310 | 318 | <!-- Per Day --> |
311 | | - {#if !activeRateLimits || activeRateLimits.active_per_day_rate_limit > 0} |
312 | | - <div> |
313 | | - <div class="mb-1 text-xs text-blue-700 dark:text-blue-300">Per Day</div> |
314 | | - <div class="text-sm font-medium text-blue-900 dark:text-blue-100"> |
315 | | - {formatUsageValue(callCounters, "per_day")} |
316 | | - {#if activeRateLimits} |
317 | | - / {formatNumber(activeRateLimits.active_per_day_rate_limit)} |
318 | | - {/if} |
319 | | - </div> |
| 319 | + <div> |
| 320 | + <div class="mb-1 text-xs text-blue-700 dark:text-blue-300">Per Day</div> |
| 321 | + <div class="text-sm font-medium text-blue-900 dark:text-blue-100"> |
| 322 | + {formatUsageValue(callCounters, "per_day")} |
| 323 | + {#if activeRateLimits && activeRateLimits.active_per_day_rate_limit > 0} |
| 324 | + / {formatNumber(activeRateLimits.active_per_day_rate_limit)} |
| 325 | + {/if} |
320 | 326 | </div> |
321 | | - {/if} |
| 327 | + </div> |
322 | 328 |
|
323 | 329 | <!-- Per Week --> |
324 | | - {#if !activeRateLimits || activeRateLimits.active_per_week_rate_limit > 0} |
325 | | - <div> |
326 | | - <div class="mb-1 text-xs text-blue-700 dark:text-blue-300"> |
327 | | - Per Week |
328 | | - </div> |
329 | | - <div class="text-sm font-medium text-blue-900 dark:text-blue-100"> |
330 | | - {formatUsageValue(callCounters, "per_week")} |
331 | | - {#if activeRateLimits} |
332 | | - / {formatNumber(activeRateLimits.active_per_week_rate_limit)} |
333 | | - {/if} |
334 | | - </div> |
| 330 | + <div> |
| 331 | + <div class="mb-1 text-xs text-blue-700 dark:text-blue-300">Per Week</div> |
| 332 | + <div class="text-sm font-medium text-blue-900 dark:text-blue-100"> |
| 333 | + {formatUsageValue(callCounters, "per_week")} |
| 334 | + {#if activeRateLimits && activeRateLimits.active_per_week_rate_limit > 0} |
| 335 | + / {formatNumber(activeRateLimits.active_per_week_rate_limit)} |
| 336 | + {/if} |
335 | 337 | </div> |
336 | | - {/if} |
| 338 | + </div> |
337 | 339 |
|
338 | 340 | <!-- Per Month --> |
339 | | - {#if !activeRateLimits || activeRateLimits.active_per_month_rate_limit > 0} |
340 | | - <div> |
341 | | - <div class="mb-1 text-xs text-blue-700 dark:text-blue-300"> |
342 | | - Per Month |
343 | | - </div> |
344 | | - <div class="text-sm font-medium text-blue-900 dark:text-blue-100"> |
345 | | - {formatUsageValue(callCounters, "per_month")} |
346 | | - {#if activeRateLimits} |
347 | | - / {formatNumber(activeRateLimits.active_per_month_rate_limit)} |
348 | | - {/if} |
349 | | - </div> |
| 341 | + <div> |
| 342 | + <div class="mb-1 text-xs text-blue-700 dark:text-blue-300">Per Month</div> |
| 343 | + <div class="text-sm font-medium text-blue-900 dark:text-blue-100"> |
| 344 | + {formatUsageValue(callCounters, "per_month")} |
| 345 | + {#if activeRateLimits && activeRateLimits.active_per_month_rate_limit > 0} |
| 346 | + / {formatNumber(activeRateLimits.active_per_month_rate_limit)} |
| 347 | + {/if} |
350 | 348 | </div> |
351 | | - {/if} |
| 349 | + </div> |
352 | 350 | </div> |
353 | 351 | </div> |
354 | 352 |
|
|
0 commit comments