|
|
@@ -29,7 +29,6 @@ import LastRunStatusSelector from "./LastRunStatusSelector";
|
|
|
import loadable from "@loadable/component";
|
|
|
import Loading from "components/Loading";
|
|
|
import JobRunTable from "./chart/JobRunTable";
|
|
|
-import TabSelector from "components/TabSelector";
|
|
|
import TagFilter from "./TagFilter";
|
|
|
|
|
|
// @ts-ignore
|
|
|
@@ -221,30 +220,7 @@ class ClusterDashboard extends Component<PropsType, StateType> {
|
|
|
|
|
|
return (
|
|
|
<>
|
|
|
- <TabSelector
|
|
|
- currentTab={this.state.showRuns ? "job_runs" : "chart_list"}
|
|
|
- options={[
|
|
|
- { label: "Jobs", value: "chart_list" },
|
|
|
- { label: "Runs", value: "job_runs" },
|
|
|
- ]}
|
|
|
- setCurrentTab={(value) => {
|
|
|
- if (value === "job_runs") {
|
|
|
- this.setState({ showRuns: true });
|
|
|
- } else {
|
|
|
- this.setState({ showRuns: false });
|
|
|
- }
|
|
|
- }}
|
|
|
- />
|
|
|
<ControlRow style={{ marginTop: "35px" }}>
|
|
|
- {isAuthorizedToAdd && (
|
|
|
- <Button
|
|
|
- onClick={() =>
|
|
|
- pushFiltered(this.props, "/launch", ["project_id"])
|
|
|
- }
|
|
|
- >
|
|
|
- <i className="material-icons">add</i> Launch template
|
|
|
- </Button>
|
|
|
- )}
|
|
|
<FilterWrapper>
|
|
|
<LastRunStatusSelector
|
|
|
lastRunStatus={this.state.lastRunStatus}
|
|
|
@@ -254,6 +230,32 @@ class ClusterDashboard extends Component<PropsType, StateType> {
|
|
|
/>
|
|
|
{this.renderCommonFilters()}
|
|
|
</FilterWrapper>
|
|
|
+ <Flex>
|
|
|
+ <ToggleButton>
|
|
|
+ <ToggleOption
|
|
|
+ onClick={() => this.setState({ showRuns: false})}
|
|
|
+ selected={!this.state.showRuns}
|
|
|
+ >
|
|
|
+ Jobs
|
|
|
+ </ToggleOption>
|
|
|
+ <ToggleOption
|
|
|
+ nudgeLeft
|
|
|
+ onClick={() => this.setState({ showRuns: true })}
|
|
|
+ selected={this.state.showRuns}
|
|
|
+ >
|
|
|
+ Runs
|
|
|
+ </ToggleOption>
|
|
|
+ </ToggleButton>
|
|
|
+ {isAuthorizedToAdd && (
|
|
|
+ <Button
|
|
|
+ onClick={() =>
|
|
|
+ pushFiltered(this.props, "/launch", ["project_id"])
|
|
|
+ }
|
|
|
+ >
|
|
|
+ <i className="material-icons">add</i> Launch template
|
|
|
+ </Button>
|
|
|
+ )}
|
|
|
+ </Flex>
|
|
|
</ControlRow>
|
|
|
<HidableElement show={this.state.showRuns}>
|
|
|
<JobRunTable
|
|
|
@@ -346,6 +348,31 @@ ClusterDashboard.contextType = Context;
|
|
|
|
|
|
export default withRouter(withAuth(ClusterDashboard));
|
|
|
|
|
|
+const ToggleOption = styled.div<{ selected: boolean, nudgeLeft?: boolean }>`
|
|
|
+ padding: 0 10px;
|
|
|
+ color: ${props => props.selected ? "" : "#494b4f"};
|
|
|
+ border: 1px solid #494b4f;
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ margin-left: ${props => props.nudgeLeft ? "-1px" : ""};
|
|
|
+ align-items: center;
|
|
|
+ border-radius: ${props => props.nudgeLeft ? "0 5px 5px 0" : "5px 0 0 5px"};
|
|
|
+ :hover {
|
|
|
+ border: 1px solid #7a7b80;
|
|
|
+ z-index: 999;
|
|
|
+ }
|
|
|
+`;
|
|
|
+
|
|
|
+const ToggleButton = styled.div`
|
|
|
+ background: #26292e;
|
|
|
+ border-radius: 5px;
|
|
|
+ font-size: 13px;
|
|
|
+ height: 30px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ cursor: pointer;
|
|
|
+`;
|
|
|
+
|
|
|
const HidableElement = styled.div<{ show: boolean }>`
|
|
|
display: ${(props) => (props.show ? "unset" : "none")};
|
|
|
`;
|
|
|
@@ -367,11 +394,13 @@ const Button = styled.div`
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
align-items: center;
|
|
|
+ margin-left: 10px;
|
|
|
justify-content: space-between;
|
|
|
font-size: 13px;
|
|
|
cursor: pointer;
|
|
|
font-family: "Work Sans", sans-serif;
|
|
|
border-radius: 5px;
|
|
|
+ font-weight: 500;
|
|
|
color: white;
|
|
|
height: 30px;
|
|
|
padding: 0 8px;
|