修复#1614 正确解析多级目录的脚本路径

This commit is contained in:
cddjr 2022-09-05 12:34:43 +08:00
parent 70571a9d34
commit 34574ce106
No known key found for this signature in database
GPG Key ID: 0D1E625DFCF77A9F

View File

@ -153,9 +153,13 @@ const CronDetailModal = ({
cmd[1] = cmd[1].replace('/ql/data/scripts/', '');
}
let [p, s] = cmd[1].split('/');
if (!s) {
s = p;
let p: string, s: string;
let index = cmd[1].lastIndexOf('/');
if (index >= 0) {
s = cmd[1].slice(index + 1);
p = cmd[1].slice(0, index);
} else {
s = cmd[1];
p = '';
}
setScriptInfo({ parent: p, filename: s });