Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Thomas G. Lopes
commited on
Commit
·
cc5b5a2
1
Parent(s):
1641adc
remove title
Browse files
src/lib/components/inference-playground/project-select.svelte
CHANGED
|
@@ -113,53 +113,67 @@
|
|
| 113 |
<div
|
| 114 |
class="flex items-center gap-2 rounded-md py-1.5 pr-1 pl-2 group-data-[highlighted]:bg-gray-200 dark:group-data-[highlighted]:bg-gray-700"
|
| 115 |
>
|
| 116 |
-
<
|
| 117 |
-
|
| 118 |
-
{
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
{#snippet trigger(tooltip)}
|
| 124 |
<div
|
| 125 |
class="text-3xs grid aspect-square place-items-center rounded bg-blue-300 p-0.5 text-blue-700 dark:bg-blue-400/25 dark:text-blue-400"
|
| 126 |
aria-label="Branched project"
|
| 127 |
-
{...tooltip.trigger}
|
| 128 |
>
|
| 129 |
<IconBranch />
|
| 130 |
</div>
|
| 131 |
-
{
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
<IconHistory />
|
| 140 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
{/if}
|
| 142 |
-
</
|
| 143 |
{#if id !== "default"}
|
| 144 |
<div class="ml-auto flex items-center gap-1">
|
| 145 |
-
<
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
>
|
| 161 |
-
|
| 162 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 163 |
</div>
|
| 164 |
{/if}
|
| 165 |
</div>
|
|
|
|
| 113 |
<div
|
| 114 |
class="flex items-center gap-2 rounded-md py-1.5 pr-1 pl-2 group-data-[highlighted]:bg-gray-200 dark:group-data-[highlighted]:bg-gray-700"
|
| 115 |
>
|
| 116 |
+
<Tooltip>
|
| 117 |
+
{#snippet trigger(tooltip)}
|
| 118 |
+
<div class="flex items-center gap-2 overflow-hidden" {...tooltip.trigger}>
|
| 119 |
+
<p class="truncate">
|
| 120 |
+
{name}
|
| 121 |
+
</p>
|
| 122 |
+
{#if projects.all.find(p => p.id === id)?.branchedFromId}
|
|
|
|
| 123 |
<div
|
| 124 |
class="text-3xs grid aspect-square place-items-center rounded bg-blue-300 p-0.5 text-blue-700 dark:bg-blue-400/25 dark:text-blue-400"
|
| 125 |
aria-label="Branched project"
|
|
|
|
| 126 |
>
|
| 127 |
<IconBranch />
|
| 128 |
</div>
|
| 129 |
+
{:else if hasCheckpoints}
|
| 130 |
+
<div
|
| 131 |
+
class="text-3xs grid aspect-square place-items-center rounded bg-yellow-300 p-0.5 text-yellow-700 dark:bg-yellow-400/25 dark:text-yellow-400"
|
| 132 |
+
aria-label="Project has checkpoints"
|
| 133 |
+
>
|
| 134 |
+
<IconHistory />
|
| 135 |
+
</div>
|
| 136 |
+
{/if}
|
|
|
|
| 137 |
</div>
|
| 138 |
+
{/snippet}
|
| 139 |
+
{name}
|
| 140 |
+
{#if projects.all.find(p => p.id === id)?.branchedFromId}
|
| 141 |
+
{@const originalProject = projects.getBranchedFromProject(id)}
|
| 142 |
+
<br /><span class="text-xs text-gray-400">Branched from {originalProject?.name || "unknown"}</span>
|
| 143 |
{/if}
|
| 144 |
+
</Tooltip>
|
| 145 |
{#if id !== "default"}
|
| 146 |
<div class="ml-auto flex items-center gap-1">
|
| 147 |
+
<Tooltip>
|
| 148 |
+
{#snippet trigger(tooltip)}
|
| 149 |
+
<button
|
| 150 |
+
class="grid place-items-center rounded-md p-1 text-xs hover:bg-gray-300 dark:hover:bg-gray-600"
|
| 151 |
+
onclick={async e => {
|
| 152 |
+
e.stopPropagation();
|
| 153 |
+
projects.update({ id, name: (await prompt("Edit project name", name)) || name });
|
| 154 |
+
}}
|
| 155 |
+
{...tooltip.trigger}
|
| 156 |
+
>
|
| 157 |
+
<IconEdit />
|
| 158 |
+
</button>
|
| 159 |
+
{/snippet}
|
| 160 |
+
Edit name
|
| 161 |
+
</Tooltip>
|
| 162 |
+
<Tooltip>
|
| 163 |
+
{#snippet trigger(tooltip)}
|
| 164 |
+
<button
|
| 165 |
+
class="grid place-items-center rounded-md p-1 text-xs hover:bg-gray-300 dark:hover:bg-gray-600"
|
| 166 |
+
onclick={e => {
|
| 167 |
+
e.stopPropagation();
|
| 168 |
+
projects.delete(id);
|
| 169 |
+
}}
|
| 170 |
+
{...tooltip.trigger}
|
| 171 |
+
>
|
| 172 |
+
<IconDelete />
|
| 173 |
+
</button>
|
| 174 |
+
{/snippet}
|
| 175 |
+
Delete project
|
| 176 |
+
</Tooltip>
|
| 177 |
</div>
|
| 178 |
{/if}
|
| 179 |
</div>
|
src/lib/components/inference-playground/project-tree-sidebar.svelte
CHANGED
|
@@ -259,22 +259,27 @@
|
|
| 259 |
{#each tree_items as item}
|
| 260 |
{@const is_active = tree.isSelected(item.id)}
|
| 261 |
{@const is_branch = item.project.branchedFromId !== null}
|
| 262 |
-
<
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 278 |
{/each}
|
| 279 |
</div>
|
| 280 |
</div>
|
|
|
|
| 259 |
{#each tree_items as item}
|
| 260 |
{@const is_active = tree.isSelected(item.id)}
|
| 261 |
{@const is_branch = item.project.branchedFromId !== null}
|
| 262 |
+
<Tooltip>
|
| 263 |
+
{#snippet trigger(tooltip)}
|
| 264 |
+
<button
|
| 265 |
+
onclick={() => tree.toggleSelect(item.id)}
|
| 266 |
+
class={cn(
|
| 267 |
+
"grid size-8 place-items-center rounded-md transition-colors",
|
| 268 |
+
is_active
|
| 269 |
+
? "bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400"
|
| 270 |
+
: "text-gray-600 hover:bg-gray-200 dark:text-gray-400 dark:hover:bg-gray-700",
|
| 271 |
+
)}
|
| 272 |
+
{...tooltip.trigger}
|
| 273 |
+
>
|
| 274 |
+
{#if is_branch}
|
| 275 |
+
<IconBranch class="size-4" />
|
| 276 |
+
{:else}
|
| 277 |
+
<IconFolder class="size-4" />
|
| 278 |
+
{/if}
|
| 279 |
+
</button>
|
| 280 |
+
{/snippet}
|
| 281 |
+
{item.project.name}
|
| 282 |
+
</Tooltip>
|
| 283 |
{/each}
|
| 284 |
</div>
|
| 285 |
</div>
|