fix some types

This commit is contained in:
atu
2020-08-09 20:56:25 -07:00
parent 4b6b80ece3
commit 18d5d378b3
4 changed files with 13 additions and 10 deletions
+2 -2
View File
@@ -2,9 +2,9 @@ import _ from 'lodash';
import React from 'react';
import Chart from './chart';
import LoadingChart from './loadingChart';
import {TODO} from "../utils/types";
import {TODO, Node} from "../utils/types";
export default function NodeStatusChart({items}: {items: TODO[]}) {
export default function NodeStatusChart({items}: {items: Node[]}) {
const readyCount = _.sumBy(items, x => getReadyStatus(x) === 'True' ? 1 : 0); // eslint-disable-line no-confusing-arrow
return (
+3 -3
View File
@@ -2,15 +2,15 @@ import _ from 'lodash';
import React from 'react';
import Chart from './chart';
import LoadingChart from './loadingChart';
import {TODO} from "../utils/types";
import {Pod} from "../utils/types";
export default function PodStatusChart({items}: {items: TODO[]}) {
export default function PodStatusChart({items}: {items?: Pod[]}) {
const available = items && items.length;
const count = _.sumBy(items, x => x.status.phase === 'Running' ? 1 : 0); // eslint-disable-line no-confusing-arrow
return (
<div className='charts_item'>
{items ? (
{items && available ? (
<Chart used={count} pending={available - count} available={available} />
) : (
<LoadingChart />
+5 -5
View File
@@ -6,14 +6,14 @@ import LoadingEllipsis from './loadingEllipsis';
import {MetadataHeaders, MetadataColumns, TableBody} from './listViewHelpers';
import {unparseRam, unparseCpu} from '../utils/unitHelpers';
import {getPodResourcePercent, getPodUsage, getPodResourceValue} from '../utils/metricsHelpers';
import {TODO} from "../utils/types";
import {Pod, TODO} from "../utils/types";
interface PodsPanelProps {
metrics: TODO;
pods: TODO[];
items: TODO[];
sort: TODO;
filter: TODO;
pods?: TODO[];
items?: Pod[];
sort?: TODO;
filter?: TODO;
skipNamespace: boolean;
}
+3
View File
@@ -14,6 +14,9 @@ interface Metadata {
}
interface Container {
name?: string;
image?: string;
args?: string[];
resources?: {
requests?: {
cpu?: string;