Skip to content

Commit e4bc4e2

Browse files
committed
fixes
1 parent ae1d31f commit e4bc4e2

File tree

2 files changed

+71
-6
lines changed

2 files changed

+71
-6
lines changed

public/favicon.ico

320 Bytes
Binary file not shown.

src/App.svelte

Lines changed: 71 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ We also need to update [${RESOURCE_BACKUP_NAME}](https://github.com/${REPO_FULL_
127127
let index: Fuse<Item>;
128128
let results: ResultItem[] = [];
129129
let loading = true;
130+
let expandedRows = new Set<string>();
130131
131132
$: {
132133
if (index) {
@@ -140,6 +141,15 @@ We also need to update [${RESOURCE_BACKUP_NAME}](https://github.com/${REPO_FULL_
140141
});
141142
}
142143
144+
function toggleRow(name: string) {
145+
if (expandedRows.has(name)) {
146+
expandedRows.delete(name);
147+
} else {
148+
expandedRows.add(name);
149+
}
150+
expandedRows = expandedRows; // Trigger reactivity
151+
}
152+
143153
function filterResults(
144154
query: string,
145155
selectedProvider: string,
@@ -306,9 +316,12 @@ We also need to update [${RESOURCE_BACKUP_NAME}](https://github.com/${REPO_FULL_
306316
</thead>
307317
<tbody>
308318
{#each results as { item: { name, mode, litellm_provider, max_input_tokens, max_output_tokens, input_cost_per_token, output_cost_per_token, cache_creation_input_token_cost, cache_read_input_token_cost, ...data } } (name)}
309-
<tr>
319+
<tr class="model-row" class:expanded={expandedRows.has(name)} on:click={() => toggleRow(name)}>
310320
<td class="model-name">
311321
<div class="model-info">
322+
<svg class="expand-icon" class:expanded={expandedRows.has(name)} width="16" height="16" viewBox="0 0 16 16" fill="none">
323+
<path d="M6 4L10 8L6 12" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
324+
</svg>
312325
<div class="provider-avatar">
313326
{#if getProviderLogo(litellm_provider)}
314327
<img
@@ -332,7 +345,7 @@ We also need to update [${RESOURCE_BACKUP_NAME}](https://github.com/${REPO_FULL_
332345
<span class="model-title">{name}</span>
333346
<button
334347
class="copy-button"
335-
on:click={() => copyToClipboard(name)}
348+
on:click|stopPropagation={() => copyToClipboard(name)}
336349
title="Copy model name"
337350
type="button"
338351
>
@@ -343,12 +356,21 @@ We also need to update [${RESOURCE_BACKUP_NAME}](https://github.com/${REPO_FULL_
343356
</button>
344357
</div>
345358
</td>
346-
<td class="context-cell">{max_input_tokens && max_input_tokens > 0 ? (max_input_tokens >= 1000000 ? (max_input_tokens / 1000000).toFixed(0) + 'M' : (max_input_tokens / 1000).toFixed(0) + 'K') : ''}</td>
359+
<td class="context-cell">{max_input_tokens && max_input_tokens > 0 && (max_input_tokens / 1000).toFixed(0) !== '0' ? (max_input_tokens >= 1000000 ? (max_input_tokens / 1000000).toFixed(0) + 'M' : (max_input_tokens / 1000).toFixed(0) + 'K') : ''}</td>
347360
<td class="cost-cell">{input_cost_per_token ? '$' + (input_cost_per_token * 1000000).toFixed(2) + '/M' : ''}</td>
348361
<td class="cost-cell">{output_cost_per_token ? '$' + (output_cost_per_token * 1000000).toFixed(2) + '/M' : ''}</td>
349362
<td class="cost-cell">{cache_read_input_token_cost ? '$' + (cache_read_input_token_cost * 1000000).toFixed(2) + '/M' : ''}</td>
350363
<td class="cost-cell">{cache_creation_input_token_cost ? '$' + (cache_creation_input_token_cost * 1000000).toFixed(2) + '/M' : ''}</td>
351364
</tr>
365+
{#if expandedRows.has(name)}
366+
<tr class="expanded-content" transition:fly={{ y: -10, duration: 200 }}>
367+
<td colspan="6">
368+
<div class="code-block">
369+
<pre><code>{JSON.stringify({ name, mode, litellm_provider, max_input_tokens, max_output_tokens, input_cost_per_token, output_cost_per_token, cache_creation_input_token_cost, cache_read_input_token_cost, ...data }, null, 2)}</code></pre>
370+
</div>
371+
</td>
372+
</tr>
373+
{/if}
352374
{/each}
353375
</tbody>
354376
</table>
@@ -616,19 +638,32 @@ We also need to update [${RESOURCE_BACKUP_NAME}](https://github.com/${REPO_FULL_
616638
color: var(--muted-color);
617639
}
618640
619-
tbody tr {
641+
tbody tr.model-row {
620642
border-bottom: 1px solid var(--muted-border-color);
621643
transition: background-color 0.15s ease;
644+
cursor: pointer;
622645
}
623646
624-
tbody tr:hover {
647+
tbody tr.model-row:hover {
625648
background-color: var(--table-row-stripped-background-color);
626649
}
627650
628-
tbody tr:last-child {
651+
tbody tr.model-row.expanded {
652+
background-color: #f5f5f5;
653+
}
654+
655+
tbody tr.model-row:last-child {
629656
border-bottom: none;
630657
}
631658
659+
tbody tr.expanded-content {
660+
border-bottom: 1px solid var(--muted-border-color);
661+
}
662+
663+
tbody tr.expanded-content td {
664+
padding: 0;
665+
}
666+
632667
td {
633668
padding: 0.875rem 1.5rem;
634669
vertical-align: middle;
@@ -647,6 +682,16 @@ We also need to update [${RESOURCE_BACKUP_NAME}](https://github.com/${REPO_FULL_
647682
position: relative;
648683
}
649684
685+
.expand-icon {
686+
color: var(--muted-color);
687+
transition: transform 0.2s ease;
688+
flex-shrink: 0;
689+
}
690+
691+
.expand-icon.expanded {
692+
transform: rotate(90deg);
693+
}
694+
650695
.copy-button {
651696
display: flex;
652697
align-items: center;
@@ -724,6 +769,26 @@ We also need to update [${RESOURCE_BACKUP_NAME}](https://github.com/${REPO_FULL_
724769
color: var(--muted-color);
725770
}
726771
772+
.code-block {
773+
background-color: #f8f9fa;
774+
border-top: 1px solid var(--muted-border-color);
775+
margin: 0;
776+
padding: 1.5rem;
777+
overflow-x: auto;
778+
}
779+
780+
.code-block pre {
781+
margin: 0;
782+
font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
783+
font-size: 0.875rem;
784+
line-height: 1.6;
785+
}
786+
787+
.code-block code {
788+
color: #24292f;
789+
display: block;
790+
}
791+
727792
/* Responsive Design */
728793
@media (max-width: 768px) {
729794
.header-content {

0 commit comments

Comments
 (0)