mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Move shell settings to terminal tab
Signed-off-by: DMYTRO ZHARKOV <dmytrozharkov@DMYTROs-MBP.fritz.box>
This commit is contained in:
parent
1cc6f16e90
commit
9b52a8d306
@ -10,7 +10,6 @@ import { Select, SelectOption } from "../select";
|
|||||||
import { ThemeStore } from "../../theme.store";
|
import { ThemeStore } from "../../theme.store";
|
||||||
import { UserStore } from "../../../common/user-store";
|
import { UserStore } from "../../../common/user-store";
|
||||||
import { Input } from "../input";
|
import { Input } from "../input";
|
||||||
import { isWindows } from "../../../common/vars";
|
|
||||||
import { Switch } from "../switch";
|
import { Switch } from "../switch";
|
||||||
import moment from "moment-timezone";
|
import moment from "moment-timezone";
|
||||||
import { CONSTANTS, defaultExtensionRegistryUrl, ExtensionRegistryLocation } from "../../../common/user-store/preferences-helpers";
|
import { CONSTANTS, defaultExtensionRegistryUrl, ExtensionRegistryLocation } from "../../../common/user-store/preferences-helpers";
|
||||||
@ -30,69 +29,23 @@ const updateChannelOptions: SelectOption<string>[] = Array.from(
|
|||||||
|
|
||||||
export const Application = observer(() => {
|
export const Application = observer(() => {
|
||||||
const userStore = UserStore.getInstance();
|
const userStore = UserStore.getInstance();
|
||||||
const defaultShell = process.env.SHELL
|
|
||||||
|| process.env.PTYSHELL
|
|
||||||
|| (
|
|
||||||
isWindows
|
|
||||||
? "powershell.exe"
|
|
||||||
: "System default shell"
|
|
||||||
);
|
|
||||||
|
|
||||||
const [customUrl, setCustomUrl] = React.useState(userStore.extensionRegistryUrl.customUrl || "");
|
const [customUrl, setCustomUrl] = React.useState(userStore.extensionRegistryUrl.customUrl || "");
|
||||||
const [shell, setShell] = React.useState(userStore.shell || "");
|
|
||||||
const extensionSettings = AppPreferenceRegistry.getInstance().getItems().filter((preference) => preference.showInPreferencesTab === "application");
|
const extensionSettings = AppPreferenceRegistry.getInstance().getItems().filter((preference) => preference.showInPreferencesTab === "application");
|
||||||
const themeStore = ThemeStore.getInstance();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section id="application">
|
<section id="application">
|
||||||
<h2 data-testid="application-header">Application</h2>
|
<h2 data-testid="application-header">Application</h2>
|
||||||
<section id="appearance">
|
<section id="appearance">
|
||||||
<SubTitle title="Theme" />
|
<SubTitle title="Theme"/>
|
||||||
<Select
|
<Select
|
||||||
options={themeStore.themeOptions}
|
options={ThemeStore.getInstance().themeOptions}
|
||||||
value={userStore.colorTheme}
|
value={userStore.colorTheme}
|
||||||
onChange={({ value }) => userStore.colorTheme = value}
|
onChange={({ value }) => userStore.colorTheme = value}
|
||||||
themeName="lens"
|
themeName="lens"
|
||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<hr />
|
<hr/>
|
||||||
|
|
||||||
<section id="terminalTheme">
|
|
||||||
<SubTitle title="Terminal theme" />
|
|
||||||
<Select
|
|
||||||
themeName="lens"
|
|
||||||
options={[
|
|
||||||
{ label: "Match theme", value: "" },
|
|
||||||
...themeStore.themeOptions,
|
|
||||||
]}
|
|
||||||
value={userStore.terminalTheme}
|
|
||||||
onChange={({ value }) => userStore.terminalTheme = value}
|
|
||||||
/>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section id="shell">
|
|
||||||
<SubTitle title="Terminal Shell Path" />
|
|
||||||
<Input
|
|
||||||
theme="round-black"
|
|
||||||
placeholder={defaultShell}
|
|
||||||
value={shell}
|
|
||||||
onChange={setShell}
|
|
||||||
onBlur={() => userStore.shell = shell}
|
|
||||||
/>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section id="terminalSelection">
|
|
||||||
<SubTitle title="Terminal copy & paste" />
|
|
||||||
<Switch
|
|
||||||
checked={userStore.terminalCopyOnSelect}
|
|
||||||
onChange={() => userStore.terminalCopyOnSelect = !userStore.terminalCopyOnSelect}
|
|
||||||
>
|
|
||||||
Copy on select and paste on right-click
|
|
||||||
</Switch>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<hr />
|
|
||||||
|
|
||||||
<section id="extensionRegistryUrl">
|
<section id="extensionRegistryUrl">
|
||||||
<SubTitle title="Extension Install Registry" />
|
<SubTitle title="Extension Install Registry" />
|
||||||
|
|||||||
@ -24,6 +24,7 @@ import { UserStore } from "../../../common/user-store";
|
|||||||
import { SubTitle } from "../layout/sub-title";
|
import { SubTitle } from "../layout/sub-title";
|
||||||
import { Input } from "../input";
|
import { Input } from "../input";
|
||||||
import { isWindows } from "../../../common/vars";
|
import { isWindows } from "../../../common/vars";
|
||||||
|
import { Switch } from "../switch";
|
||||||
|
|
||||||
export const Terminal = observer(() => {
|
export const Terminal = observer(() => {
|
||||||
const userStore = UserStore.getInstance();
|
const userStore = UserStore.getInstance();
|
||||||
@ -47,5 +48,17 @@ export const Terminal = observer(() => {
|
|||||||
onBlur={() => userStore.shell = shell}
|
onBlur={() => userStore.shell = shell}
|
||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<section id="terminalSelection">
|
||||||
|
<SubTitle title="Terminal copy & paste" />
|
||||||
|
<Switch
|
||||||
|
checked={userStore.terminalCopyOnSelect}
|
||||||
|
onChange={() => userStore.terminalCopyOnSelect = !userStore.terminalCopyOnSelect}
|
||||||
|
>
|
||||||
|
Copy on select and paste on right-click
|
||||||
|
</Switch>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<hr/>
|
||||||
</div>);
|
</div>);
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user