Skip to content
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

Merged
merged 1 commit into from
Mar 15, 2022
Merged

feat: init task log #144

merged 1 commit into from
Mar 15, 2022

Conversation

hetao92
Copy link
Contributor

@hetao92 hetao92 commented Mar 14, 2022

No description provided.

@hetao92 hetao92 requested a review from huaxiabuluo March 14, 2022 03:02
"viewLogs": "View Logs",
"details": "Details",
"lines": "Lines",
"task": "import task",
Copy link
Contributor

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 ?

Comment on lines 55 to 69
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);
}
Copy link
Contributor

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);

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();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary await

}
}, []);
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();
Copy link
Contributor

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

Comment on lines +112 to +117
{modalVisible && <LogModal
logDimension={logDimension}
onCancel={() => setVisible(false)}
visible={modalVisible} />}
Copy link
Contributor

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)}
  />
)}

Comment on lines 95 to 97
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
Copy link
Contributor

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 ?

@hetao92 hetao92 force-pushed the hetao-task branch 2 times, most recently from 743a693 to e5222b1 Compare March 14, 2022 10:34
Copy link
Contributor

@huaxiabuluo huaxiabuluo left a 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
@hetao92 hetao92 merged commit 2c6f83c into vesoft-inc:v3.3.0-dev Mar 15, 2022
@hetao92 hetao92 deleted the hetao-task branch March 15, 2022 02:26
hetao92 added a commit to hetao92/nebula-studio that referenced this pull request Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants