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

Add links between tailer versions #1466

Merged
merged 1 commit 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
15 changes: 15 additions & 0 deletions SingularityUI/app/components/logs/Header.jsx
Expand Up @@ -40,6 +40,20 @@ class Header extends React.Component {
);
}

renderSwitchToNewTailer() {
if (!this.props.taskGroupHasMultipleTasks) {
if ((this.props.taskGroupCount === 1)) {
return (<Link to={`/task/${this.props.firstTaskId}/tail/${this.props.path}`}>
<button type="button" className="btn btn-sm btn-default">Switch to new tailer</button>
</Link>);
} else if ((this.props.taskGroupCount > 1)) {
return (<Link to={`/request/${this.props.requestId}/tail/${this.props.path}`}>
<button type="button" className="btn btn-sm btn-default">Switch to new tailer</button>
</Link>);
}
}
}

render() {
return (
<div className="tail-header">
Expand All @@ -60,6 +74,7 @@ class Header extends React.Component {
</ul>
</div>
<div className="col-md-3 hidden-xs tail-buttons">
{this.renderSwitchToNewTailer()}
<SearchDropdown />
<TasksDropdown />
<ColorDropdown />
Expand Down
13 changes: 13 additions & 0 deletions SingularityUI/app/components/logs/NewHeader.jsx
Expand Up @@ -61,6 +61,18 @@ class NewHeader extends React.Component {
}
}

renderSwitchToOldTailer() {
if ((this.props.tailerGroupCount === 1)) {
return (<Link to={`/task/${this.props.taskIds[0]}/old-tail/${this.props.paths[0]}`}>
<button type="button" className="btn btn-sm btn-default">Back to old tailer</button>
</Link>);
} else if ((this.props.tailerGroupCount > 1)) {
return (<Link to={`/request/${this.props.requestIds[0]}/old-tail/${this.props.paths[0]}`}>
<button type="button" className="btn btn-sm btn-default">Back to old tailer</button>
</Link>);
}
}

render() {
if (!this.props.ready) {
return (<div>Loading...</div>);
Expand All @@ -80,6 +92,7 @@ class NewHeader extends React.Component {
</ul>
</div>
<div className="col-md-3 hidden-xs tail-buttons">
{this.renderSwitchToOldTailer()}
{this.renderTasksDropdown()}
<NewColorDropdown activeColor={this.props.activeColor} onSetColor={this.props.setColor} />
{this.renderAnchorButtons()}
Expand Down
2 changes: 1 addition & 1 deletion SingularityUI/app/rootComponent.jsx
Expand Up @@ -76,7 +76,7 @@ const rootComponent = (Wrapped, refresh = null, refreshInterval = true, pageMarg
}

componentDidMount() {
const onLoadPromise = onLoad(this.props);
const onLoadPromise = this.dispatchOnLoad();
if (onLoadPromise) {
onLoadPromise.catch((reason) => setTimeout(() => { throw new Error(reason); }));
}
Expand Down
3 changes: 3 additions & 0 deletions SingularityUI/app/router.jsx
Expand Up @@ -26,6 +26,7 @@ import Disasters from './components/disasters/Disasters';
import TaskLogTailerContainer from './containers/TaskLogTailerContainer';
import RequestLogTailerContainer from './containers/RequestLogTailerContainer';
import CustomLogTailerContainer from './containers/CustomLogTailerContainer';
import { Tail, AggregateTail } from './components/logs/Tail';

const getFilenameFromSplat = (splat) => _.last(splat.split('/'));

Expand All @@ -42,13 +43,15 @@ const routes = (
<Route path=":requestId/task-search" component={TaskSearch} title="Task Search" />
<Route path=":requestId/deploy" component={NewDeployForm} title="New Deploy" />
<Route path=":requestId/deploy/:deployId" component={DeployDetail} title={(params) => `Deploy ${params.deployId}`} />
<Route path=":requestId/old-tail/**" component={AggregateTail} title={(params) => `Tail of ${getFilenameFromSplat(params.splat)}`} />
<Route path=":requestId/tail/**" component={RequestLogTailerContainer} title={(params) => `Tail of ${getFilenameFromSplat(params.splat)}`} />
<Route path=":requestId/instance/:instanceNo" component={TaskInstanceRedirect} />
<IndexRoute component={NotFound} title="Not Found" />
</Route>
<Route path="tasks(/:state)(/:requestsSubFilter)(/:searchFilter)" component={TasksPage} title="Tasks" />
<Route path="task">
<Route path=":taskId(/files**)" component={TaskDetail} title={(params) => params.taskId} />
<Route path=":taskId/old-tail/**" component={Tail} title={(params) => `Tail of ${getFilenameFromSplat(params.splat)}`} />
<Route path=":taskId/tail/**" component={TaskLogTailerContainer} title={(params) => `Tail of ${getFilenameFromSplat(params.splat)}`} />
<IndexRoute component={NotFound} title="Not Found" />
</Route>
Expand Down