|
40 | 40 | import EyeSlash from '$lib/components/icons/EyeSlash.svelte'; |
41 | 41 | import Eye from '$lib/components/icons/Eye.svelte'; |
42 | 42 | import ChevronDown from '$lib/components/icons/ChevronDown.svelte'; |
| 43 | + import Check from '$lib/components/icons/Check.svelte'; |
43 | 44 | import CheckCircle from '$lib/components/icons/CheckCircle.svelte'; |
44 | 45 | import GarbageBin from '$lib/components/icons/GarbageBin.svelte'; |
45 | 46 | import Minus from '$lib/components/icons/Minus.svelte'; |
46 | 47 | import DocumentArrowUp from '$lib/components/icons/DocumentArrowUp.svelte'; |
47 | 48 | import Download from '$lib/components/icons/Download.svelte'; |
48 | 49 | import EllipsisVertical from '$lib/components/icons/EllipsisVertical.svelte'; |
49 | 50 | import Wrench from '$lib/components/icons/Wrench.svelte'; |
| 51 | + import Pin from '$lib/components/icons/Pin.svelte'; |
| 52 | + import PinSlash from '$lib/components/icons/PinSlash.svelte'; |
| 53 | + import GlobeAlt from '$lib/components/icons/GlobeAlt.svelte'; |
| 54 | + import LockClosed from '$lib/components/icons/LockClosed.svelte'; |
50 | 55 | import { WEBUI_API_BASE_URL } from '$lib/constants'; |
51 | 56 | import { goto } from '$app/navigation'; |
52 | 57 |
|
|
1013 | 1018 | {/if} |
1014 | 1019 | </button> |
1015 | 1020 | </Tooltip> |
| 1021 | + |
| 1022 | + <Tooltip |
| 1023 | + content={defaultModelIdSet.has(model.id) |
| 1024 | + ? $i18n.t('Remove Selected Model') |
| 1025 | + : $i18n.t('Set as Selected Model')} |
| 1026 | + > |
| 1027 | + <button |
| 1028 | + class="self-center w-fit text-sm p-1.5 rounded-xl hover:bg-black/5 dark:hover:bg-white/5 {defaultModelIdSet.has( |
| 1029 | + model.id |
| 1030 | + ) |
| 1031 | + ? 'text-gray-900 dark:text-white' |
| 1032 | + : 'text-gray-500 dark:text-gray-400 dark:hover:text-white'}" |
| 1033 | + type="button" |
| 1034 | + aria-label={defaultModelIdSet.has(model.id) |
| 1035 | + ? $i18n.t('Remove Selected Model') |
| 1036 | + : $i18n.t('Set as Selected Model')} |
| 1037 | + on:click={() => { |
| 1038 | + toggleDefaultModelHandler(model); |
| 1039 | + }} |
| 1040 | + > |
| 1041 | + <Check className="size-3.5" /> |
| 1042 | + </button> |
| 1043 | + </Tooltip> |
| 1044 | + |
| 1045 | + <Tooltip |
| 1046 | + content={defaultPinnedModelIdSet.has(model.id) |
| 1047 | + ? $i18n.t('Remove Pinned Model') |
| 1048 | + : $i18n.t('Set as Pinned Model')} |
| 1049 | + > |
| 1050 | + <button |
| 1051 | + class="self-center w-fit text-sm p-1.5 rounded-xl hover:bg-black/5 dark:hover:bg-white/5 {defaultPinnedModelIdSet.has( |
| 1052 | + model.id |
| 1053 | + ) |
| 1054 | + ? 'text-gray-900 dark:text-white' |
| 1055 | + : 'text-gray-500 dark:text-gray-400 dark:hover:text-white'}" |
| 1056 | + type="button" |
| 1057 | + aria-label={defaultPinnedModelIdSet.has(model.id) |
| 1058 | + ? $i18n.t('Remove Pinned Model') |
| 1059 | + : $i18n.t('Set as Pinned Model')} |
| 1060 | + on:click={() => { |
| 1061 | + toggleDefaultPinnedModelHandler(model); |
| 1062 | + }} |
| 1063 | + > |
| 1064 | + {#if defaultPinnedModelIdSet.has(model.id)} |
| 1065 | + <PinSlash className="size-3.5" /> |
| 1066 | + {:else} |
| 1067 | + <Pin className="size-3.5" /> |
| 1068 | + {/if} |
| 1069 | + </button> |
| 1070 | + </Tooltip> |
| 1071 | + |
| 1072 | + <Tooltip |
| 1073 | + content={isPublicModel(model) |
| 1074 | + ? $i18n.t('Make Private') |
| 1075 | + : $i18n.t('Make Public')} |
| 1076 | + > |
| 1077 | + <button |
| 1078 | + class="self-center w-fit text-sm p-1.5 rounded-xl text-gray-500 hover:bg-black/5 dark:text-gray-400 dark:hover:bg-white/5 dark:hover:text-white" |
| 1079 | + type="button" |
| 1080 | + aria-label={isPublicModel(model) |
| 1081 | + ? $i18n.t('Make Private') |
| 1082 | + : $i18n.t('Make Public')} |
| 1083 | + on:click={() => { |
| 1084 | + toggleModelPrivacyHandler(model); |
| 1085 | + }} |
| 1086 | + > |
| 1087 | + {#if isPublicModel(model)} |
| 1088 | + <LockClosed className="size-3.5" /> |
| 1089 | + {:else} |
| 1090 | + <GlobeAlt className="size-3.5" /> |
| 1091 | + {/if} |
| 1092 | + </button> |
| 1093 | + </Tooltip> |
1016 | 1094 | {/if} |
1017 | 1095 |
|
1018 | 1096 | <button |
|
0 commit comments