|
|
@@ -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
|
|
|
@@ -149,11 +148,6 @@ class ClusterDashboard extends Component<PropsType, StateType> {
|
|
|
|
|
|
return (
|
|
|
<>
|
|
|
- <TagFilter
|
|
|
- onSelect={(newSelectedTag) =>
|
|
|
- this.setState({ selectedTag: newSelectedTag })
|
|
|
- }
|
|
|
- />
|
|
|
<NamespaceSelector
|
|
|
setNamespace={(namespace) =>
|
|
|
this.setState({ namespace }, () => {
|
|
|
@@ -165,10 +159,10 @@ class ClusterDashboard extends Component<PropsType, StateType> {
|
|
|
}
|
|
|
namespace={this.state.namespace}
|
|
|
/>
|
|
|
- <SortSelector
|
|
|
- setSortType={(sortType) => this.setState({ sortType })}
|
|
|
- sortType={this.state.sortType}
|
|
|
- currentView={currentView}
|
|
|
+ <TagFilter
|
|
|
+ onSelect={(newSelectedTag) =>
|
|
|
+ this.setState({ selectedTag: newSelectedTag })
|
|
|
+ }
|
|
|
/>
|
|
|
</>
|
|
|
);
|
|
|
@@ -185,16 +179,23 @@ class ClusterDashboard extends Component<PropsType, StateType> {
|
|
|
return (
|
|
|
<>
|
|
|
<ControlRow>
|
|
|
- <SortFilterWrapper>{this.renderCommonFilters()}</SortFilterWrapper>
|
|
|
- {isAuthorizedToAdd && (
|
|
|
- <Button
|
|
|
- onClick={() =>
|
|
|
- pushFiltered(this.props, "/launch", ["project_id"])
|
|
|
- }
|
|
|
- >
|
|
|
- <i className="material-icons">add</i> Launch template
|
|
|
- </Button>
|
|
|
- )}
|
|
|
+ <FilterWrapper>{this.renderCommonFilters()}</FilterWrapper>
|
|
|
+ <Flex>
|
|
|
+ <SortSelector
|
|
|
+ setSortType={(sortType) => this.setState({ sortType })}
|
|
|
+ sortType={this.state.sortType}
|
|
|
+ currentView={currentView}
|
|
|
+ />
|
|
|
+ {isAuthorizedToAdd && (
|
|
|
+ <Button
|
|
|
+ onClick={() =>
|
|
|
+ pushFiltered(this.props, "/launch", ["project_id"])
|
|
|
+ }
|
|
|
+ >
|
|
|
+ <i className="material-icons">add</i> Launch template
|
|
|
+ </Button>
|
|
|
+ )}
|
|
|
+ </Flex>
|
|
|
</ControlRow>
|
|
|
|
|
|
<ChartList
|
|
|
@@ -219,31 +220,8 @@ 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>
|
|
|
- )}
|
|
|
- <SortFilterWrapper>
|
|
|
+ <FilterWrapper>
|
|
|
<LastRunStatusSelector
|
|
|
lastRunStatus={this.state.lastRunStatus}
|
|
|
setLastRunStatus={(lastRunStatus: JobStatusType) => {
|
|
|
@@ -251,7 +229,33 @@ class ClusterDashboard extends Component<PropsType, StateType> {
|
|
|
}}
|
|
|
/>
|
|
|
{this.renderCommonFilters()}
|
|
|
- </SortFilterWrapper>
|
|
|
+ </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
|
|
|
@@ -316,6 +320,7 @@ class ClusterDashboard extends Component<PropsType, StateType> {
|
|
|
image={monoweb}
|
|
|
title={currentView}
|
|
|
description="Continuously running web services, workers, and add-ons."
|
|
|
+ disableLineBreak
|
|
|
/>
|
|
|
|
|
|
{this.renderBodyForApps()}
|
|
|
@@ -343,36 +348,65 @@ 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")};
|
|
|
`;
|
|
|
|
|
|
+const Flex = styled.div`
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ border-bottom: 30px solid transparent;
|
|
|
+`;
|
|
|
+
|
|
|
const ControlRow = styled.div`
|
|
|
display: flex;
|
|
|
- margin-left: auto;
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
flex-wrap: wrap;
|
|
|
- padding-left: 0px;
|
|
|
`;
|
|
|
|
|
|
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: 35px;
|
|
|
- margin-bottom: 35px;
|
|
|
- padding: 0px 8px;
|
|
|
+ height: 30px;
|
|
|
+ padding: 0 8px;
|
|
|
min-width: 155px;
|
|
|
- padding-bottom: 1px;
|
|
|
- font-weight: 500;
|
|
|
- padding-right: 15px;
|
|
|
+ padding-right: 13px;
|
|
|
overflow: hidden;
|
|
|
white-space: nowrap;
|
|
|
text-overflow: ellipsis;
|
|
|
@@ -401,11 +435,10 @@ const Button = styled.div`
|
|
|
}
|
|
|
`;
|
|
|
|
|
|
-const SortFilterWrapper = styled.div`
|
|
|
+const FilterWrapper = styled.div`
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
- margin-bottom: 35px;
|
|
|
+ border-bottom: 30px solid transparent;
|
|
|
> div:not(:first-child) {
|
|
|
- margin-left: 30px;
|
|
|
}
|
|
|
`;
|