diff --git a/src/renderer/components/+cluster-settings/cluster-settings.scss b/src/renderer/components/+cluster-settings/cluster-settings.scss index aa7d51c369..f20699de35 100644 --- a/src/renderer/components/+cluster-settings/cluster-settings.scss +++ b/src/renderer/components/+cluster-settings/cluster-settings.scss @@ -1,6 +1,7 @@ .ClusterSettings { .WizardLayout { grid-template-columns: unset; + grid-template-rows: 76px 1fr; padding: 0; .head-col { @@ -9,15 +10,6 @@ :nth-child(2) { flex: 1 0 0; } - - a { - text-decoration: none; - color: $grey-600; - } - } - - .info-col { - display: none; } .content-col { @@ -29,25 +21,18 @@ text-transform: none; } - .settings-wrapper { - margin: 0 auto; - width: 60%; - min-width: 570px; - max-width: 1000px; + > div { + margin-top: $margin * 5; + } - > div { - margin-top: $margin * 5; - } + .admin-note { + font-size: small; + opacity: 0.5; + margin-left: $margin; + } - .admin-note { - font-size: small; - opacity: 0.5; - margin-left: $margin; - } - - .button-area { - margin-top: $margin * 2; - } + .button-area { + margin-top: $margin * 2; } .file-loader { diff --git a/src/renderer/components/+cluster-settings/cluster-settings.tsx b/src/renderer/components/+cluster-settings/cluster-settings.tsx index d0a6385ac5..28726de561 100644 --- a/src/renderer/components/+cluster-settings/cluster-settings.tsx +++ b/src/renderer/components/+cluster-settings/cluster-settings.tsx @@ -1,7 +1,6 @@ import "./cluster-settings.scss"; import React from "react"; -import { Link } from "react-router-dom"; import { observer } from "mobx-react"; import { Features } from "./features"; import { Removal } from "./removal"; @@ -11,6 +10,7 @@ import { WizardLayout } from "../layout/wizard-layout"; import { ClusterIcon } from "../cluster-icon"; import { Icon } from "../icon"; import { getMatchedCluster } from "../cluster-manager/cluster-view.route"; +import { navigate } from "../../navigation"; @observer export class ClusterSettings extends React.Component { @@ -25,20 +25,16 @@ export class ClusterSettings extends React.Component { showTooltip={false} />

{cluster.preferences.clusterName}

- - - + navigate("/")} big/> ); return (
- -
- - - - -
+ + + + +
); diff --git a/src/renderer/components/+preferences/preferences.scss b/src/renderer/components/+preferences/preferences.scss index 859315cc8a..94c08e8f53 100644 --- a/src/renderer/components/+preferences/preferences.scss +++ b/src/renderer/components/+preferences/preferences.scss @@ -1,23 +1,51 @@ .Preferences { - h2 { - &:not(:first-child) { - margin-top: $padding * 3; + position: fixed!important; // Allows to cover ClustersMenu + z-index: 1; + + .WizardLayout { + grid-template-columns: unset; + grid-template-rows: 76px 1fr; + padding: 0; + + .content-col { + background-color: transparent; + padding: $padding * 8 0; + + h2 { + margin-bottom: $margin * 2; + + &:not(:first-child) { + margin-top: $margin * 3; + } + } + + .repos { + position: relative; + + .Badge { + display: flex; + margin: 0; + margin-bottom: 1px; + padding: $padding $padding * 2; + } + } + + .hint { + margin-top: -$margin; + } } } - .info-block { - --flex-gap: #{$padding}; + .is-mac & { + .WizardLayout .head-col { + padding-top: 32px; + overflow: hidden; + } } - .repos { - --flex-gap: #{$padding}; - - > .title { - font-style: italic; - } - - .Badge { - margin: $padding / 2; + .Select { + &__control { + box-shadow: 0 0 0 1px $borderFaintColor; } } } \ No newline at end of file diff --git a/src/renderer/components/+preferences/preferences.tsx b/src/renderer/components/+preferences/preferences.tsx index 02e66b7342..99e7793623 100644 --- a/src/renderer/components/+preferences/preferences.tsx +++ b/src/renderer/components/+preferences/preferences.tsx @@ -1,5 +1,5 @@ import "./preferences.scss" -import React, { Fragment } from "react"; +import React from "react"; import { observer } from "mobx-react"; import { action, computed, observable } from "mobx"; import { t, Trans } from "@lingui/macro"; @@ -15,11 +15,12 @@ import { Notifications } from "../notifications"; import { Badge } from "../badge"; import { Spinner } from "../spinner"; import { themeStore } from "../../theme.store"; +import { history } from "../../navigation"; +import { Tooltip } from "../tooltip"; @observer export class Preferences extends React.Component { @observable helmLoading = false; - @observable helmUpdating = false; @observable helmRepos: HelmRepo[] = []; @observable helmAddedRepos = observable.map(); @@ -88,9 +89,9 @@ export class Preferences extends React.Component { Notifications.ok(Helm branch {repo.name} already in use) return; } - this.helmUpdating = false; + this.helmLoading = true; await this.addRepo(repo); - this.helmUpdating = false; + this.helmLoading = false; } formatHelmOptionLabel = ({ value: repo }: SelectOption) => { @@ -103,104 +104,96 @@ export class Preferences extends React.Component { ) } - renderInfo() { - return ( - -

- Preferences -

-
- -

- Lens Global Settings (applicable to all clusters) -

-
-
- ) - } - render() { const { preferences } = userStore; + const header = ( + <> +

Preferences

+ + + ); return ( - -

Color Theme

- preferences.colorTheme = value} + /> -

Download Mirror

- Download mirror for kubectl} + options={this.downloadMirrorOptions} + value={preferences.downloadMirror} + onChange={({ value }: SelectOption) => preferences.downloadMirror = value} + /> -

Helm

- Repositories} + isLoading={this.helmLoading} + isDisabled={this.helmLoading} + options={this.helmOptions} + onChange={this.onRepoSelect} + formatOptionLabel={this.formatHelmOptionLabel} + controlShouldRenderValue={false} + /> +
+ {Array.from(this.helmAddedRepos).map(([name, repo]) => { + const tooltipId = `message-${name}`; return ( - - {name} + + {name} this.removeRepo(repo)} tooltip={Remove} /> + + {repo.url} + ) })}
- -

HTTP Proxy

- preferences.httpsProxy = v} - /> - - Proxy is used only for non-cluster communication. - +

HTTP Proxy

+ preferences.httpsProxy = v} + /> + + Proxy is used only for non-cluster communication. + -

Certificate Trust

- Allow untrusted Certificate Authorities} - value={preferences.allowUntrustedCAs} - onChange={v => preferences.allowUntrustedCAs = v} - /> - - This will make Lens to trust ANY certificate authority without any validations.{" "} - Needed with some corporate proxies that do certificate re-writing.{" "} - Does not affect cluster communications! - +

