1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

added original landing page back only for default workspace with no clusters

Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com>
This commit is contained in:
Jim Ehrismann 2021-03-05 19:30:41 -05:00
parent 9d9d4ace27
commit 37d6636d01
2 changed files with 55 additions and 10 deletions

View File

@ -1,6 +1,27 @@
.PageLayout.LandingPage {
--width: 80%;
.LandingPage {
width: 100%;
height: 100%;
text-align: center;
z-index: 0;
&::after {
content: "";
background: url(../../components/icon/crane.svg) no-repeat;
background-position: 0 35%;
background-size: 85%;
background-clip: content-box;
opacity: .75;
top: 0;
left: 0;
bottom: 0;
right: 0;
position: absolute;
z-index: -1;
.theme-light & {
opacity: 0.2;
}
}
.startup-hint {
$bgc: $mainBackground;
@ -36,4 +57,9 @@
}
}
}
}
.PageLayout.LandingOverview {
--width: 80%;
text-align: center;
}

View File

@ -14,7 +14,18 @@ export class LandingPage extends React.Component {
get workspace(): Workspace {
return workspaceStore.currentWorkspace;
}
renderStartupHint() {
return (
<div className="startup-hint flex column gaps" onMouseEnter={() => this.showHint = false}>
<p>This is the quick launch menu.</p>
<p>
Associate clusters and choose the ones you want to access via quick launch menu by clicking the + button.
</p>
</div>
)
}
render() {
const clusters = clusterStore.getByWorkspaceId(this.workspace.id);
const noClustersInScope = !clusters.length;
@ -22,16 +33,24 @@ export class LandingPage extends React.Component {
const header = <h2>Workspace: {this.workspace.name}</h2>;
return (
<PageLayout className="LandingPage flex column gaps" header={header} provideBackButtonNavigation={false} contentGaps={false}>
{showStartupHint && (
<div className="startup-hint flex column gaps" onMouseEnter={() => this.showHint = false}>
<p>This is the quick launch menu.</p>
if (this.workspace.name === "default" && noClustersInScope) {
return (
<div className="LandingPage flex">
{showStartupHint && this.renderStartupHint()}
<div className="no-clusters flex column gaps box center">
<h1>
Welcome!
</h1>
<p>
Associate clusters and choose the ones you want to access via quick launch menu by clicking the + button.
Get started by associating one or more clusters to Lens.
</p>
</div>
)}
</div>
)
}
return (
<PageLayout className="LandingOverview flex column gaps" header={header} provideBackButtonNavigation={false} contentGaps={false}>
<WorkspaceOverview workspace={this.workspace}/>
</PageLayout>
);