flat:zanc

This commit is contained in:
Apcallover
2025-12-31 18:25:11 +08:00
parent 6641e07b8a
commit a2808e47ac
5 changed files with 3024 additions and 5343 deletions

7741
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -50,9 +50,9 @@
"eslint": "^8.56.0", "eslint": "^8.56.0",
"eslint-plugin-vue": "^9.20.1", "eslint-plugin-vue": "^9.20.1",
"prettier": "^3.2.4", "prettier": "^3.2.4",
"typescript": "^5.3.3", "typescript": "^5.9.3",
"vite": "^5.0.12", "vite": "^5.0.12",
"vue": "^3.4.15", "vue": "^3.4.15",
"vue-tsc": "^1.8.27" "vue-tsc": "^3.2.1"
} }
} }

View File

@@ -246,18 +246,29 @@ export function setupLiveHandlers() {
liveState.liveWindow = null; liveState.liveWindow = null;
liveState.isLiveOn = false; liveState.isLiveOn = false;
}); });
console.log(liveUrl); // if (ELECTRON_RENDERER_URL) {
// await liveState.liveWindow.loadURL(liveUrl);
// } else {
// await liveState.liveWindow.loadFile(indexHtml, { hash: "/live" });
// }
if (ELECTRON_RENDERER_URL) { if (ELECTRON_RENDERER_URL) {
let liveUrl = `${ELECTRON_RENDERER_URL}/#/live`;
if (liveState.userId) {
liveUrl += `?userId=${liveState.userId}`;
}
await liveState.liveWindow.loadURL(liveUrl); await liveState.liveWindow.loadURL(liveUrl);
} else { } else {
await liveState.liveWindow.loadFile(indexHtml, { hash: "/live" }); await liveState.liveWindow.loadFile(indexHtml, {
hash: "live",
search: `userId=${liveState.userId}`
});
} }
} }
// 等待页面加载完成 // 等待页面加载完成
async function waitForIframeVideoPlaying( async function waitForIframeVideoPlaying(
webContents: Electron.WebContents, webContents: Electron.WebContents,
timeoutMs = 20000, timeoutMs = 120000, // 2 分钟超时
) { ) {
console.log("开始检测 iframe 内视频的实际播放状态..."); console.log("开始检测 iframe 内视频的实际播放状态...");

View File

@@ -123,7 +123,7 @@
:text="modelStatus.ollamaRunning ? 'Ollama运行中' : '服务未就绪'" /> :text="modelStatus.ollamaRunning ? 'Ollama运行中' : '服务未就绪'" />
</a-space> </a-space>
<a-button type="primary" size="small" @click="loadModel" <a-button type="primary" size="small" @click="loadModel"
:loading="modelLoading">加载模型</a-button> :loading="modelLoading">加载模型{{ progreeText }}</a-button>
</a-flex> </a-flex>
<div class="file-drop-zone" @drop="handleFileDrop" @dragover.prevent <div class="file-drop-zone" @drop="handleFileDrop" @dragover.prevent
@@ -235,6 +235,7 @@ const sendMsg = ref('');
const msgList = ref([]); // 消息列表强类型 const msgList = ref([]); // 消息列表强类型
const dutyList = ref([]); const dutyList = ref([]);
let liveIsSay = ref(false); let liveIsSay = ref(false);
const progreeText = ref('');//当前进度文本
const listScrollRef = ref([]) const listScrollRef = ref([])
const listItemRefs = ref([]) const listItemRefs = ref([])
@@ -1115,6 +1116,18 @@ const lastProgressMessage = ref('');
const progressDebounceDelay = 1000; // 1秒内最多显示一次进度更新 const progressDebounceDelay = 1000; // 1秒内最多显示一次进度更新
const handleModelLoadProgress = (event, data) => { const handleModelLoadProgress = (event, data) => {
const currentStatus = data.status || '';
console.log(data)
const progressMatch = currentStatus.match(/(\d+)%/);
let percentValue = 0;
if (progressMatch) {
percentValue = parseInt(progressMatch[1], 10);
// 这里你得到了纯数字 49
progreeText.value = `(${percentValue}%)`;
console.log(`当前下载进度数值: ${percentValue}`);
}
// 清除之前的定时器 // 清除之前的定时器
if (modelProgressTimer.value) { if (modelProgressTimer.value) {
clearTimeout(modelProgressTimer.value); clearTimeout(modelProgressTimer.value);
@@ -1142,9 +1155,11 @@ const handleModelLoadProgress = (event, data) => {
// 下载进度和普通进度消息处理 // 下载进度和普通进度消息处理
if (currentMessage === lastProgressMessage.value) { if (currentMessage === lastProgressMessage.value) {
return; return;
} }
const delay = messageType === 'download' ? 200 : progressDebounceDelay; const delay = messageType === 'download' ? 200 : progressDebounceDelay;
const duration = messageType === 'download' ? 3 : 2; const duration = messageType === 'download' ? 3 : 2;

View File

@@ -190,15 +190,23 @@ onBeforeUnmount(() => {
}) })
function startLive() { function startLive() {
const paramsUserId = route.query.userId; let paramsUserId = route.query.userId;
console.log(paramsUserId)
if (!paramsUserId) {
const urlParams = new URLSearchParams(window.location.search);
paramsUserId = urlParams.get('userId');
}
if (!paramsUserId && window.location.hash.includes('?')) {
const hashQuery = window.location.hash.split('?')[1];
const searchParams = new URLSearchParams(hashQuery);
paramsUserId = searchParams.get('userId');
}
if (paramsUserId) { if (paramsUserId) {
userId.value = paramsUserId userId.value = paramsUserId;
console.log(userId.value)
// 直播数字人 正式地址
liveUrl.value = `https://dmdemo.hx.cn/dashboard.html?userId=${userId.value}`; liveUrl.value = `https://dmdemo.hx.cn/dashboard.html?userId=${userId.value}`;
// 测试地址
// liveUrl.value = "https://www.baidu.com/"
} }
} }