|
@@ -5,14 +5,20 @@ import gradient from '../../../assets/gradient.jpg';
|
|
|
import { Context } from '../../../shared/Context';
|
|
import { Context } from '../../../shared/Context';
|
|
|
|
|
|
|
|
import ChartList from './chart/ChartList';
|
|
import ChartList from './chart/ChartList';
|
|
|
|
|
+import NamespaceSelector from './NamespaceSelector';
|
|
|
|
|
|
|
|
type PropsType = {
|
|
type PropsType = {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
type StateType = {
|
|
type StateType = {
|
|
|
|
|
+ namespace: string
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
export default class Dashboard extends Component<PropsType, StateType> {
|
|
export default class Dashboard extends Component<PropsType, StateType> {
|
|
|
|
|
+ state = {
|
|
|
|
|
+ namespace: ''
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
render() {
|
|
render() {
|
|
|
let { currentCluster } = this.context;
|
|
let { currentCluster } = this.context;
|
|
|
|
|
|
|
@@ -37,8 +43,22 @@ export default class Dashboard extends Component<PropsType, StateType> {
|
|
|
</InfoSection>
|
|
</InfoSection>
|
|
|
|
|
|
|
|
<LineBreak />
|
|
<LineBreak />
|
|
|
-
|
|
|
|
|
- <ChartList currentCluster={currentCluster} />
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <ControlRow>
|
|
|
|
|
+ <Button disabled={true}>
|
|
|
|
|
+ <i className="material-icons">add</i> Add a Chart
|
|
|
|
|
+ </Button>
|
|
|
|
|
+ <NamespaceSelector
|
|
|
|
|
+ setNamespace={(namespace) => this.setState({ namespace })}
|
|
|
|
|
+ namespace={this.state.namespace}
|
|
|
|
|
+ currentCluster={currentCluster}
|
|
|
|
|
+ />
|
|
|
|
|
+ </ControlRow>
|
|
|
|
|
+
|
|
|
|
|
+ <ChartList
|
|
|
|
|
+ currentCluster={currentCluster}
|
|
|
|
|
+ namespace={this.state.namespace}
|
|
|
|
|
+ />
|
|
|
</div>
|
|
</div>
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
@@ -46,6 +66,14 @@ export default class Dashboard extends Component<PropsType, StateType> {
|
|
|
|
|
|
|
|
Dashboard.contextType = Context;
|
|
Dashboard.contextType = Context;
|
|
|
|
|
|
|
|
|
|
+const ControlRow = styled.div`
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ margin-bottom: 35px;
|
|
|
|
|
+ padding-left: 0px;
|
|
|
|
|
+`;
|
|
|
|
|
+
|
|
|
const TopRow = styled.div`
|
|
const TopRow = styled.div`
|
|
|
display: flex;
|
|
display: flex;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
@@ -75,43 +103,35 @@ const InfoLabel = styled.div`
|
|
|
const InfoSection = styled.div`
|
|
const InfoSection = styled.div`
|
|
|
margin-top: 20px;
|
|
margin-top: 20px;
|
|
|
font-family: 'Work Sans', sans-serif;
|
|
font-family: 'Work Sans', sans-serif;
|
|
|
- margin-left: 7px;
|
|
|
|
|
|
|
+ margin-left: 0px;
|
|
|
margin-bottom: 35px;
|
|
margin-bottom: 35px;
|
|
|
`;
|
|
`;
|
|
|
|
|
|
|
|
-const ButtonWrap = styled.div`
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- font-size: 18px;
|
|
|
|
|
- margin-top: 2px;
|
|
|
|
|
- margin-bottom: 25px;
|
|
|
|
|
- color: #00000020;
|
|
|
|
|
-`;
|
|
|
|
|
-
|
|
|
|
|
const Button = styled.div`
|
|
const Button = styled.div`
|
|
|
- min-width: 145px;
|
|
|
|
|
- max-width: 145px;
|
|
|
|
|
display: flex;
|
|
display: flex;
|
|
|
- flex: 1;
|
|
|
|
|
flex-direction: row;
|
|
flex-direction: row;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|
|
|
font-size: 13px;
|
|
font-size: 13px;
|
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
|
font-family: 'Work Sans', sans-serif;
|
|
font-family: 'Work Sans', sans-serif;
|
|
|
- margin-left: 5px;
|
|
|
|
|
border-radius: 20px;
|
|
border-radius: 20px;
|
|
|
color: white;
|
|
color: white;
|
|
|
- padding: 6px 8px;
|
|
|
|
|
|
|
+ height: 30px;
|
|
|
|
|
+ padding: 0px 8px;
|
|
|
|
|
+ padding-bottom: 1px;
|
|
|
margin-right: 10px;
|
|
margin-right: 10px;
|
|
|
- padding-right: 13px;
|
|
|
|
|
|
|
+ font-weight: 500;
|
|
|
|
|
+ padding-right: 15px;
|
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
|
white-space: nowrap;
|
|
white-space: nowrap;
|
|
|
text-overflow: ellipsis;
|
|
text-overflow: ellipsis;
|
|
|
|
|
+ box-shadow: 0 5px 8px 0px #00000010;
|
|
|
|
|
+ cursor: not-allowed;
|
|
|
|
|
|
|
|
- background: #616FEEcc;
|
|
|
|
|
|
|
+ background: ${(props: { disabled: boolean }) => props.disabled ? '#aaaabbee' :'#616FEEcc'};
|
|
|
:hover {
|
|
:hover {
|
|
|
- background: #505edddd;
|
|
|
|
|
|
|
+ background: ${(props: { disabled: boolean }) => props.disabled ? '' : '#505edddd'};
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
> i {
|
|
> i {
|
|
@@ -122,7 +142,7 @@ const Button = styled.div`
|
|
|
border-radius: 20px;
|
|
border-radius: 20px;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
- margin-top: -1px;
|
|
|
|
|
|
|
+ margin-right: 8px;
|
|
|
justify-content: center;
|
|
justify-content: center;
|
|
|
}
|
|
}
|
|
|
`;
|
|
`;
|
|
@@ -196,7 +216,7 @@ const Title = styled.div`
|
|
|
font-size: 20px;
|
|
font-size: 20px;
|
|
|
font-weight: 500;
|
|
font-weight: 500;
|
|
|
font-family: 'Work Sans', sans-serif;
|
|
font-family: 'Work Sans', sans-serif;
|
|
|
- margin-left: 20px;
|
|
|
|
|
|
|
+ margin-left: 18px;
|
|
|
color: #ffffff;
|
|
color: #ffffff;
|
|
|
white-space: nowrap;
|
|
white-space: nowrap;
|
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
@@ -210,7 +230,7 @@ const TitleSection = styled.div`
|
|
|
display: flex;
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
flex-direction: row;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
- padding-left: 17px;
|
|
|
|
|
|
|
+ padding-left: 0px;
|
|
|
|
|
|
|
|
> i {
|
|
> i {
|
|
|
margin-left: 10px;
|
|
margin-left: 10px;
|