mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fine-tuning Extensions view
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
848953d224
commit
d77c22689b
@ -1,10 +1,5 @@
|
|||||||
.PageLayout.Extensions {
|
.PageLayout.Extensions {
|
||||||
$spacing: $padding * 2;
|
$spacing: $padding * 2;
|
||||||
--width: 50%;
|
|
||||||
|
|
||||||
h2 {
|
|
||||||
margin-bottom: $padding;
|
|
||||||
}
|
|
||||||
|
|
||||||
.no-extensions {
|
.no-extensions {
|
||||||
--flex-gap: #{$padding};
|
--flex-gap: #{$padding};
|
||||||
@ -16,17 +11,28 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.install-extension {
|
.install-extension {
|
||||||
margin: $spacing * 2 0;
|
margin-bottom: $padding * 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
.installed-extensions {
|
.installed-extensions {
|
||||||
--flex-gap: #{$spacing};
|
--flex-gap: #{$spacing};
|
||||||
|
|
||||||
.extension {
|
.extension {
|
||||||
|
--flex-gap: #{$padding / 2};
|
||||||
|
|
||||||
padding: $padding $spacing;
|
padding: $padding $spacing;
|
||||||
background: $layoutBackground;
|
background: $layoutBackground;
|
||||||
border-radius: $radius;
|
border-radius: $radius;
|
||||||
|
|
||||||
|
.contents {
|
||||||
|
padding-right: $padding * 2;
|
||||||
|
|
||||||
|
.Badge {
|
||||||
|
font-size: smaller;
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.actions > button:not(:last-child) {
|
.actions > button:not(:last-child) {
|
||||||
margin-right: $spacing / 2;
|
margin-right: $spacing / 2;
|
||||||
}
|
}
|
||||||
@ -42,10 +48,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.SearchInput {
|
.SearchInput > label .Icon {
|
||||||
--spacing: 10px;
|
height: 21px; // conform with icons within Install input
|
||||||
|
|
||||||
max-width: none;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -12,12 +12,12 @@ import { extensionLoader } from "../../../extensions/extension-loader";
|
|||||||
import { extensionDisplayName, LensExtensionManifest, sanitizeExtensionName } from "../../../extensions/lens-extension";
|
import { extensionDisplayName, LensExtensionManifest, sanitizeExtensionName } from "../../../extensions/lens-extension";
|
||||||
import logger from "../../../main/logger";
|
import logger from "../../../main/logger";
|
||||||
import { prevDefault } from "../../utils";
|
import { prevDefault } from "../../utils";
|
||||||
|
import { Badge } from "../badge";
|
||||||
import { Button } from "../button";
|
import { Button } from "../button";
|
||||||
import { ConfirmDialog } from "../confirm-dialog";
|
import { ConfirmDialog } from "../confirm-dialog";
|
||||||
import { Icon } from "../icon";
|
import { Icon } from "../icon";
|
||||||
import { DropFileInput, Input, InputValidator, InputValidators, SearchInput } from "../input";
|
import { DropFileInput, Input, InputValidator, InputValidators, SearchInput } from "../input";
|
||||||
import { PageLayout } from "../layout/page-layout";
|
import { PageLayout } from "../layout/page-layout";
|
||||||
import { SubTitle } from "../layout/sub-title";
|
|
||||||
import { Notifications } from "../notifications";
|
import { Notifications } from "../notifications";
|
||||||
import { Spinner } from "../spinner/spinner";
|
import { Spinner } from "../spinner/spinner";
|
||||||
import { TooltipPosition } from "../tooltip";
|
import { TooltipPosition } from "../tooltip";
|
||||||
@ -449,9 +449,11 @@ export class Extensions extends React.Component {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div key={id} className="extension flex gaps align-center">
|
<div key={id} className="extension flex gaps align-center">
|
||||||
<div className="box grow">
|
<div className="contents box grow">
|
||||||
<h5>{name}</h5>
|
<div className="flex gaps align-center">
|
||||||
<h6>{version}</h6>
|
<h5 className="extension-name">{name}</h5>
|
||||||
|
<Badge label={version}/>
|
||||||
|
</div>
|
||||||
<p>{description}</p>
|
<p>{description}</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="actions">
|
<div className="actions">
|
||||||
@ -482,63 +484,67 @@ export class Extensions extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const topHeader = <h2>Manage Lens Extensions</h2>;
|
const topHeader = <h1>Lens Extensions</h1>;
|
||||||
const { installPath } = this;
|
const { installPath } = this;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DropFileInput onDropFiles={this.installOnDrop}>
|
<DropFileInput onDropFiles={this.installOnDrop}>
|
||||||
<PageLayout showOnTop className="Extensions" header={topHeader} contentGaps={false}>
|
<PageLayout showOnTop className="Extensions" header={topHeader} contentGaps={false}>
|
||||||
<h2>Lens Extensions</h2>
|
<section>
|
||||||
<div>
|
<h1>Extensions</h1>
|
||||||
Add new features and functionality via Lens Extensions.
|
<div>
|
||||||
Check out documentation to <a href={`${docsUrl}/latest/extensions/usage/`} target="_blank" rel="noreferrer">learn more</a> or see the list of <a href="https://github.com/lensapp/lens-extensions/blob/main/README.md" target="_blank" rel="noreferrer">available extensions</a>.
|
Add new features and functionality via Lens Extensions.
|
||||||
</div>
|
Check out documentation to <a href={`${docsUrl}/latest/extensions/usage/`} target="_blank" rel="noreferrer">learn more</a> or see the list of <a href="https://github.com/lensapp/lens-extensions/blob/main/README.md" target="_blank" rel="noreferrer">available extensions</a>.
|
||||||
|
|
||||||
<div className="install-extension flex column gaps">
|
|
||||||
<SubTitle title="Install Extension:"/>
|
|
||||||
<div className="extension-input flex box gaps align-center">
|
|
||||||
<Input
|
|
||||||
className="box grow"
|
|
||||||
theme="round-black"
|
|
||||||
disabled={this.isInstalling}
|
|
||||||
placeholder={`Path or URL to an extension package (${Extensions.supportedFormats.join(", ")})`}
|
|
||||||
showErrorsAsTooltip={{ preferredPositions: TooltipPosition.BOTTOM }}
|
|
||||||
validators={installPath ? Extensions.installPathValidator : undefined}
|
|
||||||
value={installPath}
|
|
||||||
onChange={value => this.installPath = value}
|
|
||||||
onSubmit={this.installFromUrlOrPath}
|
|
||||||
iconLeft="link"
|
|
||||||
iconRight={
|
|
||||||
<Icon
|
|
||||||
interactive
|
|
||||||
material="folder"
|
|
||||||
onClick={prevDefault(this.installFromSelectFileDialog)}
|
|
||||||
tooltip="Browse"
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<Button
|
<section className="install-extension">
|
||||||
primary
|
<h2>Install</h2>
|
||||||
label="Install"
|
<div className="extension-input flex box gaps align-center">
|
||||||
disabled={this.isInstalling || !Extensions.installPathValidator.validate(installPath)}
|
<Input
|
||||||
waiting={this.isInstalling}
|
className="box grow"
|
||||||
onClick={this.installFromUrlOrPath}
|
theme="round-black"
|
||||||
/>
|
disabled={this.isInstalling}
|
||||||
<small className="hint">
|
placeholder={`Path or URL to an extension package (${Extensions.supportedFormats.join(", ")})`}
|
||||||
<b>Pro-Tip</b>: you can also drag-n-drop tarball-file to this area
|
showErrorsAsTooltip={{ preferredPositions: TooltipPosition.BOTTOM }}
|
||||||
</small>
|
validators={installPath ? Extensions.installPathValidator : undefined}
|
||||||
</div>
|
value={installPath}
|
||||||
|
onChange={value => this.installPath = value}
|
||||||
|
onSubmit={this.installFromUrlOrPath}
|
||||||
|
iconLeft="link"
|
||||||
|
iconRight={
|
||||||
|
<Icon
|
||||||
|
interactive
|
||||||
|
material="folder"
|
||||||
|
onClick={prevDefault(this.installFromSelectFileDialog)}
|
||||||
|
tooltip="Browse"
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<Button
|
||||||
|
primary
|
||||||
|
label="Install"
|
||||||
|
disabled={this.isInstalling || !Extensions.installPathValidator.validate(installPath)}
|
||||||
|
waiting={this.isInstalling}
|
||||||
|
onClick={this.installFromUrlOrPath}
|
||||||
|
/>
|
||||||
|
<small className="hint">
|
||||||
|
<b>Pro-Tip</b>: you can also drag-n-drop tarball-file to this area
|
||||||
|
</small>
|
||||||
|
</section>
|
||||||
|
|
||||||
<h2>Installed Extensions</h2>
|
<section>
|
||||||
<div className="installed-extensions flex column gaps">
|
<h2>Installed Extensions</h2>
|
||||||
<SearchInput
|
<div className="installed-extensions flex column gaps">
|
||||||
placeholder="Search installed extensions by name or description"
|
<SearchInput
|
||||||
value={this.search}
|
theme="round-black"
|
||||||
onChange={(value) => this.search = value}
|
placeholder="Search installed extensions by name or description"
|
||||||
/>
|
value={this.search}
|
||||||
{extensionDiscovery.isLoaded ? this.renderExtensions() : <div className="spinner-wrapper"><Spinner/></div>}
|
onChange={(value) => this.search = value}
|
||||||
</div>
|
/>
|
||||||
|
{extensionDiscovery.isLoaded ? this.renderExtensions() : <div className="spinner-wrapper"><Spinner/></div>}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</section>
|
||||||
</PageLayout>
|
</PageLayout>
|
||||||
</DropFileInput>
|
</DropFileInput>
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user