mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Enforce semicolons in eslint
Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
This commit is contained in:
1 parent
0f3f5611ba
commit
1477bb8274
531 files changed
+3979
-3975
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import "./bottom-bar.scss"
|
||||
import "./bottom-bar.scss";
|
||||
|
||||
import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
@@ -23,10 +23,10 @@ export class BottomBar extends React.Component {
|
||||
<div className="extensions box grow flex gaps justify-flex-end">
|
||||
{statusBarRegistry.getItems().map(({ item }, index) => {
|
||||
if (!item) return;
|
||||
return <React.Fragment key={index}>{item}</React.Fragment>
|
||||
return <React.Fragment key={index}>{item}</React.Fragment>;
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import "./cluster-manager.scss"
|
||||
import "./cluster-manager.scss";
|
||||
|
||||
import React from "react";
|
||||
import { Redirect, Route, Switch } from "react-router";
|
||||
@@ -37,7 +37,7 @@ export class ClusterManager extends React.Component {
|
||||
fireImmediately: true,
|
||||
equals: comparer.shallow,
|
||||
}),
|
||||
])
|
||||
]);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
@@ -51,9 +51,9 @@ export class ClusterManager extends React.Component {
|
||||
params: {
|
||||
clusterId: activeClusterId
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
return landingURL()
|
||||
return landingURL();
|
||||
}
|
||||
|
||||
render() {
|
||||
@@ -70,7 +70,7 @@ export class ClusterManager extends React.Component {
|
||||
<Route component={ClusterView} {...clusterViewRoute} />
|
||||
<Route component={ClusterSettings} {...clusterSettingsRoute} />
|
||||
{globalPageRegistry.getItems().map(({ routePath, exact, components: { Page } }) => {
|
||||
return <Route key={routePath} path={routePath} component={Page} exact={exact}/>
|
||||
return <Route key={routePath} path={routePath} component={Page} exact={exact}/>;
|
||||
})}
|
||||
<Redirect exact to={this.startUrl}/>
|
||||
</Switch>
|
||||
@@ -78,6 +78,6 @@ export class ClusterManager extends React.Component {
|
||||
<ClustersMenu/>
|
||||
<BottomBar/>
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { KubeAuthProxyLog } from "../../../main/kube-auth-proxy";
|
||||
|
||||
import "./cluster-status.scss"
|
||||
import "./cluster-status.scss";
|
||||
import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { ipcRenderer } from "electron";
|
||||
@@ -38,7 +38,7 @@ export class ClusterStatus extends React.Component<Props> {
|
||||
data: res.data.trimRight(),
|
||||
error: res.error,
|
||||
});
|
||||
})
|
||||
});
|
||||
if (this.cluster.disconnected) {
|
||||
await this.activateCluster();
|
||||
}
|
||||
@@ -49,11 +49,11 @@ export class ClusterStatus extends React.Component<Props> {
|
||||
}
|
||||
|
||||
activateCluster = async (force = false) => {
|
||||
await requestMain(clusterActivateHandler, this.props.clusterId, force)
|
||||
await requestMain(clusterActivateHandler, this.props.clusterId, force);
|
||||
}
|
||||
|
||||
reconnect = async () => {
|
||||
this.authOutput = []
|
||||
this.authOutput = [];
|
||||
this.isReconnecting = true;
|
||||
await this.activateCluster(true);
|
||||
this.isReconnecting = false;
|
||||
@@ -69,7 +69,7 @@ export class ClusterStatus extends React.Component<Props> {
|
||||
<pre className="kube-auth-out">
|
||||
<p>{this.isReconnecting ? "Reconnecting..." : "Connecting..."}</p>
|
||||
{authOutput.map(({ data, error }, index) => {
|
||||
return <p key={index} className={cssNames({ error })}>{data}</p>
|
||||
return <p key={index} className={cssNames({ error })}>{data}</p>;
|
||||
})}
|
||||
</pre>
|
||||
</>
|
||||
@@ -83,7 +83,7 @@ export class ClusterStatus extends React.Component<Props> {
|
||||
</h2>
|
||||
<pre className="kube-auth-out">
|
||||
{authOutput.map(({ data, error }, index) => {
|
||||
return <p key={index} className={cssNames({ error })}>{data}</p>
|
||||
return <p key={index} className={cssNames({ error })}>{data}</p>;
|
||||
})}
|
||||
</pre>
|
||||
{failureReason && (
|
||||
|
||||
@@ -8,6 +8,6 @@ export interface IClusterViewRouteParams {
|
||||
export const clusterViewRoute: RouteProps = {
|
||||
exact: true,
|
||||
path: "/cluster/:clusterId",
|
||||
}
|
||||
};
|
||||
|
||||
export const clusterViewURL = buildURL<IClusterViewRouteParams>(clusterViewRoute.path)
|
||||
export const clusterViewURL = buildURL<IClusterViewRouteParams>(clusterViewRoute.path);
|
||||
@@ -1,4 +1,4 @@
|
||||
import "./cluster-view.scss"
|
||||
import "./cluster-view.scss";
|
||||
import React from "react";
|
||||
import { reaction } from "mobx";
|
||||
import { disposeOnUnmount, observer } from "mobx-react";
|
||||
@@ -27,18 +27,18 @@ export class ClusterView extends React.Component<Props> {
|
||||
reaction(() => this.clusterId, clusterId => clusterStore.setActive(clusterId), {
|
||||
fireImmediately: true,
|
||||
})
|
||||
])
|
||||
]);
|
||||
}
|
||||
|
||||
render() {
|
||||
const { cluster } = this;
|
||||
const showStatus = cluster && (!cluster.available || !hasLoadedView(cluster.id) || !cluster.ready)
|
||||
const showStatus = cluster && (!cluster.available || !hasLoadedView(cluster.id) || !cluster.ready);
|
||||
return (
|
||||
<div className="ClusterView flex align-center">
|
||||
{showStatus && (
|
||||
<ClusterStatus key={cluster.id} clusterId={cluster.id} className="box center"/>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import "./clusters-menu.scss"
|
||||
import "./clusters-menu.scss";
|
||||
|
||||
import React from "react";
|
||||
import { remote } from "electron"
|
||||
import { remote } from "electron";
|
||||
import { requestMain } from "../../../common/ipc";
|
||||
import type { Cluster } from "../../../main/cluster";
|
||||
import { DragDropContext, Draggable, DraggableProvided, Droppable, DroppableProvided, DropResult } from "react-beautiful-dnd";
|
||||
@@ -40,7 +40,7 @@ export class ClustersMenu extends React.Component<Props> {
|
||||
}
|
||||
|
||||
showContextMenu = (cluster: Cluster) => {
|
||||
const { Menu, MenuItem } = remote
|
||||
const { Menu, MenuItem } = remote;
|
||||
const menu = new Menu();
|
||||
|
||||
menu.append(new MenuItem({
|
||||
@@ -50,7 +50,7 @@ export class ClustersMenu extends React.Component<Props> {
|
||||
params: {
|
||||
clusterId: cluster.id
|
||||
}
|
||||
}))
|
||||
}));
|
||||
}
|
||||
}));
|
||||
if (cluster.online) {
|
||||
@@ -61,9 +61,9 @@ export class ClustersMenu extends React.Component<Props> {
|
||||
navigate(landingURL());
|
||||
clusterStore.setActive(null);
|
||||
}
|
||||
await requestMain(clusterDisconnectHandler, cluster.id)
|
||||
await requestMain(clusterDisconnectHandler, cluster.id);
|
||||
}
|
||||
}))
|
||||
}));
|
||||
}
|
||||
menu.append(new MenuItem({
|
||||
label: _i18n._(t`Remove`),
|
||||
@@ -81,12 +81,12 @@ export class ClustersMenu extends React.Component<Props> {
|
||||
clusterStore.removeById(cluster.id);
|
||||
},
|
||||
message: <p>Are you sure want to remove cluster <b title={cluster.id}>{cluster.contextName}</b>?</p>,
|
||||
})
|
||||
});
|
||||
}
|
||||
}));
|
||||
menu.popup({
|
||||
window: remote.getCurrentWindow()
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
@autobind()
|
||||
@@ -96,17 +96,17 @@ export class ClustersMenu extends React.Component<Props> {
|
||||
const {
|
||||
source: { index: from },
|
||||
destination: { index: to },
|
||||
} = result
|
||||
clusterStore.swapIconOrders(currentWorkspaceId, from, to)
|
||||
} = result;
|
||||
clusterStore.swapIconOrders(currentWorkspaceId, from, to);
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { className } = this.props
|
||||
const { newContexts } = userStore
|
||||
const workspace = workspaceStore.getById(workspaceStore.currentWorkspaceId)
|
||||
const clusters = clusterStore.getByWorkspaceId(workspace.id)
|
||||
const activeClusterId = clusterStore.activeCluster
|
||||
const { className } = this.props;
|
||||
const { newContexts } = userStore;
|
||||
const workspace = workspaceStore.getById(workspaceStore.currentWorkspaceId);
|
||||
const clusters = clusterStore.getByWorkspaceId(workspace.id);
|
||||
const activeClusterId = clusterStore.activeCluster;
|
||||
return (
|
||||
<div className={cssNames("ClustersMenu flex column", className)}>
|
||||
<div className="clusters flex column gaps">
|
||||
@@ -131,7 +131,7 @@ export class ClustersMenu extends React.Component<Props> {
|
||||
</div>
|
||||
)}
|
||||
</Draggable>
|
||||
)
|
||||
);
|
||||
})}
|
||||
{placeholder}
|
||||
</div>
|
||||
@@ -162,7 +162,7 @@ export class ClustersMenu extends React.Component<Props> {
|
||||
active={isActive}
|
||||
onClick={() => navigate(pageUrl)}
|
||||
/>
|
||||
)
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1 +1 @@
|
||||
export * from "./cluster-manager"
|
||||
export * from "./cluster-manager";
|
||||
@@ -23,13 +23,13 @@ export async function initView(clusterId: ClusterId) {
|
||||
if (!cluster) {
|
||||
return;
|
||||
}
|
||||
logger.info(`[LENS-VIEW]: init dashboard, clusterId=${clusterId}`)
|
||||
logger.info(`[LENS-VIEW]: init dashboard, clusterId=${clusterId}`);
|
||||
const parentElem = document.getElementById("lens-views");
|
||||
const iframe = document.createElement("iframe");
|
||||
iframe.name = cluster.contextName;
|
||||
iframe.setAttribute("src", getClusterFrameUrl(clusterId))
|
||||
iframe.setAttribute("src", getClusterFrameUrl(clusterId));
|
||||
iframe.addEventListener("load", () => {
|
||||
logger.info(`[LENS-VIEW]: loaded from ${iframe.src}`)
|
||||
logger.info(`[LENS-VIEW]: loaded from ${iframe.src}`);
|
||||
lensViews.get(clusterId).isLoaded = true;
|
||||
}, { once: true });
|
||||
lensViews.set(clusterId, { clusterId, view: iframe });
|
||||
@@ -39,15 +39,15 @@ export async function initView(clusterId: ClusterId) {
|
||||
|
||||
export async function autoCleanOnRemove(clusterId: ClusterId, iframe: HTMLIFrameElement) {
|
||||
await when(() => !clusterStore.getById(clusterId));
|
||||
logger.info(`[LENS-VIEW]: remove dashboard, clusterId=${clusterId}`)
|
||||
lensViews.delete(clusterId)
|
||||
logger.info(`[LENS-VIEW]: remove dashboard, clusterId=${clusterId}`);
|
||||
lensViews.delete(clusterId);
|
||||
|
||||
// Keep frame in DOM to avoid possible bugs when same cluster re-created after being removed.
|
||||
// In that case for some reasons `webFrame.routingId` returns some previous frameId (usage in app.tsx)
|
||||
// Issue: https://github.com/lensapp/lens/issues/811
|
||||
iframe.dataset.meta = `${iframe.name} was removed at ${new Date().toLocaleString()}`
|
||||
iframe.removeAttribute("name")
|
||||
iframe.contentWindow.postMessage("teardown", "*")
|
||||
iframe.dataset.meta = `${iframe.name} was removed at ${new Date().toLocaleString()}`;
|
||||
iframe.removeAttribute("name");
|
||||
iframe.contentWindow.postMessage("teardown", "*");
|
||||
}
|
||||
|
||||
export function refreshViews() {
|
||||
@@ -56,6 +56,6 @@ export function refreshViews() {
|
||||
const isCurrent = clusterId === cluster?.id;
|
||||
const isReady = cluster?.available && cluster?.ready;
|
||||
const isVisible = isCurrent && isLoaded && isReady;
|
||||
view.style.display = isVisible ? "flex" : "none"
|
||||
})
|
||||
view.style.display = isVisible ? "flex" : "none";
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user