feat: 页面显示优化

This commit is contained in:
ZhaoLei 2024-11-16 10:54:04 +08:00
parent 2ffe3c4373
commit 154df8b5cc
2 changed files with 17 additions and 5 deletions

View file

@ -96,7 +96,7 @@ function getOpEmoj(Op) {
case 2: case 2:
return "❌"; return "❌";
default: default:
return "🚀"; return "📁";
} }
} }
function publishCB(MsgIt) { function publishCB(MsgIt) {
@ -105,14 +105,26 @@ function publishCB(MsgIt) {
Msgs.value[Msgs.value.length - 1] = MsgIt Msgs.value[Msgs.value.length - 1] = MsgIt
} else if (MsgIt.Type == 3) { } else if (MsgIt.Type == 3) {
var it = JSON.parse(MsgIt.Body); var it = JSON.parse(MsgIt.Body);
it.Children.forEach((e) => { /**
* This function appears to be intended for processing children elements, though the current implementation is incomplete.
*
* @param {Array} children - The array of child elements to be processed.
* @returns {void}
*/
const f = (item) => {
Msgs.value.push({ Msgs.value.push({
Step: MsgIt.Step, Step: MsgIt.Step,
Type: MsgIt.Type, Type: MsgIt.Type,
Body: `[${getOpEmoj(e.NextOp)}] ${e.FormatedPath}` Body: `[${getOpEmoj(item.NextOp)}] ${item.FormatedPath}`
}) })
if (item.Children) {
item.Children.forEach((e) => {
f(e)
}); });
}
}
f(it)
} }
else { else {
Msgs.value.push(MsgIt) Msgs.value.push(MsgIt)

View file

@ -7,7 +7,7 @@ class ConnectPipe {
} }
OpenPipe(config, MsgCb) { OpenPipe(config, MsgCb) {
var webSocUrl = `ws://${window.location.host}/websoc?Name=${config.Name}` var webSocUrl = `ws://${window.location.host}/websoc?Name=${config.Name}`
// var webSocUrl = "ws://127.0.0.1:6818/websoc?Name=Test"; // var webSocUrl = `ws://127.0.0.1:6818/websoc?Name=${config.Name}`;
this.#websocket = new WebSocket(webSocUrl); this.#websocket = new WebSocket(webSocUrl);
this.#websocket.onopen = (event) => { this.#websocket.onopen = (event) => {
var starter = { var starter = {