-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: init task log #144
feat: init task log #144
Conversation
"viewLogs": "View Logs", | ||
"details": "Details", | ||
"lines": "Lines", | ||
"task": "import task", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import Task
or import task
?
if(currentLog!.name === 'import.log') { | ||
const res = await getImportLogDetail({ | ||
offset: offset.current, | ||
taskId: id, | ||
path: currentLog!.path | ||
}); | ||
handleLogData(res); | ||
} else { | ||
const res = await getErrLogDetail({ | ||
offset: offset.current, | ||
taskId: id, | ||
path: currentLog!.path | ||
}); | ||
handleLogData(res); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const getLogDetail = currentLog!.name === 'import.log' ? getImportLogDetail : getErrLogDetail;
const res = await getLogDetail({
offset: offset.current,
taskId: id,
path: currentLog!.path
});
handleLogData(res);
app/pages/Import/TaskList/index.tsx
Outdated
const handleTaskStop = useCallback(async(id: number) => { | ||
clearTimeout(timer.current); | ||
const { code } = await stopTask(id); | ||
if(code === 0) { | ||
message.success(intl.get('import.stopImportingSuccess')); | ||
await asyncGetTaskList(); | ||
await getTaskList(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary await
app/pages/Import/TaskList/index.tsx
Outdated
} | ||
}, []); | ||
const handleTaskDelete = useCallback(async(id: number) => { | ||
clearTimeout(timer.current); | ||
const { code } = await deleteTask(id); | ||
if(code === 0) { | ||
message.success(intl.get('import.deleteSuccess')); | ||
await asyncGetTaskList(); | ||
await getTaskList(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
last line of a function, unnecessary await
{modalVisible && <LogModal | ||
logDimension={logDimension} | ||
onCancel={() => setVisible(false)} | ||
visible={modalVisible} />} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
be equal
{modalVisible && (
<LogModal
visible
logDimension={logDimension}
onCancel={() => setVisible(false)}
/>
)}
app/stores/import.ts
Outdated
document.body.appendChild(link); | ||
link.click(); | ||
document.body.removeChild(link); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just link.click()
also woks ?
743a693
to
e5222b1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
feat: add log read mod: change key mod: code review mod: add template import mod: code review
No description provided.