|
36 | 36 | let filterValue = data.query;
|
37 | 37 | let isFilterInPorgress = false;
|
38 | 38 | let sortValue = data.sort as SortKey;
|
| 39 | + let showUnfeatured = data.showUnfeatured; |
| 40 | +
|
| 41 | + const toggleShowUnfeatured = () => { |
| 42 | + showUnfeatured = !showUnfeatured; |
| 43 | + const newUrl = getHref($page.url, { |
| 44 | + newKeys: { showUnfeatured: showUnfeatured ? "true" : undefined }, |
| 45 | + existingKeys: { behaviour: "delete", keys: [] }, |
| 46 | + }); |
| 47 | + goto(newUrl); |
| 48 | + }; |
39 | 49 |
|
40 | 50 | const onModelChange = (e: Event) => {
|
41 | 51 | const newUrl = getHref($page.url, {
|
|
133 | 143 | <option value={model.name}>{model.name}</option>
|
134 | 144 | {/each}
|
135 | 145 | </select>
|
136 |
| - |
| 146 | + {#if data.user?.isAdmin} |
| 147 | + <label class="mr-auto flex items-center gap-1 text-red-500" title="Admin only feature"> |
| 148 | + <input type="checkbox" checked={showUnfeatured} on:change={toggleShowUnfeatured} /> |
| 149 | + Show unfeatured assistants |
| 150 | + </label> |
| 151 | + {/if} |
137 | 152 | <a
|
138 | 153 | href={`${base}/settings/assistants/new`}
|
139 | 154 | class="flex items-center gap-1 whitespace-nowrap rounded-lg border bg-white py-1 pl-1.5 pr-2.5 shadow-sm hover:bg-gray-50 hover:shadow-none dark:border-gray-600 dark:bg-gray-700 dark:hover:bg-gray-700"
|
|
229 | 244 | !!assistant?.dynamicPrompt}
|
230 | 245 |
|
231 | 246 | <button
|
232 |
| - class="relative flex flex-col items-center justify-center overflow-hidden text-balance rounded-xl border bg-gray-50/50 px-4 py-6 text-center shadow hover:bg-gray-50 hover:shadow-inner dark:border-gray-800/70 dark:bg-gray-950/20 dark:hover:bg-gray-950/40 max-sm:px-4 sm:h-64 sm:pb-4 xl:pt-8" |
| 247 | + class="relative flex flex-col items-center justify-center overflow-hidden text-balance rounded-xl border bg-gray-50/50 px-4 py-6 text-center shadow hover:bg-gray-50 hover:shadow-inner dark:border-gray-800/70 dark:bg-gray-950/20 dark:hover:bg-gray-950/40 max-sm:px-4 sm:h-64 sm:pb-4 xl:pt-8 |
| 248 | + {!assistant.featured && !createdByMe ? 'border !border-red-500/30' : ''}" |
233 | 249 | on:click={() => {
|
234 | 250 | if (data.settings.assistants.includes(assistant._id.toString())) {
|
235 | 251 | settings.instantSet({ activeModel: assistant._id.toString() });
|
|
0 commit comments