mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-17 17:54:32 +08:00
修改脚本详情和日志详情接口
This commit is contained in:
@@ -119,21 +119,17 @@ const CronDetailModal = ({
|
||||
};
|
||||
|
||||
const onClickItem = (item: LogItem) => {
|
||||
const url = `${config.apiPrefix}logs/${item.filename}?path=${
|
||||
const url = `${config.apiPrefix}logs/detail?file=${item.filename}&path=${
|
||||
item.directory || ''
|
||||
}`;
|
||||
localStorage.setItem('logCron', url);
|
||||
setLogUrl(url);
|
||||
request
|
||||
.get(
|
||||
`${config.apiPrefix}logs/${item.filename}?path=${item.directory || ''}`,
|
||||
)
|
||||
.then(({ code, data }) => {
|
||||
if (code === 200) {
|
||||
setLog(data);
|
||||
setIsLogModalVisible(true);
|
||||
}
|
||||
});
|
||||
request.get(url).then(({ code, data }) => {
|
||||
if (code === 200) {
|
||||
setLog(data);
|
||||
setIsLogModalVisible(true);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const onTabChange = (key: string) => {
|
||||
@@ -159,7 +155,7 @@ const CronDetailModal = ({
|
||||
const [s, p] = result;
|
||||
setScriptInfo({ parent: p, filename: s });
|
||||
request
|
||||
.get(`${config.apiPrefix}scripts/${s}?path=${p || ''}`)
|
||||
.get(`${config.apiPrefix}scripts/detail?file=${s}&path=${p || ''}`)
|
||||
.then(({ code, data }) => {
|
||||
if (code === 200) {
|
||||
setValue(data);
|
||||
|
||||
@@ -55,7 +55,11 @@ const Log = () => {
|
||||
|
||||
const getLog = (node: any) => {
|
||||
request
|
||||
.get(`${config.apiPrefix}logs/${node.title}?path=${node.parent || ''}`)
|
||||
.get(
|
||||
`${config.apiPrefix}logs/detail?file=${node.title}&path=${
|
||||
node.parent || ''
|
||||
}`,
|
||||
)
|
||||
.then(({ code, data }) => {
|
||||
if (code === 200) {
|
||||
setValue(data);
|
||||
|
||||
@@ -67,7 +67,11 @@ const EditModal = ({
|
||||
|
||||
const getDetail = (node: any) => {
|
||||
request
|
||||
.get(`${config.apiPrefix}scripts/${node.title}?path=${node.parent || ''}`)
|
||||
.get(
|
||||
`${config.apiPrefix}scripts/detail?file=${node.title}&path=${
|
||||
node.parent || ''
|
||||
}`,
|
||||
)
|
||||
.then(({ code, data }) => {
|
||||
if (code === 200) {
|
||||
setValue(data);
|
||||
|
||||
@@ -84,9 +84,9 @@ const Script = () => {
|
||||
const getDetail = (node: any) => {
|
||||
request
|
||||
.get(
|
||||
`${config.apiPrefix}scripts/${encodeURIComponent(node.title)}?path=${
|
||||
node.parent || ''
|
||||
}`,
|
||||
`${config.apiPrefix}scripts/detail?file=${encodeURIComponent(
|
||||
node.title,
|
||||
)}&path=${node.parent || ''}`,
|
||||
)
|
||||
.then(({ code, data }) => {
|
||||
if (code === 200) {
|
||||
|
||||
Reference in New Issue
Block a user