Skip to content

Commit

Permalink
feat: update image url
Browse files Browse the repository at this point in the history
  • Loading branch information
liou666 committed Apr 2, 2023
1 parent 8ef806d commit 1b9a933
Show file tree
Hide file tree
Showing 16 changed files with 15 additions and 13 deletions.
1 change: 0 additions & 1 deletion public/node.svg

This file was deleted.

1 change: 0 additions & 1 deletion public/vite.svg

This file was deleted.

File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
4 changes: 2 additions & 2 deletions src/components/Content.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import Button from '@/components/widgets/Button.vue'
import { generateText } from '@/server/api'
import { getOpenAzureKey, getOpenAzureRegion, getOpenKey, getOpenProxy, verifyOpenKey } from '@/utils'
import { getAvatarUrl, getOpenAzureKey, getOpenAzureRegion, getOpenKey, getOpenProxy, verifyOpenKey } from '@/utils'
import { useConversationStore } from '@/stores'
// hooks
Expand Down Expand Up @@ -102,7 +102,7 @@ const translate = (text: string) => {
center-y odd:flex-row-reverse
>
<div class="w-10">
<img w-full rounded-full :src="item.role === 'user' ? '/avatars/self.png' : store.currentAvatar" alt="">
<img w-full rounded-full :src="item.role === 'user' ? getAvatarUrl('self.png') : store.currentAvatar" alt="">
</div>

<div style="flex-basis:fit-content" mx-2>
Expand Down
8 changes: 4 additions & 4 deletions src/components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { shell } from 'electron'
<template>
<header class="bg-#fff dark:bg-#1f262a">
<h3 center-y text-2xl>
<!-- <img src="" alt=""> -->
<div m-2>
🤖️
<div w-10 m-1 mt-2>
<!-- 🤖️ -->
<img w-full src="/favicon.ico" alt="">
</div>
<span class="text-gradient ">Polyglot</span>
<span select-none class="text-gradient ">Polyglot</span>
</h3>
<div class="center-y" @click="shell.openExternal('https://github.com/liou666')">
<i w-6 h-6 icon-btn i-carbon:logo-github />
Expand Down
10 changes: 5 additions & 5 deletions src/stores/index.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { generatePrompt } from '@/utils'
import { generatePrompt, getAvatarUrl } from '@/utils'
const defaultConversations = [{
key: 'Jenny',
desc: '美国',
language: 'en-US',
voice: 'en-US-JennyMultilingualNeural',
avatar: '/avatars/en.jpg',
avatar: getAvatarUrl('en.jpg'),
chatMessages: [{
role: 'system',
content: generatePrompt('English'),
}],
}, {
key: '碧衣',
desc: '日本',
avatar: '/avatars/jp1.webp',
avatar: getAvatarUrl('jp1.webp'),
language: 'ja-JP',
voice: 'ja-JP-AoiNeural',
chatMessages: [{
Expand All @@ -22,7 +22,7 @@ const defaultConversations = [{
}, {
key: '선히',
desc: '韩国',
avatar: '/avatars/ko1.jpeg',
avatar: getAvatarUrl('ko1.jpeg'),
language: 'ko-KR',
voice: 'ko-KR-SunHiNeural',
chatMessages: [{
Expand All @@ -33,7 +33,7 @@ const defaultConversations = [{
{
key: 'Brigitte',
desc: '法国',
avatar: '/avatars/fr.webp',
avatar: getAvatarUrl('fr.webp'),
language: 'fr-FR',
voice: 'fr-FR-BrigitteNeural',
chatMessages: [{
Expand Down
1 change: 1 addition & 0 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * from './openAi'
export * from './speaker'
export * from './getKey'
export * from './tools'

3 changes: 3 additions & 0 deletions src/utils/tools.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const getAvatarUrl = (filename: string) => {
return new URL(`../assets/avatars/${filename}`, import.meta.url).href
}

0 comments on commit 1b9a933

Please sign in to comment.