mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Lint dashboard app automatically (#529)
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
parent
e468105143
commit
c91f608346
@ -69,6 +69,9 @@ module.exports = {
|
|||||||
"@typescript-eslint/no-empty-interface": "off",
|
"@typescript-eslint/no-empty-interface": "off",
|
||||||
"@typescript-eslint/no-var-requires": "off",
|
"@typescript-eslint/no-var-requires": "off",
|
||||||
"@typescript-eslint/ban-ts-ignore": "off",
|
"@typescript-eslint/ban-ts-ignore": "off",
|
||||||
|
"@typescript-eslint/explicit-module-boundary-types": "off",
|
||||||
|
"@typescript-eslint/ban-types": "off",
|
||||||
|
"@typescript-eslint/no-empty-function": "off",
|
||||||
"indent": ["error", 2]
|
"indent": ["error", 2]
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
1
Makefile
1
Makefile
@ -28,6 +28,7 @@ integration-win:
|
|||||||
|
|
||||||
lint:
|
lint:
|
||||||
yarn lint
|
yarn lint
|
||||||
|
yarn lint-dashboard
|
||||||
|
|
||||||
test-app:
|
test-app:
|
||||||
yarn test
|
yarn test
|
||||||
|
|||||||
@ -173,7 +173,7 @@ export class Pod extends WorkloadKubeObject {
|
|||||||
};
|
};
|
||||||
configMap: {
|
configMap: {
|
||||||
name: string;
|
name: string;
|
||||||
}
|
};
|
||||||
secret: {
|
secret: {
|
||||||
secretName: string;
|
secretName: string;
|
||||||
defaultMode: number;
|
defaultMode: number;
|
||||||
|
|||||||
@ -28,7 +28,7 @@ export class EndpointDetails extends React.Component<Props> {
|
|||||||
{
|
{
|
||||||
endpoint.getEndpointSubsets().map((subset) => {
|
endpoint.getEndpointSubsets().map((subset) => {
|
||||||
return(
|
return(
|
||||||
<EndpointSubsetList subset={subset} endpoint={endpoint}/>
|
<EndpointSubsetList subset={subset} endpoint={endpoint}/>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -71,9 +71,9 @@ export class EndpointSubsetList extends React.Component<Props> {
|
|||||||
<TableCell className="name">{address.hostname}</TableCell>
|
<TableCell className="name">{address.hostname}</TableCell>
|
||||||
<TableCell className="target">
|
<TableCell className="target">
|
||||||
{ address.targetRef && (
|
{ address.targetRef && (
|
||||||
<Link to={getDetailsUrl(lookupApiLink(address.getTargetRef(), endpoint))}>
|
<Link to={getDetailsUrl(lookupApiLink(address.getTargetRef(), endpoint))}>
|
||||||
{address.targetRef.name}
|
{address.targetRef.name}
|
||||||
</Link>
|
</Link>
|
||||||
)}
|
)}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
@ -90,45 +90,45 @@ export class EndpointSubsetList extends React.Component<Props> {
|
|||||||
return(
|
return(
|
||||||
<div className="EndpointSubsetList flex column">
|
<div className="EndpointSubsetList flex column">
|
||||||
{addresses.length > 0 && (
|
{addresses.length > 0 && (
|
||||||
<div>
|
<div>
|
||||||
<div className="title flex gaps"><Trans>Addresses</Trans></div>
|
<div className="title flex gaps"><Trans>Addresses</Trans></div>
|
||||||
<Table
|
<Table
|
||||||
items={addresses}
|
items={addresses}
|
||||||
selectable={false}
|
selectable={false}
|
||||||
virtual={addressesVirtual}
|
virtual={addressesVirtual}
|
||||||
scrollable={false}
|
scrollable={false}
|
||||||
getTableRow={this.getAddressTableRow}
|
getTableRow={this.getAddressTableRow}
|
||||||
className="box grow"
|
className="box grow"
|
||||||
>
|
>
|
||||||
<TableHead>
|
<TableHead>
|
||||||
<TableCell className="ip">IP</TableCell>
|
<TableCell className="ip">IP</TableCell>
|
||||||
<TableCell className="host"><Trans>Hostname</Trans></TableCell>
|
<TableCell className="host"><Trans>Hostname</Trans></TableCell>
|
||||||
<TableCell className="target">Target</TableCell>
|
<TableCell className="target">Target</TableCell>
|
||||||
</TableHead>
|
</TableHead>
|
||||||
{ !addressesVirtual && addresses.map(address => this.getAddressTableRow(address.getId())) }
|
{ !addressesVirtual && addresses.map(address => this.getAddressTableRow(address.getId())) }
|
||||||
</Table>
|
</Table>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{notReadyAddresses.length > 0 && (
|
{notReadyAddresses.length > 0 && (
|
||||||
<div>
|
<div>
|
||||||
<div className="title flex gaps"><Trans>Not Ready Addresses</Trans></div>
|
<div className="title flex gaps"><Trans>Not Ready Addresses</Trans></div>
|
||||||
<Table
|
<Table
|
||||||
items={notReadyAddresses}
|
items={notReadyAddresses}
|
||||||
selectable
|
selectable
|
||||||
virtual={notReadyAddressesVirtual}
|
virtual={notReadyAddressesVirtual}
|
||||||
scrollable={false}
|
scrollable={false}
|
||||||
getTableRow={this.getNotReadyAddressTableRow}
|
getTableRow={this.getNotReadyAddressTableRow}
|
||||||
className="box grow"
|
className="box grow"
|
||||||
>
|
>
|
||||||
<TableHead>
|
<TableHead>
|
||||||
<TableCell className="ip">IP</TableCell>
|
<TableCell className="ip">IP</TableCell>
|
||||||
<TableCell className="host"><Trans>Hostname</Trans></TableCell>
|
<TableCell className="host"><Trans>Hostname</Trans></TableCell>
|
||||||
<TableCell className="target">Target</TableCell>
|
<TableCell className="target">Target</TableCell>
|
||||||
</TableHead>
|
</TableHead>
|
||||||
{ !notReadyAddressesVirtual && notReadyAddresses.map(address => this.getNotReadyAddressTableRow(address.getId())) }
|
{ !notReadyAddressesVirtual && notReadyAddresses.map(address => this.getNotReadyAddressTableRow(address.getId())) }
|
||||||
</Table>
|
</Table>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div className="title flex gaps"><Trans>Ports</Trans></div>
|
<div className="title flex gaps"><Trans>Ports</Trans></div>
|
||||||
|
|||||||
@ -23,25 +23,25 @@ export class ServiceDetailsEndpoint extends React.Component<Props> {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div className="EndpointList flex column">
|
<div className="EndpointList flex column">
|
||||||
<Table
|
<Table
|
||||||
selectable
|
selectable
|
||||||
virtual={false}
|
virtual={false}
|
||||||
scrollable={false}
|
scrollable={false}
|
||||||
className="box grow"
|
className="box grow"
|
||||||
>
|
>
|
||||||
<TableHead>
|
<TableHead>
|
||||||
<TableCell className="name" ><Trans>Name</Trans></TableCell>
|
<TableCell className="name" ><Trans>Name</Trans></TableCell>
|
||||||
<TableCell className="endpoints"><Trans>Endpoints</Trans></TableCell>
|
<TableCell className="endpoints"><Trans>Endpoints</Trans></TableCell>
|
||||||
</TableHead>
|
</TableHead>
|
||||||
<TableRow
|
<TableRow
|
||||||
key={endpoint.getId()}
|
key={endpoint.getId()}
|
||||||
nowrap
|
nowrap
|
||||||
onClick={prevDefault(() => showDetails(endpoint.selfLink, false))}
|
onClick={prevDefault(() => showDetails(endpoint.selfLink, false))}
|
||||||
>
|
>
|
||||||
<TableCell className="name">{endpoint.getName()}</TableCell>
|
<TableCell className="name">{endpoint.getName()}</TableCell>
|
||||||
<TableCell className="endpoints">{ endpoint.toString()}</TableCell>
|
<TableCell className="endpoints">{ endpoint.toString()}</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</Table>
|
</Table>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@ -125,14 +125,14 @@ const SecretKey = (props: SecretKeyProps) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
secretKeyRef({name}.{key})
|
secretKeyRef({name}.{key})
|
||||||
<Icon
|
<Icon
|
||||||
className={cssNames("secret-button", { loading })}
|
className={cssNames("secret-button", { loading })}
|
||||||
material="visibility"
|
material="visibility"
|
||||||
tooltip={<Trans>Show</Trans>}
|
tooltip={<Trans>Show</Trans>}
|
||||||
onClick={showKey}
|
onClick={showKey}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -174,28 +174,28 @@ export class PodDetails extends React.Component<Props> {
|
|||||||
</DrawerItem>
|
</DrawerItem>
|
||||||
{ type == "configMap" && (
|
{ type == "configMap" && (
|
||||||
<div>
|
<div>
|
||||||
{configMap && (
|
{configMap && (
|
||||||
<DrawerItem name={<Trans>Name</Trans>}>
|
<DrawerItem name={<Trans>Name</Trans>}>
|
||||||
<Link
|
<Link
|
||||||
to={getDetailsUrl(configMapApi.getUrl({
|
to={getDetailsUrl(configMapApi.getUrl({
|
||||||
name: configMap,
|
name: configMap,
|
||||||
namespace: pod.getNs(),
|
namespace: pod.getNs(),
|
||||||
}))}>{configMap}
|
}))}>{configMap}
|
||||||
</Link>
|
</Link>
|
||||||
</DrawerItem>
|
</DrawerItem>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{ type === "emptyDir" && (
|
{ type === "emptyDir" && (
|
||||||
<div>
|
<div>
|
||||||
{ volume.emptyDir.medium && (
|
{ volume.emptyDir.medium && (
|
||||||
<DrawerItem name={<Trans>Medium</Trans>}>
|
<DrawerItem name={<Trans>Medium</Trans>}>
|
||||||
{volume.emptyDir.medium}
|
{volume.emptyDir.medium}
|
||||||
</DrawerItem>
|
</DrawerItem>
|
||||||
)}
|
)}
|
||||||
{ volume.emptyDir.sizeLimit && (
|
{ volume.emptyDir.sizeLimit && (
|
||||||
<DrawerItem name={<Trans>Size Limit</Trans>}>
|
<DrawerItem name={<Trans>Size Limit</Trans>}>
|
||||||
{volume.emptyDir.sizeLimit}
|
{volume.emptyDir.sizeLimit}
|
||||||
</DrawerItem>
|
</DrawerItem>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -81,7 +81,7 @@ export class Workloads extends React.Component<Props> {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
return routes;
|
return routes;
|
||||||
};
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const tabRoutes = Workloads.tabRoutes;
|
const tabRoutes = Workloads.tabRoutes;
|
||||||
|
|||||||
@ -44,7 +44,7 @@ class App extends React.Component {
|
|||||||
|
|
||||||
// render app
|
// render app
|
||||||
render(<App/>, App.rootElem);
|
render(<App/>, App.rootElem);
|
||||||
};
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const homeUrl = (isAllowedResource(["events", "nodes", "pods"])) ? clusterURL() : workloadsURL();
|
const homeUrl = (isAllowedResource(["events", "nodes", "pods"])) ? clusterURL() : workloadsURL();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user