mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-25 16:36:07 +08:00
修复任务详情日志访问,修复新建订阅粘贴repo命令
This commit is contained in:
parent
9e8febfc11
commit
aa110d4187
|
@ -31,7 +31,7 @@ export default (app: Router) => {
|
||||||
try {
|
try {
|
||||||
const filePath = join(
|
const filePath = join(
|
||||||
config.logPath,
|
config.logPath,
|
||||||
req.query.path as string,
|
(req.query.path || '') as string,
|
||||||
req.params.file,
|
req.params.file,
|
||||||
);
|
);
|
||||||
const content = getFileContentByName(filePath);
|
const content = getFileContentByName(filePath);
|
||||||
|
|
|
@ -181,8 +181,9 @@ export default class SubscriptionService {
|
||||||
if (doc.sub_before) {
|
if (doc.sub_before) {
|
||||||
beforeStr = execSync(doc.sub_before).toString();
|
beforeStr = execSync(doc.sub_before).toString();
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error: any) {
|
||||||
beforeStr = JSON.stringify(error);
|
beforeStr =
|
||||||
|
(error.stderr && error.stderr.toString()) || JSON.stringify(error);
|
||||||
}
|
}
|
||||||
if (beforeStr) {
|
if (beforeStr) {
|
||||||
beforeStr += '\n';
|
beforeStr += '\n';
|
||||||
|
@ -225,8 +226,9 @@ export default class SubscriptionService {
|
||||||
if (sub.sub_after) {
|
if (sub.sub_after) {
|
||||||
afterStr = execSync(sub.sub_after).toString();
|
afterStr = execSync(sub.sub_after).toString();
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error: any) {
|
||||||
afterStr = JSON.stringify(error);
|
afterStr =
|
||||||
|
(error.stderr && error.stderr.toString()) || JSON.stringify(error);
|
||||||
}
|
}
|
||||||
if (afterStr) {
|
if (afterStr) {
|
||||||
afterStr = `\n\n${afterStr}`;
|
afterStr = `\n\n${afterStr}`;
|
||||||
|
|
|
@ -115,9 +115,13 @@ const CronDetailModal = ({
|
||||||
|
|
||||||
const onClickItem = (item: LogItem) => {
|
const onClickItem = (item: LogItem) => {
|
||||||
localStorage.setItem('logCron', currentCron.id);
|
localStorage.setItem('logCron', currentCron.id);
|
||||||
setLogUrl(`${config.apiPrefix}logs/${item.directory}/${item.filename}`);
|
setLogUrl(
|
||||||
|
`${config.apiPrefix}logs/${item.filename}?path=${item.directory || ''}`,
|
||||||
|
);
|
||||||
request
|
request
|
||||||
.get(`${config.apiPrefix}logs/${item.directory}/${item.filename}`)
|
.get(
|
||||||
|
`${config.apiPrefix}logs/${item.filename}?path=${item.directory || ''}`,
|
||||||
|
)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
setLog(data.data);
|
setLog(data.data);
|
||||||
setIsLogModalVisible(true);
|
setIsLogModalVisible(true);
|
||||||
|
|
|
@ -195,7 +195,9 @@ const SubscriptionModal = ({
|
||||||
dependences,
|
dependences,
|
||||||
branch,
|
branch,
|
||||||
extensions,
|
extensions,
|
||||||
] = text.split(' ').map((x) => x.trim());
|
] = text
|
||||||
|
.split(' ')
|
||||||
|
.map((x) => x.trim().replace(/\"/g, '').replace(/\'/, ''));
|
||||||
form.setFieldsValue({
|
form.setFieldsValue({
|
||||||
type:
|
type:
|
||||||
type === 'raw'
|
type === 'raw'
|
||||||
|
@ -210,6 +212,7 @@ const SubscriptionModal = ({
|
||||||
branch,
|
branch,
|
||||||
extensions,
|
extensions,
|
||||||
});
|
});
|
||||||
|
form.validateFields(['url']);
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user