mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
cluster-status -- part 3
Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
parent
323a4c141e
commit
7356abc762
@ -33,6 +33,7 @@ export class ClusterManager {
|
|||||||
this.activeClusterId = activeCluster.id;
|
this.activeClusterId = activeCluster.id;
|
||||||
activeCluster.bindEvents();
|
activeCluster.bindEvents();
|
||||||
activeCluster.refreshStatus();
|
activeCluster.refreshStatus();
|
||||||
|
activeCluster.pushState();
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
fireImmediately: true
|
fireImmediately: true
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import "./cluster-manager.scss"
|
import "./cluster-manager.scss"
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
import { computed } from "mobx";
|
import { computed, observable } from "mobx";
|
||||||
import { App } from "../app";
|
import { App } from "../app";
|
||||||
import { ClusterStatus } from "./cluster-status";
|
import { ClusterStatus } from "./cluster-status";
|
||||||
import { ClustersMenu } from "./clusters-menu";
|
import { ClustersMenu } from "./clusters-menu";
|
||||||
@ -18,23 +18,27 @@ interface Props {
|
|||||||
|
|
||||||
@observer
|
@observer
|
||||||
export class ClusterManager extends React.Component<Props> {
|
export class ClusterManager extends React.Component<Props> {
|
||||||
@computed get isReady() {
|
@observable appReady = false;
|
||||||
|
|
||||||
|
@computed get clusterReady() {
|
||||||
return clusterStore.activeCluster?.isReady
|
return clusterStore.activeCluster?.isReady
|
||||||
}
|
}
|
||||||
|
|
||||||
async componentDidMount() {
|
async componentDidMount() {
|
||||||
await invokeIpc(ClusterIpcChannel.INIT)
|
invokeIpc(ClusterIpcChannel.INIT);
|
||||||
await App.init();
|
await App.init();
|
||||||
|
this.appReady = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { className, contentClass } = this.props;
|
const { className, contentClass } = this.props;
|
||||||
|
const isReady = this.appReady && this.clusterReady;
|
||||||
return (
|
return (
|
||||||
<div className={cssNames("ClusterManager", className)}>
|
<div className={cssNames("ClusterManager", className)}>
|
||||||
<div id="draggable-top"/>
|
<div id="draggable-top"/>
|
||||||
<div id="lens-view" className={cssNames("flex", contentClass)}>
|
<div id="lens-view" className={cssNames("flex column", contentClass)}>
|
||||||
{this.isReady && <App/>}
|
{isReady && <App/>}
|
||||||
{!this.isReady && <ClusterStatus/>}
|
{!isReady && <ClusterStatus/>}
|
||||||
</div>
|
</div>
|
||||||
<ClustersMenu/>
|
<ClustersMenu/>
|
||||||
<BottomBar/>
|
<BottomBar/>
|
||||||
|
|||||||
@ -6,10 +6,9 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
pre {
|
pre {
|
||||||
@include custom-scrollbar;
|
@include hidden-scrollbar;
|
||||||
max-width: 70vw;
|
max-width: 70vw;
|
||||||
max-height: 40vh;
|
max-height: 40vh;
|
||||||
//text-align: left;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.Icon {
|
.Icon {
|
||||||
|
|||||||
@ -18,14 +18,14 @@ import { Preferences, preferencesRoute } from "./components/+preferences";
|
|||||||
@observer
|
@observer
|
||||||
class LensApp extends React.Component {
|
class LensApp extends React.Component {
|
||||||
static async init() {
|
static async init() {
|
||||||
|
const rootElem = document.getElementById("app");
|
||||||
|
rootElem.classList.toggle("is-mac", isMac);
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
userStore.load(),
|
userStore.load(),
|
||||||
workspaceStore.load(),
|
workspaceStore.load(),
|
||||||
clusterStore.load(),
|
clusterStore.load(),
|
||||||
]);
|
]);
|
||||||
const elem = document.getElementById("app");
|
render(<LensApp/>, rootElem);
|
||||||
elem.classList.toggle("is-mac", isMac);
|
|
||||||
render(<LensApp/>, elem);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user