mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add eslint rule padding-line-between-statements (#1593)
Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
This commit is contained in:
1 parent
7b77f18376
commit
dcf253e7d5
401 files changed
+2018
-40
No files matched your search
@@ -28,6 +28,7 @@ export class OverviewStatuses extends React.Component {
|
||||
renderWorkload(resource: KubeResource): React.ReactElement {
|
||||
const store = workloadStores[resource];
|
||||
const items = store.getAllByNs(namespaceStore.contextNs);
|
||||
|
||||
return (
|
||||
<div className="workload" key={resource}>
|
||||
<div className="title">
|
||||
|
||||
@@ -45,12 +45,14 @@ export class OverviewWorkloadStatus extends React.Component<Props> {
|
||||
label: "Empty"
|
||||
}]
|
||||
};
|
||||
|
||||
if (statuses.some(([, val]) => val > 0)) {
|
||||
const dataset: SimpleChartDataSets = {
|
||||
data: [],
|
||||
backgroundColor: [],
|
||||
label: "Status",
|
||||
};
|
||||
|
||||
statuses.forEach(([key, val]) => {
|
||||
if (val !== 0) {
|
||||
dataset.data.push(val);
|
||||
@@ -67,6 +69,7 @@ export class OverviewWorkloadStatus extends React.Component<Props> {
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
return (
|
||||
<PieChart data={chartData} options={options}/>
|
||||
);
|
||||
|
||||
@@ -29,27 +29,35 @@ export class WorkloadsOverview extends React.Component<Props> {
|
||||
|
||||
async componentDidMount() {
|
||||
const stores: KubeObjectStore[] = [];
|
||||
|
||||
if (isAllowedResource("pods")) {
|
||||
stores.push(podsStore);
|
||||
}
|
||||
|
||||
if (isAllowedResource("deployments")) {
|
||||
stores.push(deploymentStore);
|
||||
}
|
||||
|
||||
if (isAllowedResource("daemonsets")) {
|
||||
stores.push(daemonSetStore);
|
||||
}
|
||||
|
||||
if (isAllowedResource("statefulsets")) {
|
||||
stores.push(statefulSetStore);
|
||||
}
|
||||
|
||||
if (isAllowedResource("replicasets")) {
|
||||
stores.push(replicaSetStore);
|
||||
}
|
||||
|
||||
if (isAllowedResource("jobs")) {
|
||||
stores.push(jobStore);
|
||||
}
|
||||
|
||||
if (isAllowedResource("cronjobs")) {
|
||||
stores.push(cronJobStore);
|
||||
}
|
||||
|
||||
if (isAllowedResource("events")) {
|
||||
stores.push(eventStore);
|
||||
}
|
||||
@@ -57,6 +65,7 @@ export class WorkloadsOverview extends React.Component<Props> {
|
||||
await Promise.all(stores.map(store => store.loadAll()));
|
||||
this.isReady = true;
|
||||
const unsubscribeList = stores.map(store => store.subscribe());
|
||||
|
||||
await when(() => this.isUnmounting);
|
||||
unsubscribeList.forEach(dispose => dispose());
|
||||
}
|
||||
@@ -69,6 +78,7 @@ export class WorkloadsOverview extends React.Component<Props> {
|
||||
if (!this.isReady) {
|
||||
return <Spinner center/>;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<OverviewStatuses/>
|
||||
|
||||
Reference in new issue
Block a user