mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Enforce semicolons in eslint
Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
This commit is contained in:
1 parent
0f3f5611ba
commit
1477bb8274
531 files changed
+3979
-3975
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import "./overview-statuses.scss"
|
||||
import "./overview-statuses.scss";
|
||||
|
||||
import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
@@ -21,14 +21,14 @@ const resources: KubeResource[] = [
|
||||
"daemonsets",
|
||||
"jobs",
|
||||
"cronjobs",
|
||||
]
|
||||
];
|
||||
|
||||
@observer
|
||||
export class OverviewStatuses extends React.Component {
|
||||
@autobind()
|
||||
renderWorkload(resource: KubeResource): React.ReactElement {
|
||||
const store = workloadStores[resource];
|
||||
const items = store.getAllByNs(namespaceStore.contextNs)
|
||||
const items = store.getAllByNs(namespaceStore.contextNs);
|
||||
return (
|
||||
<div className="workload" key={resource}>
|
||||
<div className="title">
|
||||
@@ -36,7 +36,7 @@ export class OverviewStatuses extends React.Component {
|
||||
</div>
|
||||
<OverviewWorkloadStatus status={store.getStatuses(items)} />
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
@@ -55,6 +55,6 @@ export class OverviewStatuses extends React.Component {
|
||||
{workloads}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ export class OverviewWorkloadStatus extends React.Component<Props> {
|
||||
@observable elem: HTMLElement
|
||||
|
||||
componentDidMount() {
|
||||
this.elem = findDOMNode(this) as HTMLElement
|
||||
this.elem = findDOMNode(this) as HTMLElement;
|
||||
}
|
||||
|
||||
getStatusColor(status: string) {
|
||||
@@ -29,9 +29,9 @@ export class OverviewWorkloadStatus extends React.Component<Props> {
|
||||
}
|
||||
|
||||
renderChart() {
|
||||
if (!this.elem) return null
|
||||
const { status } = this.props
|
||||
const statuses = Object.entries(status)
|
||||
if (!this.elem) return null;
|
||||
const { status } = this.props;
|
||||
const statuses = Object.entries(status);
|
||||
const chartData: Partial<ChartData> = {
|
||||
labels: [] as string[],
|
||||
datasets: [{
|
||||
@@ -39,21 +39,21 @@ export class OverviewWorkloadStatus extends React.Component<Props> {
|
||||
backgroundColor: [themeStore.activeTheme.colors.pieChartDefaultColor],
|
||||
label: "Empty"
|
||||
}]
|
||||
}
|
||||
};
|
||||
if (statuses.some(([key, val]) => val > 0)) {
|
||||
const dataset: any = {
|
||||
data: [],
|
||||
backgroundColor: [],
|
||||
label: "Status",
|
||||
}
|
||||
};
|
||||
statuses.forEach(([key, val]) => {
|
||||
if (val !== 0) {
|
||||
dataset.data.push(val)
|
||||
dataset.backgroundColor.push(this.getStatusColor(key))
|
||||
chartData.labels.push(capitalize(key) + ": " + val)
|
||||
dataset.data.push(val);
|
||||
dataset.backgroundColor.push(this.getStatusColor(key));
|
||||
chartData.labels.push(capitalize(key) + ": " + val);
|
||||
}
|
||||
})
|
||||
chartData.datasets[0] = dataset
|
||||
});
|
||||
chartData.datasets[0] = dataset;
|
||||
}
|
||||
const options = {
|
||||
elements: {
|
||||
@@ -61,10 +61,10 @@ export class OverviewWorkloadStatus extends React.Component<Props> {
|
||||
borderWidth: 0,
|
||||
},
|
||||
},
|
||||
}
|
||||
};
|
||||
return (
|
||||
<PieChart data={chartData} options={options}/>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
@@ -74,6 +74,6 @@ export class OverviewWorkloadStatus extends React.Component<Props> {
|
||||
{this.renderChart()}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import "./overview.scss"
|
||||
import "./overview.scss";
|
||||
|
||||
import React from "react";
|
||||
import { observable, when } from "mobx";
|
||||
@@ -17,7 +17,7 @@ import { cronJobStore } from "../+workloads-cronjobs/cronjob.store";
|
||||
import { Spinner } from "../spinner";
|
||||
import { Events } from "../+events";
|
||||
import { KubeObjectStore } from "../../kube-object.store";
|
||||
import { isAllowedResource } from "../../../common/rbac"
|
||||
import { isAllowedResource } from "../../../common/rbac";
|
||||
|
||||
interface Props extends RouteComponentProps<IWorkloadsOverviewRouteParams> {
|
||||
}
|
||||
@@ -67,7 +67,7 @@ export class WorkloadsOverview extends React.Component<Props> {
|
||||
|
||||
renderContents() {
|
||||
if (!this.isReady) {
|
||||
return <Spinner center/>
|
||||
return <Spinner center/>;
|
||||
}
|
||||
return (
|
||||
<>
|
||||
@@ -78,7 +78,7 @@ export class WorkloadsOverview extends React.Component<Props> {
|
||||
className="box grow"
|
||||
/> }
|
||||
</>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
@@ -86,6 +86,6 @@ export class WorkloadsOverview extends React.Component<Props> {
|
||||
<div className="WorkloadsOverview flex column gaps">
|
||||
{this.renderContents()}
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user