import "./preferences.scss"; import React from "react"; import { computed, observable, reaction } from "mobx"; import { disposeOnUnmount, observer } from "mobx-react"; import { userStore } from "../../../common/user-store"; import { isWindows } from "../../../common/vars"; import { appPreferenceRegistry } from "../../../extensions/registries/app-preference-registry"; import { themeStore } from "../../theme.store"; import { Checkbox } from "../checkbox"; import { Input } from "../input"; import { PageLayout } from "../layout/page-layout"; import { SubTitle } from "../layout/sub-title"; import { Select, SelectOption } from "../select"; import { HelmCharts } from "./helm-charts"; import { KubectlBinaries } from "./kubectl-binaries"; import { ScrollSpy } from "../scroll-spy/scroll-spy"; import { navigation } from "../../navigation"; @observer export class Preferences extends React.Component { @observable httpProxy = userStore.preferences.httpsProxy || ""; @observable shell = userStore.preferences.shell || ""; @computed get themeOptions(): SelectOption[] { return themeStore.themes.map(theme => ({ label: theme.name, value: theme.id, })); } componentDidMount() { disposeOnUnmount(this, [ reaction(() => navigation.location.hash, hash => { const fragment = hash.slice(1); // hash is /^(#\w.)?$/ if (fragment) { // ignore empty framents document.getElementById(fragment)?.scrollIntoView(); } }, { fireImmediately: true }) ]); } render() { const { preferences } = userStore; const header =

Preferences

; let defaultShell = process.env.SHELL || process.env.PTYSHELL; if (!defaultShell) { if (isWindows) { defaultShell = "powershell.exe"; } else { defaultShell = "System default shell"; } } return ( (

Application

Appearance

this.httpProxy = v} onBlur={() => preferences.httpsProxy = this.httpProxy} /> Proxy is used only for non-cluster communication. 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!

Terminal Shell

this.shell = v} onBlur={() => preferences.shell = this.shell} /> The path of the shell that the terminal uses.

Start-up

preferences.openAtLogin = v} />

Kubernetes

Kubectl binary

Helm Charts

Extensions

{appPreferenceRegistry.getItems().map(({ title, id, components: { Hint, Input } }, index) => { return (

{title}

); })}
)}/> ); } }