mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Using WizardLayout at extension page
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
2b4e85397c
commit
31911f5cba
@ -1,8 +1,4 @@
|
|||||||
.Extensions {
|
.Extensions {
|
||||||
.content {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.Badge.extension {
|
.Badge.extension {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
@ -13,4 +9,8 @@
|
|||||||
padding-bottom: $padding;
|
padding-bottom: $padding;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.info-col {
|
||||||
|
flex: 0.6;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -1,30 +1,34 @@
|
|||||||
import "./extensions.scss";
|
import "./extensions.scss";
|
||||||
|
|
||||||
import React from "react";
|
import React, { Fragment } from "react";
|
||||||
import { Trans } from "@lingui/macro";
|
import { Trans } from "@lingui/macro";
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
import { PageLayout } from "../layout/page-layout";
|
|
||||||
import { Badge } from "../badge";
|
import { Badge } from "../badge";
|
||||||
import { Button } from "../button";
|
import { Button } from "../button";
|
||||||
|
import { extensionLoader } from "../../../extensions/extension-loader";
|
||||||
|
import { WizardLayout } from "../layout/wizard-layout";
|
||||||
|
|
||||||
@observer
|
@observer
|
||||||
export class Extensions extends React.Component {
|
export class Extensions extends React.Component {
|
||||||
disable() {
|
disable(name: string) {
|
||||||
|
}
|
||||||
|
|
||||||
|
renderInfo() {
|
||||||
|
return (
|
||||||
|
<Fragment>
|
||||||
|
<h2>Lens Extension API</h2>
|
||||||
|
<p>
|
||||||
|
The Extensions API in Lens allows users to customize and enhance the Lens experience by creating their own menus or page content that is extended from the existing pages. Many of the core features of Lens are built as extensions and use the same Extension API.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<a href="https://docs.k8slens.dev/extensions/overview/" target="_blank">Check out documentation to learn more</a>.
|
||||||
|
</p>
|
||||||
|
</Fragment>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
renderExtensions() {
|
renderExtensions() {
|
||||||
const extensions = [
|
const extensions = extensionLoader.userExtensions;
|
||||||
{
|
|
||||||
id: "1",
|
|
||||||
name: "hello-world",
|
|
||||||
description: "Basic hello world example"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "2",
|
|
||||||
name: "light theme",
|
|
||||||
description: "Classic light theme for lens"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
if (!extensions.length) {
|
if (!extensions.length) {
|
||||||
return (
|
return (
|
||||||
<div className="flex align-center box grow justify-center gaps">
|
<div className="flex align-center box grow justify-center gaps">
|
||||||
@ -45,18 +49,23 @@ export class Extensions extends React.Component {
|
|||||||
{description}
|
{description}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Button>Disable</Button>
|
<Button onClick={() => this.disable(name)}>Disable</Button>
|
||||||
</Badge>
|
</Badge>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const header = <h2><Trans>Extensions</Trans></h2>;
|
|
||||||
return (
|
return (
|
||||||
<PageLayout showOnTop className="Extensions" header={header}>
|
<WizardLayout
|
||||||
{this.renderExtensions()}
|
className="Extensions"
|
||||||
</PageLayout>
|
infoPanel={this.renderInfo()}
|
||||||
|
>
|
||||||
|
<h2><Trans>Extensions</Trans></h2>
|
||||||
|
<div className="extension-list">
|
||||||
|
{this.renderExtensions()}
|
||||||
|
</div>
|
||||||
|
</WizardLayout>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user