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

fix task direct link to logs #1467

Merged
merged 3 commits into from Mar 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions SingularityUI/app/components/taskDetail/TaskLatestLog.jsx
Expand Up @@ -7,11 +7,11 @@ import Section from '../common/Section';

function TaskLatestLog (props) {
const link = props.isStillRunning ? (
<Link to={`task/${props.taskId}/tail/${Utils.substituteTaskId(config.runningTaskLogPath, props.taskId)}`} title="Log">
<Link to={Utils.tailerPath(props.taskId, config.runningTaskLogPath)} title="Log">
<span><Glyphicon glyph="file" /> {Utils.fileName(config.runningTaskLogPath)}</span>
</Link>
) : (
<Link to={`task/${props.taskId}/tail/${Utils.substituteTaskId(config.finishedTaskLogPath, props.taskId)}`} title="Log">
<Link to={Utils.tailerPath(props.taskId, config.finishedTaskLogPath)} title="Log">
<span><Glyphicon glyph="file" /> {Utils.fileName(config.finishedTaskLogPath)}</span>
</Link>
);
Expand Down
5 changes: 1 addition & 4 deletions SingularityUI/app/components/tasks/Columns.jsx
Expand Up @@ -361,10 +361,7 @@ export const LogLinkAndJSON = logPath => (
cellRender={(taskId, rowData) => (
<div className="hidden-xs">
<OverlayTrigger placement="top" id="view-log-overlay" overlay={logTooltip}>
<Link
to={`request/${taskId.requestId}/tail/${logPath}?taskIds=${taskId.id}`}
title="Log"
>
<Link to={Utils.tailerPath(taskId.id, logPath)} title="Log">
<Glyphicon glyph="file" />
</Link>
</OverlayTrigger>
Expand Down
4 changes: 4 additions & 0 deletions SingularityUI/app/utils.es6
Expand Up @@ -73,6 +73,10 @@ const Utils = {
return moment.duration(millis).humanize();
},

tailerPath(taskId, logpath) {
return `task/${taskId}/tail/${Utils.substituteTaskId(logpath, taskId)}`;
},

substituteTaskId(value, taskId) {
return value.replace('$TASK_ID', taskId);
},
Expand Down