Styling Kubernetes tab

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev committed 2021-04-02 11:57:36 +03:00
1 parent f8db743bb6
commit b769335dd2
5 files changed
+36 -18

No files matched your search

@@ -1,11 +1,11 @@
import React, { useState } from "react";
import { Checkbox } from "../checkbox";
import { Input, InputValidators } from "../input";
import { SubTitle } from "../layout/sub-title";
import { UserPreferences, userStore } from "../../../common/user-store";
import { observer } from "mobx-react";
import { bundledKubectlPath } from "../../../main/kubectl";
import { SelectOption, Select } from "../select";
import { FormSwitch, Switcher } from "../switch";
export const KubectlBinaries = observer(({ preferences }: { preferences: UserPreferences }) => {
const [downloadPath, setDownloadPath] = useState(preferences.downloadBinariesPath || "");
@@ -24,12 +24,23 @@ export const KubectlBinaries = observer(({ preferences }: { preferences: UserPre
return (
<>
<SubTitle title="Automatic kubectl binary download"/>
<Checkbox
label="Download kubectl binaries matching the Kubernetes cluster version"
value={preferences.downloadKubectlBinaries}
onChange={downloadKubectlBinaries => preferences.downloadKubectlBinaries = downloadKubectlBinaries}
<section className="small">
<SubTitle title="Kubectl binary download"/>
<FormSwitch
control={
<Switcher
checked={preferences.downloadKubectlBinaries}
onChange={v => preferences.downloadKubectlBinaries = v.target.checked}
name="kubectl-download"
/>
}
label="Download kubectl binaries matching the Kubernetes cluster version"
/>
</section>
<hr className="small"/>
<section className="small">
<SubTitle title="Download mirror" />
<Select
placeholder="Download mirror for kubectl"
@@ -38,6 +49,11 @@ export const KubectlBinaries = observer(({ preferences }: { preferences: UserPre
onChange={({ value }: SelectOption) => preferences.downloadMirror = value}
disabled={!preferences.downloadKubectlBinaries}
/>
</section>
<hr className="small"/>
<section className="small">
<SubTitle title="Directory for binaries" />
<Input
theme="round-black"
@@ -48,9 +64,14 @@ export const KubectlBinaries = observer(({ preferences }: { preferences: UserPre
onBlur={save}
disabled={!preferences.downloadKubectlBinaries}
/>
<small className="hint">
<div className="hint">
The directory to download binaries into.
</small>
</div>
</section>
<hr className="small"/>
<section className="small">
<SubTitle title="Path to kubectl binary" />
<Input
theme="round-black"
@@ -61,9 +82,7 @@ export const KubectlBinaries = observer(({ preferences }: { preferences: UserPre
onBlur={save}
disabled={preferences.downloadKubectlBinaries}
/>
<small className="hint">
The path to the kubectl binary on the system.
</small>
</section>
</>
);
});
@@ -181,13 +181,11 @@ export class Preferences extends React.Component {
{this.activeTab == PreferencesTab.Kubernetes && (
<section id="kubernetes">
<section>
<h1>Kubernetes</h1>
</section>
<section id="kubectl">
<h2>Kubectl binary</h2>
<h2>Kubernetes</h2>
<KubectlBinaries preferences={preferences}/>
</section>
<hr/>
<section id="helm">
<h2>Helm Charts</h2>
<HelmCharts/>
+1 -1
View File
@@ -97,7 +97,7 @@
label {
background: #00000021;
border: 1px solid #20222580;
border: 1px solid #202225bf;
border-radius: 4px;
padding: $padding;
@@ -145,7 +145,7 @@
.Select {
&__control {
box-shadow: 0 0 0 1px #20222580;
box-shadow: 0 0 0 1px #202225bf;
background: #00000021;
}
@@ -196,6 +196,7 @@
margin-bottom: 8px;
padding-bottom: 0;
font-size: 12px;
line-height: 1;
}
hr {
@@ -77,7 +77,7 @@ export class PageLayout extends React.Component<PageLayoutProps> {
</div>
<div className="toolsRegion">
<div className="fixedTools">
<div className="closeBtn" role="button" aria-label="Close">
<div className="closeBtn" role="button" aria-label="Close" onClick={this.back}>
<Icon material="close"/>
</div>
<div className="esc" aria-hidden="true">