|
27 | 27 | import IconInferenceTogetherAI from "./IconInferenceTogetherAI.svelte"; |
28 | 28 | import Dropdown from "$lib/Dropdown.svelte"; |
29 | 29 | import DropdownEntry from "$lib/DropdownEntry.svelte"; |
| 30 | + import IconSettings from "./IconSettings.svelte"; |
| 31 | + import IconLinkExternal from "./IconLinkExternal.svelte"; |
30 | 32 |
|
31 | 33 | type InferenceProviderNotOpenAI = Exclude<InferenceProvider, "openai">; |
32 | 34 |
|
|
136 | 138 | }); |
137 | 139 | </script> |
138 | 140 |
|
139 | | -<div class="flex gap-x-2 text-sm not-prose flex-col md:flex-row"> |
| 141 | +<div |
| 142 | + class="flex gap-x-2 justify-between md:items-center w-full text-sm not-prose flex-col md:flex-row" |
| 143 | +> |
140 | 144 | <!-- Language selection --> |
141 | 145 | {#if languages.length > 1} |
142 | 146 | <div> |
143 | | - <p class="font-mono text-sm opacity-50 hidden md:block">Language</p> |
| 147 | + <p class="font-mono text-xs opacity-50 hidden md:block">Language</p> |
144 | 148 | <div class="my-1.5 flex items-center gap-x-1 gap-y-0.5 flex-wrap"> |
145 | 149 | {#each languages as language} |
146 | 150 | <button |
|
164 | 168 | <!-- Client selection --> |
165 | 169 | {#if clients.length > 1} |
166 | 170 | <div> |
167 | | - <p class="font-mono text-sm opacity-50 hidden md:block">Client</p> |
| 171 | + <p class="font-mono text-xs opacity-50 hidden md:block">Client</p> |
168 | 172 | <div class="my-1.5 flex items-center gap-x-1 gap-y-0.5 flex-wrap"> |
169 | 173 | {#each clients as client} |
170 | 174 | <button |
|
182 | 186 | </div> |
183 | 187 | {/if} |
184 | 188 |
|
185 | | - <!-- Stream checkbox (unchanged) --> |
186 | | - {#if model.tags.includes("conversational")} |
187 | | - <div> |
188 | | - <p class="font-mono text-sm opacity-50 hidden md:block">Stream</p> |
189 | | - <div class="text-md group relative flex items-center self-start leading-tight my-1.5"> |
190 | | - <span class="mr-1 sm:block md:hidden">stream:</span> |
191 | | - <input class="md:my-1 form-input not-prose" type="checkbox" bind:checked={streaming} /> |
192 | | - </div> |
193 | | - </div> |
194 | | - {/if} |
195 | | - |
196 | 189 | <!-- Provider selection --> |
197 | 190 | {#if providers.length > 0} |
198 | 191 | {@const nVisibleProviders = 2} |
199 | | - <div class="md:ml-auto md:pl-4"> |
200 | | - <p class="font-mono text-sm opacity-50 hidden md:block">Provider</p> |
| 192 | + <div> |
| 193 | + <p class="font-mono text-xs opacity-50 hidden md:block">Provider</p> |
201 | 194 | <div class="my-1.5 flex items-center gap-x-1 gap-y-0.5 flex-wrap"> |
202 | 195 | {#each providers.slice(0, nVisibleProviders) as provider} |
203 | 196 | <button |
|
246 | 239 | </div> |
247 | 240 | </div> |
248 | 241 | {/if} |
249 | | -</div> |
250 | 242 |
|
251 | | -<div class="not-prose text-sm gap-x-2 hidden md:flex"> |
252 | | - <a href="/settings/tokens" class="btn h-7 gap-1 px-1.5 py-0.5 md:px-2" title="Tokens settings"> |
253 | | - Manage tokens |
254 | | - </a> |
255 | | - <a |
256 | | - href="/settings/inference-providers" |
257 | | - class="btn h-7 gap-1 px-1.5 py-0.5 md:px-2" |
258 | | - title="Inference providers settings" |
259 | | - > |
260 | | - Manage providers |
261 | | - </a> |
| 243 | + <div class="flex not-prose my-1.5"> |
| 244 | + <Dropdown |
| 245 | + btnLabel="" |
| 246 | + classNames="hidden md:block" |
| 247 | + noBtnClass |
| 248 | + useDeprecatedJS={false} |
| 249 | + forceMenuAlignement="right" |
| 250 | + dontCloseIds={["stream-checkbox"]} |
| 251 | + > |
| 252 | + <slot slot="button"> |
| 253 | + <button class="btn h-7 gap-1 px-1.5 py-0.5 md:px-2" title="Settings dropdown"> |
| 254 | + <IconSettings /> |
| 255 | + Settings |
| 256 | + </button> |
| 257 | + </slot> |
| 258 | + <slot slot="menu"> |
| 259 | + <div class="flex flex-col p-2 gap-y-2"> |
| 260 | + {#if model.tags.includes("conversational")} |
| 261 | + <div |
| 262 | + class="text-md group relative flex items-center self-start leading-tight gap-x-2 border-b w-full pb-2" |
| 263 | + > |
| 264 | + <input |
| 265 | + class="form-input not-prose" |
| 266 | + type="checkbox" |
| 267 | + bind:checked={streaming} |
| 268 | + id="stream-checkbox" |
| 269 | + /> |
| 270 | + <span class="">Stream</span> |
| 271 | + </div> |
| 272 | + {/if} |
| 273 | + <a |
| 274 | + href="/settings/tokens" |
| 275 | + class="whitespace-nowrap flex gap-x-1 items-center" |
| 276 | + target="_blank" |
| 277 | + title="Tokens settings" |
| 278 | + > |
| 279 | + <IconLinkExternal /> Manage tokens |
| 280 | + </a> |
| 281 | + |
| 282 | + <a |
| 283 | + href="/settings/inference-providers" |
| 284 | + class="whitespace-nowrap flex gap-x-1 items-center" |
| 285 | + title="Inference providers settings" |
| 286 | + target="_blank" |
| 287 | + > |
| 288 | + <IconLinkExternal /> Manage providers |
| 289 | + </a> |
| 290 | + </div> |
| 291 | + </slot> |
| 292 | + </Dropdown> |
| 293 | + <Dropdown |
| 294 | + classNames="md:hidden" |
| 295 | + noBtnClass |
| 296 | + useDeprecatedJS={false} |
| 297 | + forceMenuAlignement="left" |
| 298 | + dontCloseIds={["stream-checkbox"]} |
| 299 | + > |
| 300 | + <slot slot="button"> |
| 301 | + <button class="btn h-7 gap-1 px-1.5 py-0.5 md:px-2" title="Settings dropdown"> |
| 302 | + <IconSettings /> |
| 303 | + Settings |
| 304 | + </button> |
| 305 | + </slot> |
| 306 | + <slot slot="menu"> |
| 307 | + <div class="flex flex-col p-2 gap-y-2"> |
| 308 | + {#if model.tags.includes("conversational")} |
| 309 | + <div |
| 310 | + class="text-md group relative flex items-center self-start leading-tight gap-x-2 border-b w-full pb-2" |
| 311 | + > |
| 312 | + <input |
| 313 | + class="form-input not-prose" |
| 314 | + type="checkbox" |
| 315 | + bind:checked={streaming} |
| 316 | + id="stream-checkbox" |
| 317 | + /> |
| 318 | + <span class="">Stream</span> |
| 319 | + </div> |
| 320 | + {/if} |
| 321 | + <a |
| 322 | + href="/settings/tokens" |
| 323 | + class="whitespace-nowrap flex gap-x-1 items-center" |
| 324 | + target="_blank" |
| 325 | + title="Tokens settings" |
| 326 | + > |
| 327 | + <IconLinkExternal /> Manage tokens |
| 328 | + </a> |
| 329 | + |
| 330 | + <a |
| 331 | + href="/settings/inference-providers" |
| 332 | + class="whitespace-nowrap flex gap-x-1 items-center" |
| 333 | + title="Inference providers settings" |
| 334 | + target="_blank" |
| 335 | + > |
| 336 | + <IconLinkExternal /> Manage providers |
| 337 | + </a> |
| 338 | + </div> |
| 339 | + </slot> |
| 340 | + </Dropdown> |
| 341 | + <div class="flex-grow" /> |
| 342 | + </div> |
262 | 343 | </div> |
263 | 344 |
|
264 | 345 | {#if code} |
|
0 commit comments