mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-17 09:34:31 +08:00
修复脚本管理跳转逻辑
This commit is contained in:
+26
-3
@@ -152,9 +152,9 @@ export default function browserType() {
|
||||
shell === 'none'
|
||||
? {}
|
||||
: {
|
||||
shell, // wechat qq uc 360 2345 sougou liebao maxthon
|
||||
shellVs,
|
||||
},
|
||||
shell, // wechat qq uc 360 2345 sougou liebao maxthon
|
||||
shellVs,
|
||||
},
|
||||
);
|
||||
|
||||
console.log(
|
||||
@@ -272,6 +272,29 @@ export function depthFirstSearch<
|
||||
return c;
|
||||
}
|
||||
|
||||
export function findNode<T extends Record<string, any> & { children?: T[] }>(
|
||||
children: T[],
|
||||
condition: (column: T) => boolean,
|
||||
) {
|
||||
const c = [...children];
|
||||
|
||||
let item;
|
||||
function find(cls: T[] | undefined): T | undefined {
|
||||
if (!cls) return;
|
||||
for (let i = 0; i < cls?.length; i++) {
|
||||
if (condition(cls[i])) {
|
||||
item = cls[i];
|
||||
} else if (cls[i].children) {
|
||||
find(cls[i].children);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
find(c);
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
export function logEnded(log: string): boolean {
|
||||
const endTips = [LOG_END_SYMBOL, '执行结束'];
|
||||
return endTips.some((x) => log.includes(x));
|
||||
|
||||
Reference in New Issue
Block a user