mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
added landing-page
Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
parent
d20e61b3e2
commit
717dfff851
@ -47,7 +47,7 @@ export default {
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background: #282b2f url(../assets/img/crane.svg) no-repeat;
|
background: #282b2f url(../../components/icon/crane.svg) no-repeat;
|
||||||
background-position: 0px 35%;
|
background-position: 0px 35%;
|
||||||
background-size: 85%;
|
background-size: 85%;
|
||||||
background-clip: content-box;
|
background-clip: content-box;
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md whats-new-text-wrapper">
|
<div class="col-md whats-new-text-wrapper">
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<img src="../assets/img/lens-logo.svg">
|
<img src="../../components/icon/lens-logo.svg">
|
||||||
</div>
|
</div>
|
||||||
<!-- Safe to use v-html as we self generate the html locally only -->
|
<!-- Safe to use v-html as we self generate the html locally only -->
|
||||||
<!-- eslint-disable-next-line vue/no-v-html -->
|
<!-- eslint-disable-next-line vue/no-v-html -->
|
||||||
@ -59,7 +59,7 @@ export default {
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
background: #282b2f url(../assets/img/crane.svg) no-repeat;
|
background: #282b2f url(../../components/icon/crane.svg) no-repeat;
|
||||||
background-position: 0px 35%;
|
background-position: 0px 35%;
|
||||||
background-size: 85%;
|
background-size: 85%;
|
||||||
background-clip: content-box;
|
background-clip: content-box;
|
||||||
|
|||||||
@ -1 +1,2 @@
|
|||||||
|
export * from "./landing-page.route"
|
||||||
export * from "./landing-page"
|
export * from "./landing-page"
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
import { RouteProps } from "react-router";
|
||||||
|
import { buildURL } from "../../navigation";
|
||||||
|
|
||||||
|
export const landingRoute: RouteProps = {
|
||||||
|
path: "/landing"
|
||||||
|
}
|
||||||
|
|
||||||
|
export const landingURL = buildURL(landingRoute.path)
|
||||||
@ -1,3 +1,15 @@
|
|||||||
.LandingPage {
|
.LandingPage {
|
||||||
|
height: 100%;
|
||||||
|
background: #282b2f url(../../components/icon/crane.svg) no-repeat;
|
||||||
|
background-position: 0 35%;
|
||||||
|
background-size: 85%;
|
||||||
|
background-clip: content-box;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
color: white;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 28px;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -1,13 +1,25 @@
|
|||||||
import "./landing-page.scss"
|
import "./landing-page.scss"
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
|
import { clusterStore } from "../../../common/cluster-store";
|
||||||
|
import { Trans } from "@lingui/macro";
|
||||||
|
|
||||||
@observer
|
@observer
|
||||||
export class LandingPage extends React.Component {
|
export class LandingPage extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
|
const noClusters = !clusterStore.clusters.size;
|
||||||
return (
|
return (
|
||||||
<div className="LandingPage">
|
<div className="LandingPage flex">
|
||||||
LandingPage
|
{noClusters && (
|
||||||
|
<div className="no-clusters flex column gaps box center">
|
||||||
|
<h1>
|
||||||
|
<Trans>Welcome!</Trans>
|
||||||
|
</h1>
|
||||||
|
<p>
|
||||||
|
<Trans>Get started by associating one or more clusters to Lens.</Trans>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,7 +31,7 @@ import { CustomResources } from "./+custom-resources/custom-resources";
|
|||||||
import { crdRoute } from "./+custom-resources";
|
import { crdRoute } from "./+custom-resources";
|
||||||
import { isAllowedResource } from "../api/rbac";
|
import { isAllowedResource } from "../api/rbac";
|
||||||
import { AddCluster, addClusterRoute } from "./+add-cluster";
|
import { AddCluster, addClusterRoute } from "./+add-cluster";
|
||||||
import { LandingPage } from "./+landing-page";
|
import { LandingPage, landingRoute } from "./+landing-page";
|
||||||
import { clusterStore } from "../../common/cluster-store";
|
import { clusterStore } from "../../common/cluster-store";
|
||||||
import { ClusterSettings, clusterSettingsRoute } from "./+cluster-settings";
|
import { ClusterSettings, clusterSettingsRoute } from "./+cluster-settings";
|
||||||
|
|
||||||
@ -46,13 +46,14 @@ export class App extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const showLanding = clusterStore.clusters.size === 0;
|
const noClusters = clusterStore.clusters.size === 0;
|
||||||
const homeUrl = isAllowedResource(["events", "nodes", "pods"]) ? clusterURL() : workloadsURL();
|
const homeUrl = isAllowedResource(["events", "nodes", "pods"]) ? clusterURL() : workloadsURL();
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<Switch>
|
<Switch>
|
||||||
<Switch>
|
<Switch>
|
||||||
{showLanding && <Route component={LandingPage}/>}
|
{noClusters && <Route component={LandingPage}/>}
|
||||||
|
<Route component={LandingPage} {...landingRoute}/>
|
||||||
<Route component={AddCluster} {...addClusterRoute}/>
|
<Route component={AddCluster} {...addClusterRoute}/>
|
||||||
<Route component={ClusterSettings} {...clusterSettingsRoute}/>
|
<Route component={ClusterSettings} {...clusterSettingsRoute}/>
|
||||||
<Route component={Cluster} {...clusterRoute}/>
|
<Route component={Cluster} {...clusterRoute}/>
|
||||||
|
|||||||
@ -15,6 +15,7 @@ import { Badge } from "../badge";
|
|||||||
import { navigate } from "../../navigation";
|
import { navigate } from "../../navigation";
|
||||||
import { addClusterURL } from "../+add-cluster";
|
import { addClusterURL } from "../+add-cluster";
|
||||||
import { clusterSettingsURL } from "../+cluster-settings";
|
import { clusterSettingsURL } from "../+cluster-settings";
|
||||||
|
import { landingURL } from "../+landing-page";
|
||||||
|
|
||||||
// fixme: allow to rearrange clusters with drag&drop
|
// fixme: allow to rearrange clusters with drag&drop
|
||||||
// fixme: make add-icon's tooltip visible on init
|
// fixme: make add-icon's tooltip visible on init
|
||||||
@ -45,12 +46,13 @@ export class ClustersMenu extends React.Component<Props> {
|
|||||||
label: _i18n._(t`Settings`),
|
label: _i18n._(t`Settings`),
|
||||||
click: () => navigate(clusterSettingsURL())
|
click: () => navigate(clusterSettingsURL())
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
// fixme: disconnect cluster
|
||||||
if (cluster.initialized) {
|
if (cluster.initialized) {
|
||||||
menu.append(new MenuItem({
|
menu.append(new MenuItem({
|
||||||
label: _i18n._(t`Disconnect`),
|
label: _i18n._(t`Disconnect`),
|
||||||
click: () => {
|
click: () => {
|
||||||
console.log(`//fixme: disconnect cluster`, cluster);
|
navigate(landingURL());
|
||||||
navigate("/");
|
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Loading…
Reference in New Issue
Block a user