Skip to content

Commit

Permalink
Lens 5 compatibilty + object details components (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
nevalla authored Jun 8, 2021
1 parent eeaeb30 commit 8aeb936
Show file tree
Hide file tree
Showing 27 changed files with 3,468 additions and 1,895 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ node_modules
lens.log
.DS_Store
*.tgz
*.bak
52 changes: 0 additions & 52 deletions components/ControllerTooltip.tsx

This file was deleted.

33 changes: 33 additions & 0 deletions components/KubeControllerChart.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { Renderer } from "@k8slens/extensions";
import { observer } from "mobx-react";
import { KubeResourceChart } from "./KubeResourceChart";

@observer
export class KubeControllerChart extends KubeResourceChart {

registerStores() {
this.kubeObjectStores = [
this.podsStore,
this.serviceStore,
this.ingressStore,
this.pvcStore,
this.configMapStore,
this.secretStore,
this.deploymentStore,
this.daemonsetStore,
this.statefulsetStore
]
}

generateChartDataSeries = () => {
const nodes = [...this.nodes];
const links = [...this.links];

this.generateControllerNode(this.props.object);
this.generateIngresses();

if (nodes.length != this.nodes.length || links.length != this.links.length) { // TODO: Improve the logic
this.updateState(this.nodes, this.links);
}
}
}
57 changes: 51 additions & 6 deletions components/KubeForceChart.scss
Original file line number Diff line number Diff line change
@@ -1,35 +1,63 @@
.KubeForceChart {
width: 100%;
height: 100%;
background-color: #1e2124;
}

#KubeForceChart-tooltip {
display: none;
}

.force-graph-container {
background-color: var(--secondaryBackground);
}

.graph-tooltip {
background: rgb(30, 33, 36) !important;
border: 1px solid #4c5053;
background: var(--tooltipBackground) !important;
border: 1px solid var(--borderColor);
border-radius: 3px;
max-width: 400px;
min-width: 400px;
color: rgb(160, 160, 160);
min-width: 300px;
color: var(--textColorPrimary);
font-size: small;
font-weight: normal;
transition: opacity 150ms 25ms ease-in-out;
z-index: 10;
}

.ingress-tooltip {
min-width: 400px;
}

.KubeResourceChartTooltip {
padding: 3px;
font-size: 14px;
font-size: 12px !important;
color: rgb(160, 160, 160);

.DrawerItem {
.name, .value {
color: rgb(160, 160, 160);
}
}

.conditions {
.Badge {
&.available {
color: white;
background-color: var(--colorOk);
}

&.progressing {
color: white;
background-color: var(--colorInfo);
}

&.replica-failure {
color: white;
background-color: var(--colorError);
}
}
}

.running {
color: var(--colorOk);
}
Expand Down Expand Up @@ -62,4 +90,21 @@
color: white;
background: var(--colorWarning);
}

.rules {
margin-top: 2px;
margin-bottom: 16px;
}

.host-title {
font-weight: bold;
}

.Table {
.path {
&:empty:after {
content: '\2014';
}
}
}
}
Loading

0 comments on commit 8aeb936

Please sign in to comment.