flat:zanc
This commit is contained in:
7741
package-lock.json
generated
7741
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -50,9 +50,9 @@
|
||||
"eslint": "^8.56.0",
|
||||
"eslint-plugin-vue": "^9.20.1",
|
||||
"prettier": "^3.2.4",
|
||||
"typescript": "^5.3.3",
|
||||
"typescript": "^5.9.3",
|
||||
"vite": "^5.0.12",
|
||||
"vue": "^3.4.15",
|
||||
"vue-tsc": "^1.8.27"
|
||||
"vue-tsc": "^3.2.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,18 +246,29 @@ export function setupLiveHandlers() {
|
||||
liveState.liveWindow = null;
|
||||
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) {
|
||||
let liveUrl = `${ELECTRON_RENDERER_URL}/#/live`;
|
||||
if (liveState.userId) {
|
||||
liveUrl += `?userId=${liveState.userId}`;
|
||||
}
|
||||
await liveState.liveWindow.loadURL(liveUrl);
|
||||
} else {
|
||||
await liveState.liveWindow.loadFile(indexHtml, { hash: "/live" });
|
||||
await liveState.liveWindow.loadFile(indexHtml, {
|
||||
hash: "live",
|
||||
search: `userId=${liveState.userId}`
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 等待页面加载完成
|
||||
async function waitForIframeVideoPlaying(
|
||||
webContents: Electron.WebContents,
|
||||
timeoutMs = 20000,
|
||||
timeoutMs = 120000, // 2 分钟超时
|
||||
) {
|
||||
console.log("开始检测 iframe 内视频的实际播放状态...");
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
:text="modelStatus.ollamaRunning ? 'Ollama运行中' : '服务未就绪'" />
|
||||
</a-space>
|
||||
<a-button type="primary" size="small" @click="loadModel"
|
||||
:loading="modelLoading">加载模型</a-button>
|
||||
:loading="modelLoading">加载模型{{ progreeText }}</a-button>
|
||||
</a-flex>
|
||||
|
||||
<div class="file-drop-zone" @drop="handleFileDrop" @dragover.prevent
|
||||
@@ -235,6 +235,7 @@ const sendMsg = ref('');
|
||||
const msgList = ref([]); // 消息列表强类型
|
||||
const dutyList = ref([]);
|
||||
let liveIsSay = ref(false);
|
||||
const progreeText = ref('');//当前进度文本
|
||||
|
||||
const listScrollRef = ref([])
|
||||
const listItemRefs = ref([])
|
||||
@@ -1115,6 +1116,18 @@ const lastProgressMessage = ref('');
|
||||
const progressDebounceDelay = 1000; // 1秒内最多显示一次进度更新
|
||||
|
||||
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) {
|
||||
clearTimeout(modelProgressTimer.value);
|
||||
@@ -1142,9 +1155,11 @@ const handleModelLoadProgress = (event, data) => {
|
||||
|
||||
// 下载进度和普通进度消息处理
|
||||
if (currentMessage === lastProgressMessage.value) {
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
const delay = messageType === 'download' ? 200 : progressDebounceDelay;
|
||||
const duration = messageType === 'download' ? 3 : 2;
|
||||
|
||||
|
||||
@@ -190,15 +190,23 @@ onBeforeUnmount(() => {
|
||||
})
|
||||
|
||||
function startLive() {
|
||||
const paramsUserId = route.query.userId;
|
||||
console.log(paramsUserId)
|
||||
let paramsUserId = route.query.userId;
|
||||
|
||||
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) {
|
||||
userId.value = paramsUserId
|
||||
console.log(userId.value)
|
||||
// 直播数字人 正式地址
|
||||
userId.value = paramsUserId;
|
||||
liveUrl.value = `https://dmdemo.hx.cn/dashboard.html?userId=${userId.value}`;
|
||||
// 测试地址
|
||||
// liveUrl.value = "https://www.baidu.com/"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user