mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-28 02:16:07 +08:00
脚本管理按文件类型排序
This commit is contained in:
parent
70727d0e26
commit
93c69826ad
|
@ -278,6 +278,11 @@ export async function concurrentRun(
|
||||||
return replyList;
|
return replyList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum FileType {
|
||||||
|
'directory',
|
||||||
|
'file',
|
||||||
|
}
|
||||||
|
|
||||||
export function readDirs(
|
export function readDirs(
|
||||||
dir: string,
|
dir: string,
|
||||||
baseDir: string = '',
|
baseDir: string = '',
|
||||||
|
@ -298,7 +303,10 @@ export function readDirs(
|
||||||
type: 'directory',
|
type: 'directory',
|
||||||
disabled: true,
|
disabled: true,
|
||||||
parent: relativePath,
|
parent: relativePath,
|
||||||
children: readDirs(subPath, baseDir),
|
children: readDirs(subPath, baseDir).sort(
|
||||||
|
(a: any, b: any) =>
|
||||||
|
(FileType as any)[a.type] - (FileType as any)[b.type],
|
||||||
|
),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
|
@ -308,7 +316,9 @@ export function readDirs(
|
||||||
parent: relativePath,
|
parent: relativePath,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
return result;
|
return result.sort(
|
||||||
|
(a: any, b: any) => (FileType as any)[a.type] - (FileType as any)[b.type],
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function readDir(
|
export function readDir(
|
||||||
|
|
|
@ -154,7 +154,7 @@ update_cron() {
|
||||||
code=$(echo $api | jq -r .code)
|
code=$(echo $api | jq -r .code)
|
||||||
message=$(echo $api | jq -r .message)
|
message=$(echo $api | jq -r .message)
|
||||||
if [[ $code != 200 ]]; then
|
if [[ $code != 200 ]]; then
|
||||||
echo -e "\n## 更新任务状态失败(${message})\n" >> $log_path
|
echo -e "\n## 更新任务状态失败(${message})\n" >> $dir_log/$log_path
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user