This repository has been archived by the owner on Oct 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
37adc19
commit 59f3f90
Showing
10 changed files
with
164 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
:local(.button) { | ||
margin: 10px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,61 @@ | ||
import React from 'react'; | ||
import { connect } from 'react-redux'; | ||
import { pushState } from 'redux-router'; | ||
|
||
import Tab from 'material-ui/lib/tabs/tab'; | ||
import Tabs from 'material-ui/lib/tabs/tabs'; | ||
|
||
import ExecuteHistoryTab from 'containers/tabs/ExecuteHistoryTab'; | ||
import ExecuteCommandTab from 'containers/tabs/ExecuteCommandTab'; | ||
import Constants from 'Constants'; | ||
import config from 'config'; | ||
|
||
import tabStyle from './Tab.less'; | ||
|
||
const TABS = ['command', 'history']; | ||
|
||
const ExecuteTab = React.createClass({ | ||
propTypes: { | ||
pushState: React.PropTypes.func.isRequired, | ||
location: React.PropTypes.object.isRequired | ||
}, | ||
|
||
render() { | ||
renderTabs() { | ||
var path = this.props.location.pathname.substring(config.APP_BASE_URL.length + 1), | ||
tabstr = path.split('/')[1], | ||
index = Math.max(0, _.findIndex(TABS, tab => tabstr.indexOf(tab.toLowerCase()) === 0)); | ||
return ( | ||
<Tabs className={tabStyle.this}> | ||
<Tab label='Execute Job' > | ||
<ExecuteCommandTab/> | ||
</Tab> | ||
<Tab label='Execution History' > | ||
<ExecuteHistoryTab/> | ||
</Tab> | ||
<Tabs initialSelectedIndex={index}> | ||
<Tab | ||
route='command' | ||
onActive={this._onActive} | ||
label='Execute Job' | ||
/> | ||
<Tab | ||
route='history' | ||
onActive={this._onActive} | ||
label='Execution History' | ||
/> | ||
</Tabs> | ||
); | ||
}, | ||
|
||
_onActive(tab) { | ||
this.props.pushState(null, Constants.URL.ROOT + 'execute/' + tab.props.route); | ||
}, | ||
|
||
render() { | ||
return ( | ||
<div className={tabStyle.this}> | ||
{this.renderTabs()} | ||
{this.props.children} | ||
</div> | ||
); | ||
} | ||
}); | ||
|
||
export default ExecuteTab; | ||
function select(state) { | ||
return { | ||
location: state.router.location | ||
}; | ||
} | ||
|
||
export default connect(select, { pushState })(ExecuteTab); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters