diff --git a/client/src/components/containersPanel.js b/client/src/components/containersPanel.tsx similarity index 89% rename from client/src/components/containersPanel.js rename to client/src/components/containersPanel.tsx index 43c85d1..7ee15c1 100644 --- a/client/src/components/containersPanel.js +++ b/client/src/components/containersPanel.tsx @@ -1,8 +1,9 @@ import _ from 'lodash'; import React, {Fragment} from 'react'; import Field from './field'; +import {TODO} from "../utils/types"; -const ContainersPanel = ({spec}) => ( +const ContainersPanel = ({spec}: {spec: TODO}) => ( <> {spec && _.map(spec.containers, item => ( @@ -18,7 +19,7 @@ const ContainersPanel = ({spec}) => ( {item.env && ( - {item.env.map(x => ( + {item.env.map((x: TODO) => (
{x.name}: {getVariableValue(x)}
@@ -42,7 +43,7 @@ const ContainersPanel = ({spec}) => ( {item.ports && ( - {item.ports.map((x, i) => ( + {item.ports.map((x: TODO, i: number) => (
{[x.name, x.containerPort, x.hostPort, x.protocol].filter(y => !!y).join(' • ')}
@@ -55,7 +56,7 @@ const ContainersPanel = ({spec}) => ( ); -function getVariableValue(item) { +function getVariableValue(item: TODO) { if (item.value) return item.value; if (!item.valueFrom) return null; if (item.valueFrom.secretKeyRef) return item.valueFrom.secretKeyRef.key; diff --git a/client/src/components/donut.tsx b/client/src/components/donut.tsx index 240ea6e..f6aed4a 100644 --- a/client/src/components/donut.tsx +++ b/client/src/components/donut.tsx @@ -63,9 +63,9 @@ export default class Donut extends Base { return ( - - - + + + ); } diff --git a/client/src/components/menu.js b/client/src/components/menu.tsx similarity index 87% rename from client/src/components/menu.js rename to client/src/components/menu.tsx index fb49163..46273e9 100644 --- a/client/src/components/menu.js +++ b/client/src/components/menu.tsx @@ -7,9 +7,27 @@ import api from '../services/api'; import {addHandler} from '../services/auth'; import ResourceSvg from '../art/resourceSvg'; import AddSvg from '../art/addSvg'; +import {TODO} from "../utils/types"; +interface MenuProps { + onClick: TODO; + toggled: boolean; +} -export default class Menu extends Base { +interface MenuStates { + rules: TODO[]; + showAdd: boolean; +} + +interface MenuItemProps { + path: string; + title: string; + resource: string; + onClick: TODO; + additionalPaths?: string[]; +} + +export default class Menu extends Base { componentDidMount() { this.getRules(); @@ -29,7 +47,7 @@ export default class Menu extends Base { return ( <> -
+