mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
cluster-view battling -- part 3
Signed-off-by: Roman <ixrock@gmail.com> Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
1 parent
09c765cab0
commit
2287332f8b
7 files changed
+11
-23
No files matched your search
@@ -31,14 +31,13 @@ import { isAllowedResource } from "../../common/rbac";
|
||||
import { ClusterSettings, clusterSettingsRoute } from "./+cluster-settings";
|
||||
import { ErrorBoundary } from "./error-boundary";
|
||||
import { Terminal } from "./dock/terminal";
|
||||
import { getHostedClusterId } from "../../common/cluster-store";
|
||||
import { clusterIpc } from "../../common/cluster-ipc";
|
||||
import { getHostedCluster } from "../../common/cluster-store";
|
||||
|
||||
@observer
|
||||
export class App extends React.Component {
|
||||
static async init() {
|
||||
await clusterIpc.init.invokeFromRenderer(getHostedClusterId())
|
||||
await Terminal.preloadFonts()
|
||||
await getHostedCluster().whenInitialized;
|
||||
}
|
||||
|
||||
get startURL() {
|
||||
|
||||
@@ -44,7 +44,7 @@ export class ClusterStatus extends React.Component<Props> {
|
||||
error: res.error,
|
||||
});
|
||||
})
|
||||
await this.refreshClusterState();
|
||||
// await this.refreshClusterState();
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
|
||||
@@ -39,8 +39,10 @@ export class ClusterView extends React.Component {
|
||||
webview.setAttribute("src", `//${clusterId}.${location.host}`)
|
||||
webview.setAttribute("nodeintegration", "true")
|
||||
webview.setAttribute("enableremotemodule", "true")
|
||||
// webview.addEventListener("did-start-loading", () => {
|
||||
// webview.openDevTools();
|
||||
// });
|
||||
webview.addEventListener("did-finish-load", () => {
|
||||
webview.openDevTools();
|
||||
webview.classList.add("loaded");
|
||||
ClusterView.isLoaded.set(clusterId, true)
|
||||
});
|
||||
@@ -52,9 +54,11 @@ export class ClusterView extends React.Component {
|
||||
}
|
||||
|
||||
activateView = async (clusterId: ClusterId) => {
|
||||
const cluster = clusterStore.getById(clusterId);
|
||||
const view = ClusterView.views.get(clusterId);
|
||||
const isLoaded = ClusterView.isLoaded.has(clusterId);
|
||||
if (view && isLoaded && this.placeholder) {
|
||||
cluster.pushState(); // fixme
|
||||
this.placeholder.replaceWith(view);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user