feat: 登录也加载异常问题处理

This commit is contained in:
duanshuwen
2025-12-19 23:12:14 +08:00
parent 4b4e955b17
commit e6fa999137
7 changed files with 295 additions and 17 deletions

4
global.d.ts vendored
View File

@@ -32,6 +32,10 @@ declare global {
params: [time: string]
return: void
}
[IPC_EVENTS.RENDERER_IS_READY]: {
params: []
return: void
}
[IPC_EVENTS.CUSTOM_EVENT]: {
params: [message: string]
return: void

View File

@@ -1,3 +1,143 @@
{
"window": {
"minimize": "Minimize",
"maximize": "Maximize",
"restore": "Restore",
"close": "Close"
},
"main": {
"welcome": {
"helloMessage": "Hello, I'm Diona"
},
"conversation": {
"placeholder": "Type a message...",
"newConversation": "New Conversation",
"selectModel": "Please select model",
"createConversation": "Create Conversation",
"searchPlaceholder": "Search conversations...",
"goSettings": "Go to",
"settings": "Settings Window",
"addModel": "to add a model",
"dialog": {
"title": "Confirm Deletion",
"content": "Are you sure you want to delete this conversation?",
"content_1": "Are you sure you want to delete the selected conversations? This action cannot be undone."
},
"operations": {
"pin": "Pin Selected",
"del": "Delete Selected",
"selectAll": "Select All",
"cancel": "Cancel"
}
},
"sidebar": {
"conversations": "Conversations",
"settings": "Settings",
"help": "Help"
},
"message": {
"dialog": {
"title": "Confirm Deletion",
"messageDelete": "Are you sure you want to delete this message?",
"batchDelete": "Are you sure you want to delete the selected messages?",
"copySuccess": "Copied successfully"
},
"batchActions": {
"deleteSelected": "Delete Selected"
},
"rendering": "Thinking...",
"stoppedGeneration": "(Stopped generating)",
"sending": "Sending",
"stopGeneration": "Stop generating",
"send": "Send"
}
},
"dialog": {
"cancel": "Cancel",
"confirm": "Confirm"
},
"settings": {
"title": "Settings",
"base": "Basic Settings",
"provider": {
"modelConfig": "Model Configuration"
},
"theme": {
"label": "Theme Settings",
"dark": "Dark Theme",
"light": "Light Theme",
"system": "System Theme",
"primaryColor": "Primary Color"
},
"appearance": {
"fontSize": "Font Size",
"fontSizeOptions": {
"10": "Tiny (10px)",
"12": "Small (12px)",
"14": "Normal (14px)",
"16": "Medium (16px)",
"18": "Large (18px)",
"20": "Larger (20px)",
"24": "Extra Large (24px)"
}
},
"behavior": {
"minimizeToTray": "Minimize to tray when closed"
},
"language": {
"label": "Language"
},
"providers": {
"defaultModel": "Default Model",
"apiKey": "API Key",
"apiUrl": "API URL"
}
},
"menu": {
"conversation": {
"newConversation": "New Conversation",
"sortBy": "Sort By",
"sortByCreateTime": "Sort by Creation Time",
"sortByUpdateTime": "Sort by Update Time",
"sortByName": "Sort by Name",
"sortByModel": "Sort by Model",
"sortAscending": "Ascending",
"sortDescending": "Descending",
"pinConversation": "Pin Conversation",
"unpinConversation": "Unpin Conversation",
"renameConversation": "Rename Conversation",
"delConversation": "Delete Conversation",
"batchOperations": "Batch Operations"
},
"message": {
"copyMessage": "Copy Message",
"deleteMessage": "Delete Message",
"selectMessage": "Select Message"
}
},
"tray": {
"tooltip": "Diona Application",
"showWindow": "Show Window",
"exit": "Exit"
},
"timeAgo": {
"justNow": "Just now",
"minutes": "{count} minutes ago",
"hours": "{count} hours ago",
"days": "{count} days ago",
"months": "{count} months ago",
"years": "{count} years ago",
"weekday": {
"sun": "Sunday",
"mon": "Monday",
"tue": "Tuesday",
"wed": "Wednesday",
"thu": "Thursday",
"fri": "Friday",
"sat": "Saturday"
}
},
"app": {
"title": "Diona Application"
}
}

View File

@@ -1,3 +1,143 @@
{
"window": {
"minimize": "最小化",
"maximize": "最大化",
"restore": "还原",
"close": "关闭"
},
"main": {
"welcome": {
"helloMessage": "你好,我是迪奥娜"
},
"conversation": {
"placeholder": "输入消息...",
"newConversation": "新对话",
"selectModel": "请选择模型",
"createConversation": "创建对话",
"searchPlaceholder": "搜索对话...",
"goSettings": "快去",
"settings": "设置窗口",
"addModel": "添加模型",
"dialog": {
"title": "确认删除",
"content": "确定要删除这个对话吗?",
"content_1": "确定要删除选中的对话吗?此操作不可撤销。"
},
"operations": {
"pin": "置顶所选",
"del": "删除所选",
"selectAll": "全选",
"cancel": "取消"
}
},
"sidebar": {
"conversations": "对话",
"settings": "设置",
"help": "帮助"
},
"message": {
"dialog": {
"title": "确认删除",
"messageDelete": "确认删除该条消息?",
"batchDelete": "确认删除选中的消息?",
"copySuccess": "复制成功"
},
"batchActions": {
"deleteSelected": "删除选中项"
},
"rendering": "思考中...",
"stoppedGeneration": "(已停止生成)",
"sending": "发送中",
"stopGeneration": "停止生成",
"send": "发送"
}
},
"dialog": {
"cancel": "取消",
"confirm": "确认"
},
"settings": {
"title": "设置",
"base": "基础设置",
"provider": {
"modelConfig": "模型配置"
},
"providers": {
"defaultModel": "默认模型",
"apiKey": "API密钥",
"apiUrl": "API地址"
},
"theme": {
"label": "主题设置",
"dark": "深色主题",
"light": "浅色主题",
"system": "跟随系统",
"primaryColor": "主题颜色"
},
"appearance": {
"fontSize": "字体大小",
"fontSizeOptions": {
"10": "极小 (10px)",
"12": "小 (12px)",
"14": "正常 (14px)",
"16": "中 (16px)",
"18": "大 (18px)",
"20": "较大 (20px)",
"24": "超大 (24px)"
}
},
"behavior": {
"minimizeToTray": "关闭时最小化到托盘"
},
"language": {
"label": "语言设置"
}
},
"menu": {
"conversation": {
"newConversation": "新建对话",
"sortBy": "排序方式",
"sortByCreateTime": "按创建时间排序",
"sortByUpdateTime": "按更新时间排序",
"sortByName": "按名称排序",
"sortByModel": "按模型排序",
"sortAscending": "递增",
"sortDescending": "递减",
"pinConversation": "置顶对话",
"unpinConversation": "取消置顶",
"renameConversation": "重命名对话",
"delConversation": "删除对话",
"batchOperations": "批量操作"
},
"message": {
"copyMessage": "复制消息",
"deleteMessage": "删除消息",
"selectMessage": "选择消息"
}
},
"tray": {
"tooltip": "迪奥娜",
"showWindow": "显示窗口",
"exit": "退出"
},
"timeAgo": {
"justNow": "刚刚",
"minutes": "{count}分钟前",
"hours": "{count}小时前",
"days": "{count}天前",
"months": "{count}个月前",
"years": "{count}年前",
"weekday": {
"sun": "星期日",
"mon": "星期一",
"tue": "星期二",
"wed": "星期三",
"thu": "星期四",
"fri": "星期五",
"sat": "星期六"
}
},
"app": {
"title": "迪奥娜"
}
}

View File

@@ -192,6 +192,7 @@ declare global {
const useFullscreen: typeof import('@vueuse/core').useFullscreen
const useGamepad: typeof import('@vueuse/core').useGamepad
const useGeolocation: typeof import('@vueuse/core').useGeolocation
const useI18n: typeof import('vue-i18n').useI18n
const useId: typeof import('vue').useId
const useIdle: typeof import('@vueuse/core').useIdle
const useImage: typeof import('@vueuse/core').useImage

View File

@@ -5,14 +5,14 @@
</div>
<div class="title-bar-controls w-[168px] flex items-center justify-end text-tx-secondary">
<native-tooltip content="最小化">
<native-tooltip :content="t('window.minimize')">
<button v-show="isMinimizable" class="flex items-center justify-center cursor-pointer w-[40px] h-[40px]"
@click="minimizeWindow">
<iconify-icon icon="material-symbols:check-indeterminate-small" color="#ffffff" :width="btnSize"
:height="btnSize" />
</button>
</native-tooltip>
<native-tooltip :content="isMaximized ? '还原' : '最大化'">
<native-tooltip :content="isMaximized ? t('window.restore') : t('window.maximize')">
<button v-show="isMaximizable" class="flex items-center justify-center cursor-pointer w-[40px] h-[40px]"
@click="maximizeWindow">
<iconify-icon icon="material-symbols:chrome-maximize-outline-sharp" color="#ffffff" :width="btnSize"
@@ -21,7 +21,7 @@
:height="btnSize" v-show="isMaximized" />
</button>
</native-tooltip>
<native-tooltip content="关闭">
<native-tooltip :content="t('window.close')">
<button v-show="isClosable" class="flex items-center justify-center cursor-pointer w-[40px] h-[40px]"
@click="handleClose">
<iconify-icon icon="material-symbols:close" color="#ffffff" :width="btnSize" :height="btnSize" />
@@ -52,7 +52,7 @@ withDefaults(defineProps<HeaderBarProps>(), {
isClosable: true,
})
const emit = defineEmits(['close']);
// const { t } = useI18n();
const { t } = useI18n();
const btnSize = 16;

View File

@@ -1,18 +1,11 @@
import { createRouter, createMemoryHistory } from "vue-router";
import Layout from '@renderer/layout/index.vue'
const routes = [
{
path: "/",
component: Layout,
children: [
{
path: "home",
component: () => import("@renderer/views/home/index.vue"),
name: "Home",
meta: { requiresAuth: true },
},
]
component: () => import("@renderer/views/login/index.vue"),
name: "Login",
meta: { requiresAuth: false },
}
];

View File

@@ -9,7 +9,7 @@ export default defineConfig(async () => {
return {
plugins: [vue(), tailwindcss(), autoImport({
imports: ['vue', 'vue-router', 'pinia', '@vueuse/core'],
imports: ['vue', 'vue-router', 'pinia', 'vue-i18n', '@vueuse/core'],
dts: 'src/renderer/auto-imports.d.ts'
})],