mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
moar random fixes
Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
parent
a57be8eb01
commit
45c65610b9
@ -15,8 +15,9 @@ import { getKubeConfigLocal, loadConfig, saveConfigToAppFiles, splitConfig, vali
|
|||||||
import { clusterStore } from "../../../common/cluster-store";
|
import { clusterStore } from "../../../common/cluster-store";
|
||||||
import { workspaceStore } from "../../../common/workspace-store";
|
import { workspaceStore } from "../../../common/workspace-store";
|
||||||
import { v4 as uuid } from "uuid"
|
import { v4 as uuid } from "uuid"
|
||||||
import { navigation } from "../../navigation";
|
import { navigate } from "../../navigation";
|
||||||
import { userStore } from "../../../common/user-store";
|
import { userStore } from "../../../common/user-store";
|
||||||
|
import { clusterViewURL } from "../cluster-manager/cluster-view.route";
|
||||||
|
|
||||||
@observer
|
@observer
|
||||||
export class AddCluster extends React.Component {
|
export class AddCluster extends React.Component {
|
||||||
@ -102,7 +103,7 @@ export class AddCluster extends React.Component {
|
|||||||
httpsProxy: proxyServer || undefined,
|
httpsProxy: proxyServer || undefined,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
navigation.goBack(); // return to previous opened page for the cluster view
|
navigate(clusterViewURL({ params: { clusterId } }))
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.error = String(err);
|
this.error = String(err);
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@ -70,9 +70,9 @@ export class App extends React.Component {
|
|||||||
<Redirect exact from="/" to={this.startURL}/>
|
<Redirect exact from="/" to={this.startURL}/>
|
||||||
<Route component={NotFound}/>
|
<Route component={NotFound}/>
|
||||||
</Switch>
|
</Switch>
|
||||||
<KubeObjectDetails/>
|
|
||||||
<Notifications/>
|
<Notifications/>
|
||||||
<ConfirmDialog/>
|
<ConfirmDialog/>
|
||||||
|
<KubeObjectDetails/>
|
||||||
<KubeConfigDialog/>
|
<KubeConfigDialog/>
|
||||||
<AddRoleBindingDialog/>
|
<AddRoleBindingDialog/>
|
||||||
<PodLogsDialog/>
|
<PodLogsDialog/>
|
||||||
|
|||||||
@ -9,6 +9,10 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
grid-area: main;
|
grid-area: main;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
|
> * {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#lens-views {
|
#lens-views {
|
||||||
|
|||||||
@ -22,12 +22,8 @@ export class ClusterStatus extends React.Component<Props> {
|
|||||||
@observable authOutput: KubeAuthProxyLog[] = [];
|
@observable authOutput: KubeAuthProxyLog[] = [];
|
||||||
@observable isReconnecting = false;
|
@observable isReconnecting = false;
|
||||||
|
|
||||||
@computed get clusterId() {
|
get cluster(): Cluster {
|
||||||
return this.props.clusterId;
|
return clusterStore.getById(this.props.clusterId);
|
||||||
}
|
|
||||||
|
|
||||||
@computed get cluster(): Cluster {
|
|
||||||
return clusterStore.getById(this.clusterId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@computed get hasErrors(): boolean {
|
@computed get hasErrors(): boolean {
|
||||||
@ -45,15 +41,17 @@ export class ClusterStatus extends React.Component<Props> {
|
|||||||
error: res.error,
|
error: res.error,
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
await this.refreshCluster();
|
if (!this.cluster.initialized) {
|
||||||
|
await this.refreshCluster();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
ipcRenderer.removeAllListeners(`kube-auth:${this.clusterId}`);
|
ipcRenderer.removeAllListeners(`kube-auth:${this.cluster.id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
refreshCluster = async () => {
|
refreshCluster = async () => {
|
||||||
await clusterIpc.activate.invokeFromRenderer(this.clusterId);
|
await clusterIpc.activate.invokeFromRenderer(this.cluster.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
reconnect = async () => {
|
reconnect = async () => {
|
||||||
|
|||||||
@ -13,7 +13,7 @@ export class ClusterView extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div className="ClusterView flex column">
|
<div className="ClusterView flex column">
|
||||||
{showStatus && (
|
{showStatus && (
|
||||||
<ClusterStatus clusterId={cluster.id} className="box center"/>
|
<ClusterStatus key={cluster.id} clusterId={cluster.id} className="box center"/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@ -69,7 +69,10 @@ export class ClustersMenu extends React.Component<Props> {
|
|||||||
accent: true,
|
accent: true,
|
||||||
label: _i18n._(t`Remove`),
|
label: _i18n._(t`Remove`),
|
||||||
},
|
},
|
||||||
ok: () => clusterStore.removeById(cluster.id),
|
ok: () => {
|
||||||
|
clusterStore.removeById(cluster.id);
|
||||||
|
navigate(landingURL());
|
||||||
|
},
|
||||||
message: <p>Are you sure want to remove cluster <b title={cluster.id}>{cluster.contextName}</b>?</p>,
|
message: <p>Are you sure want to remove cluster <b title={cluster.id}>{cluster.contextName}</b>?</p>,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,6 +9,8 @@ import { _i18n } from "./i18n";
|
|||||||
import { ClusterManager } from "./components/cluster-manager";
|
import { ClusterManager } from "./components/cluster-manager";
|
||||||
import { ErrorBoundary } from "./components/error-boundary";
|
import { ErrorBoundary } from "./components/error-boundary";
|
||||||
import { WhatsNew, whatsNewRoute } from "./components/+whats-new";
|
import { WhatsNew, whatsNewRoute } from "./components/+whats-new";
|
||||||
|
import { Notifications } from "./components/notifications";
|
||||||
|
import { ConfirmDialog } from "./components/confirm-dialog";
|
||||||
|
|
||||||
@observer
|
@observer
|
||||||
export class LensApp extends React.Component {
|
export class LensApp extends React.Component {
|
||||||
@ -23,6 +25,8 @@ export class LensApp extends React.Component {
|
|||||||
<Route component={ClusterManager}/>
|
<Route component={ClusterManager}/>
|
||||||
</Switch>
|
</Switch>
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
|
<Notifications/>
|
||||||
|
<ConfirmDialog/>
|
||||||
</Router>
|
</Router>
|
||||||
</I18nProvider>
|
</I18nProvider>
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user