Certificate Trust

+ Allow untrusted Certificate Authorities} + value={preferences.allowUntrustedCAs} + onChange={v => preferences.allowUntrustedCAs = v} + /> + + This will make Lens to trust ANY certificate authority without any validations.{" "} + Needed with some corporate proxies that do certificate re-writing.{" "} + Does not affect cluster communications! + -

Telemetry & Usage Tracking

- Allow telemetry & usage tracking} - value={preferences.allowTelemetry} - onChange={v => preferences.allowTelemetry = v} - /> - - Telemetry & usage data is collected to continuously improve the Lens experience. - -
- ) +

Telemetry & Usage Tracking

+ Allow telemetry & usage tracking} + value={preferences.allowTelemetry} + onChange={v => preferences.allowTelemetry = v} + /> + + Telemetry & usage data is collected to continuously improve the Lens experience. + + + + ); } } diff --git a/src/renderer/components/layout/wizard-layout.scss b/src/renderer/components/layout/wizard-layout.scss index a81cdfd429..603b7ca067 100644 --- a/src/renderer/components/layout/wizard-layout.scss +++ b/src/renderer/components/layout/wizard-layout.scss @@ -16,6 +16,7 @@ > .head-col { position: sticky; border-bottom: 1px solid $grey-800; + justify-content: space-between; } > .content-col { @@ -41,4 +42,17 @@ a { color: $colorInfo; } + + &.centered { + .content-col { + margin: 0; + + > div { + margin: 0 auto; + width: 60%; + min-width: 570px; + max-width: 1000px; + } + } + } } \ No newline at end of file diff --git a/src/renderer/components/layout/wizard-layout.tsx b/src/renderer/components/layout/wizard-layout.tsx index 01b7f331d8..17867eed1a 100644 --- a/src/renderer/components/layout/wizard-layout.tsx +++ b/src/renderer/components/layout/wizard-layout.tsx @@ -10,25 +10,30 @@ interface Props { contentClass?: IClassName; infoPanelClass?: IClassName; infoPanel?: React.ReactNode; + centered?: boolean; // Centering content horizontally } @observer export class WizardLayout extends React.Component { render() { - const { className, contentClass, infoPanelClass, infoPanel, header, headerClass, children: content } = this.props; + const { className, contentClass, infoPanelClass, infoPanel, header, headerClass, centered, children: content } = this.props; return ( -
+
{header && (
{header}
)}
- {content} -
-
- {infoPanel} +
+ {content} +
+ {infoPanel && ( +
+ {infoPanel} +
+ )}
) } diff --git a/src/renderer/components/select/select.scss b/src/renderer/components/select/select.scss index 1b5a081362..a6cb7e0bbb 100644 --- a/src/renderer/components/select/select.scss +++ b/src/renderer/components/select/select.scss @@ -23,7 +23,7 @@ html { &--is-disabled { opacity: .75; cursor: not-allowed; - pointer-events: auto; + pointer-events: none; } &__control {