mirror of
https://github.com/skooner-k8s/skooner.git
synced 2026-05-21 07:02:44 +00:00
replace any[] with TODO[]
This commit is contained in:
@@ -10,7 +10,7 @@ interface NamespaceFilterProps {
|
||||
|
||||
interface NamespaceFilterStates {
|
||||
namespace: {};
|
||||
namespaces?: any[];
|
||||
namespaces?: TODO[];
|
||||
}
|
||||
|
||||
export default class NamespaceFilter extends Base<NamespaceFilterProps, NamespaceFilterStates> {
|
||||
@@ -24,7 +24,7 @@ export default class NamespaceFilter extends Base<NamespaceFilterProps, Namespac
|
||||
onChange(namespace);
|
||||
|
||||
this.registerApi({
|
||||
namespaces: api.namespace.list((namespaces: any[]) => this.setState({namespaces})),
|
||||
namespaces: api.namespace.list((namespaces: TODO[]) => this.setState({namespaces})),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,9 @@ import React from 'react';
|
||||
import Chart from './chart';
|
||||
import LoadingChart from './loadingChart';
|
||||
import {parseCpu, TO_ONE_CPU} from '../utils/unitHelpers';
|
||||
import {TODO} from "../utils/types";
|
||||
|
||||
export default function NodeCpuChart({items, metrics}: {items: any[], metrics: any[]}) {
|
||||
export default function NodeCpuChart({items, metrics}: {items: TODO[], metrics: TODO[]}) {
|
||||
const totals = getNodeCpuTotals(items, metrics);
|
||||
|
||||
return (
|
||||
@@ -20,7 +21,7 @@ export default function NodeCpuChart({items, metrics}: {items: any[], metrics: a
|
||||
);
|
||||
}
|
||||
|
||||
function getNodeCpuTotals(items: any[], metrics: any[]) {
|
||||
function getNodeCpuTotals(items: TODO[], metrics: TODO[]) {
|
||||
if (!items || !metrics) return null;
|
||||
|
||||
const metricValues = Object.values(metrics);
|
||||
|
||||
@@ -3,8 +3,9 @@ import React from 'react';
|
||||
import Chart from './chart';
|
||||
import LoadingChart from './loadingChart';
|
||||
import {parseRam, TO_GB} from '../utils/unitHelpers';
|
||||
import {TODO} from "../utils/types";
|
||||
|
||||
export default function NodeRamChart({items, metrics}: {items: any[], metrics: any[]}) {
|
||||
export default function NodeRamChart({items, metrics}: {items: TODO[], metrics: TODO[]}) {
|
||||
const totals = getNodeRamTotals(items, metrics);
|
||||
return (
|
||||
<div className='charts_item'>
|
||||
@@ -19,7 +20,7 @@ export default function NodeRamChart({items, metrics}: {items: any[], metrics: a
|
||||
);
|
||||
}
|
||||
|
||||
function getNodeRamTotals(items: any[], metrics: any[]) {
|
||||
function getNodeRamTotals(items: TODO[], metrics: TODO[]) {
|
||||
if (!items || !metrics) return null;
|
||||
|
||||
const metricValues = Object.values(metrics);
|
||||
|
||||
@@ -3,8 +3,9 @@ import React from 'react';
|
||||
import Chart from './chart';
|
||||
import LoadingChart from './loadingChart';
|
||||
import {parseCpu, TO_ONE_CPU} from '../utils/unitHelpers';
|
||||
import {TODO} from "../utils/types";
|
||||
|
||||
export default function PodCpuChart({items, metrics}: {items: any[], metrics: any[]}) {
|
||||
export default function PodCpuChart({items, metrics}: {items: TODO[], metrics: TODO[]}) {
|
||||
const totals = getPodCpuTotals(items, metrics);
|
||||
const decimals = totals && totals.used > 10 ? 1 : 2;
|
||||
|
||||
@@ -25,7 +26,7 @@ export default function PodCpuChart({items, metrics}: {items: any[], metrics: an
|
||||
);
|
||||
}
|
||||
|
||||
function getPodCpuTotals(pods: any[], metrics: any[]) {
|
||||
function getPodCpuTotals(pods: TODO[], metrics: TODO[]) {
|
||||
if (!pods || !metrics) return null;
|
||||
|
||||
const used = _(metrics)
|
||||
|
||||
@@ -3,8 +3,9 @@ import React from 'react';
|
||||
import Chart from './chart';
|
||||
import LoadingChart from './loadingChart';
|
||||
import {parseRam, TO_GB} from '../utils/unitHelpers';
|
||||
import {TODO} from "../utils/types";
|
||||
|
||||
export default function RamChart({items, metrics}: {items: any[], metrics: any[]}) {
|
||||
export default function RamChart({items, metrics}: {items: TODO[], metrics: TODO[]}) {
|
||||
const totals = getPodRamTotals(items, metrics);
|
||||
const decimals = totals && totals.used > 10 ? 1 : 2;
|
||||
|
||||
@@ -27,7 +28,7 @@ export default function RamChart({items, metrics}: {items: any[], metrics: any[]
|
||||
);
|
||||
}
|
||||
|
||||
export function getPodRamTotals(items:any[], metrics:any[]) {
|
||||
export function getPodRamTotals(items:TODO[], metrics:TODO[]) {
|
||||
if (!items || !metrics) return null;
|
||||
|
||||
const metricsContainers = Object.values(metrics).flatMap(x => x.containers);
|
||||
|
||||
Reference in New Issue
Block a user