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-var-requires": "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]
|
||||
},
|
||||
}
|
||||
|
||||
1
Makefile
1
Makefile
@ -28,6 +28,7 @@ integration-win:
|
||||
|
||||
lint:
|
||||
yarn lint
|
||||
yarn lint-dashboard
|
||||
|
||||
test-app:
|
||||
yarn test
|
||||
|
||||
@ -173,7 +173,7 @@ export class Pod extends WorkloadKubeObject {
|
||||
};
|
||||
configMap: {
|
||||
name: string;
|
||||
}
|
||||
};
|
||||
secret: {
|
||||
secretName: string;
|
||||
defaultMode: number;
|
||||
|
||||
@ -28,7 +28,7 @@ export class EndpointDetails extends React.Component<Props> {
|
||||
{
|
||||
endpoint.getEndpointSubsets().map((subset) => {
|
||||
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="target">
|
||||
{ address.targetRef && (
|
||||
<Link to={getDetailsUrl(lookupApiLink(address.getTargetRef(), endpoint))}>
|
||||
{address.targetRef.name}
|
||||
</Link>
|
||||
<Link to={getDetailsUrl(lookupApiLink(address.getTargetRef(), endpoint))}>
|
||||
{address.targetRef.name}
|
||||
</Link>
|
||||
)}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
@ -90,45 +90,45 @@ export class EndpointSubsetList extends React.Component<Props> {
|
||||
return(
|
||||
<div className="EndpointSubsetList flex column">
|
||||
{addresses.length > 0 && (
|
||||
<div>
|
||||
<div className="title flex gaps"><Trans>Addresses</Trans></div>
|
||||
<Table
|
||||
items={addresses}
|
||||
selectable={false}
|
||||
virtual={addressesVirtual}
|
||||
scrollable={false}
|
||||
getTableRow={this.getAddressTableRow}
|
||||
className="box grow"
|
||||
>
|
||||
<TableHead>
|
||||
<TableCell className="ip">IP</TableCell>
|
||||
<TableCell className="host"><Trans>Hostname</Trans></TableCell>
|
||||
<TableCell className="target">Target</TableCell>
|
||||
</TableHead>
|
||||
{ !addressesVirtual && addresses.map(address => this.getAddressTableRow(address.getId())) }
|
||||
</Table>
|
||||
</div>
|
||||
<div>
|
||||
<div className="title flex gaps"><Trans>Addresses</Trans></div>
|
||||
<Table
|
||||
items={addresses}
|
||||
selectable={false}
|
||||
virtual={addressesVirtual}
|
||||
scrollable={false}
|
||||
getTableRow={this.getAddressTableRow}
|
||||
className="box grow"
|
||||
>
|
||||
<TableHead>
|
||||
<TableCell className="ip">IP</TableCell>
|
||||
<TableCell className="host"><Trans>Hostname</Trans></TableCell>
|
||||
<TableCell className="target">Target</TableCell>
|
||||
</TableHead>
|
||||
{ !addressesVirtual && addresses.map(address => this.getAddressTableRow(address.getId())) }
|
||||
</Table>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{notReadyAddresses.length > 0 && (
|
||||
<div>
|
||||
<div className="title flex gaps"><Trans>Not Ready Addresses</Trans></div>
|
||||
<Table
|
||||
items={notReadyAddresses}
|
||||
selectable
|
||||
virtual={notReadyAddressesVirtual}
|
||||
scrollable={false}
|
||||
getTableRow={this.getNotReadyAddressTableRow}
|
||||
className="box grow"
|
||||
>
|
||||
<TableHead>
|
||||
<TableCell className="ip">IP</TableCell>
|
||||
<TableCell className="host"><Trans>Hostname</Trans></TableCell>
|
||||
<TableCell className="target">Target</TableCell>
|
||||
</TableHead>
|
||||
{ !notReadyAddressesVirtual && notReadyAddresses.map(address => this.getNotReadyAddressTableRow(address.getId())) }
|
||||
</Table>
|
||||
</div>
|
||||
<div>
|
||||
<div className="title flex gaps"><Trans>Not Ready Addresses</Trans></div>
|
||||
<Table
|
||||
items={notReadyAddresses}
|
||||
selectable
|
||||
virtual={notReadyAddressesVirtual}
|
||||
scrollable={false}
|
||||
getTableRow={this.getNotReadyAddressTableRow}
|
||||
className="box grow"
|
||||
>
|
||||
<TableHead>
|
||||
<TableCell className="ip">IP</TableCell>
|
||||
<TableCell className="host"><Trans>Hostname</Trans></TableCell>
|
||||
<TableCell className="target">Target</TableCell>
|
||||
</TableHead>
|
||||
{ !notReadyAddressesVirtual && notReadyAddresses.map(address => this.getNotReadyAddressTableRow(address.getId())) }
|
||||
</Table>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="title flex gaps"><Trans>Ports</Trans></div>
|
||||
|
||||
@ -23,25 +23,25 @@ export class ServiceDetailsEndpoint extends React.Component<Props> {
|
||||
return null
|
||||
}
|
||||
return (
|
||||
<div className="EndpointList flex column">
|
||||
<div className="EndpointList flex column">
|
||||
<Table
|
||||
selectable
|
||||
virtual={false}
|
||||
scrollable={false}
|
||||
className="box grow"
|
||||
selectable
|
||||
virtual={false}
|
||||
scrollable={false}
|
||||
className="box grow"
|
||||
>
|
||||
<TableHead>
|
||||
<TableCell className="name" ><Trans>Name</Trans></TableCell>
|
||||
<TableCell className="endpoints"><Trans>Endpoints</Trans></TableCell>
|
||||
</TableHead>
|
||||
<TableRow
|
||||
key={endpoint.getId()}
|
||||
nowrap
|
||||
onClick={prevDefault(() => showDetails(endpoint.selfLink, false))}
|
||||
>
|
||||
<TableCell className="name">{endpoint.getName()}</TableCell>
|
||||
<TableCell className="endpoints">{ endpoint.toString()}</TableCell>
|
||||
</TableRow>
|
||||
<TableHead>
|
||||
<TableCell className="name" ><Trans>Name</Trans></TableCell>
|
||||
<TableCell className="endpoints"><Trans>Endpoints</Trans></TableCell>
|
||||
</TableHead>
|
||||
<TableRow
|
||||
key={endpoint.getId()}
|
||||
nowrap
|
||||
onClick={prevDefault(() => showDetails(endpoint.selfLink, false))}
|
||||
>
|
||||
<TableCell className="name">{endpoint.getName()}</TableCell>
|
||||
<TableCell className="endpoints">{ endpoint.toString()}</TableCell>
|
||||
</TableRow>
|
||||
</Table>
|
||||
</div>
|
||||
)
|
||||
|
||||
@ -125,14 +125,14 @@ const SecretKey = (props: SecretKeyProps) => {
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<>
|
||||
secretKeyRef({name}.{key})
|
||||
<Icon
|
||||
className={cssNames("secret-button", { loading })}
|
||||
material="visibility"
|
||||
tooltip={<Trans>Show</Trans>}
|
||||
onClick={showKey}
|
||||
/>
|
||||
</>
|
||||
<Icon
|
||||
className={cssNames("secret-button", { loading })}
|
||||
material="visibility"
|
||||
tooltip={<Trans>Show</Trans>}
|
||||
onClick={showKey}
|
||||
/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@ -174,28 +174,28 @@ export class PodDetails extends React.Component<Props> {
|
||||
</DrawerItem>
|
||||
{ type == "configMap" && (
|
||||
<div>
|
||||
{configMap && (
|
||||
<DrawerItem name={<Trans>Name</Trans>}>
|
||||
<Link
|
||||
to={getDetailsUrl(configMapApi.getUrl({
|
||||
name: configMap,
|
||||
namespace: pod.getNs(),
|
||||
}))}>{configMap}
|
||||
</Link>
|
||||
</DrawerItem>
|
||||
)}
|
||||
{configMap && (
|
||||
<DrawerItem name={<Trans>Name</Trans>}>
|
||||
<Link
|
||||
to={getDetailsUrl(configMapApi.getUrl({
|
||||
name: configMap,
|
||||
namespace: pod.getNs(),
|
||||
}))}>{configMap}
|
||||
</Link>
|
||||
</DrawerItem>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{ type === "emptyDir" && (
|
||||
<div>
|
||||
{ volume.emptyDir.medium && (
|
||||
<DrawerItem name={<Trans>Medium</Trans>}>
|
||||
{volume.emptyDir.medium}
|
||||
</DrawerItem>
|
||||
<DrawerItem name={<Trans>Medium</Trans>}>
|
||||
{volume.emptyDir.medium}
|
||||
</DrawerItem>
|
||||
)}
|
||||
{ volume.emptyDir.sizeLimit && (
|
||||
<DrawerItem name={<Trans>Size Limit</Trans>}>
|
||||
{volume.emptyDir.sizeLimit}
|
||||
{volume.emptyDir.sizeLimit}
|
||||
</DrawerItem>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@ -81,7 +81,7 @@ export class Workloads extends React.Component<Props> {
|
||||
})
|
||||
}
|
||||
return routes;
|
||||
};
|
||||
}
|
||||
|
||||
render() {
|
||||
const tabRoutes = Workloads.tabRoutes;
|
||||
|
||||
@ -44,7 +44,7 @@ class App extends React.Component {
|
||||
|
||||
// render app
|
||||
render(<App/>, App.rootElem);
|
||||
};
|
||||
}
|
||||
|
||||
render() {
|
||||
const homeUrl = (isAllowedResource(["events", "nodes", "pods"])) ? clusterURL() : workloadsURL();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user