fix(web): respect base path for icon assets (#2192)
This commit is contained in:
1 parent
c6719eec55
commit
9d97197a61
3 files changed
+7
-3
No files matched your search
@@ -3,6 +3,7 @@ import { computed, ref, watch } from "vue";
|
||||
import { Settings2 } from "@lucide/vue";
|
||||
import type { AiProvider } from "@/stores/settingsStore";
|
||||
import { useTheme } from "@/composables/useTheme";
|
||||
import { webPath } from "@/lib/webPath";
|
||||
|
||||
const props = defineProps<{
|
||||
provider: AiProvider;
|
||||
@@ -22,8 +23,8 @@ watch(
|
||||
|
||||
const usesWhiteDarkIcon = computed(() => props.provider === "claude" || props.provider === "ollama" || props.provider === "openai" || props.provider === "openai-compatible");
|
||||
const localIconUrl = computed(() => {
|
||||
if (props.provider === "openai-compatible") return "/icons/ai/openai.svg";
|
||||
return props.iconSlug ? `/icons/ai/${props.iconSlug}.svg` : "";
|
||||
if (props.provider === "openai-compatible") return webPath("/icons/ai/openai.svg");
|
||||
return props.iconSlug ? webPath(`/icons/ai/${props.iconSlug}.svg`) : "";
|
||||
});
|
||||
const fallbackText = computed(() => {
|
||||
if (props.provider === "openai-compatible") return "OC";
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
import { Database } from "@lucide/vue";
|
||||
import { webPath } from "@/lib/webPath";
|
||||
|
||||
const props = defineProps<{
|
||||
dbType: string;
|
||||
@@ -97,7 +98,7 @@ const normalizedType = computed(() => props.dbType.toLowerCase().replace(/[\s-]+
|
||||
const assetName = computed(() => assetIcons[normalizedType.value]);
|
||||
const assetSrc = computed(() => {
|
||||
if (!assetName.value) return "";
|
||||
return assetName.value.includes(".") ? `/icons/database/${assetName.value}` : `/icons/database/${assetName.value}.svg`;
|
||||
return webPath(assetName.value.includes(".") ? `/icons/database/${assetName.value}` : `/icons/database/${assetName.value}.svg`);
|
||||
});
|
||||
const letter = computed(() => letterIcons[normalizedType.value]);
|
||||
</script>
|
||||
|
||||
Reference in new issue
Block a user