mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fine-tuning general section
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
d6b641ce61
commit
9a3c3ad1ce
@ -45,6 +45,7 @@ import { Install } from "./install";
|
||||
import { InstalledExtensions } from "./installed-extensions";
|
||||
import { Notice } from "./notice";
|
||||
import { SettingLayout } from "../layout/setting-layout";
|
||||
import { docsUrl } from "../../../common/vars";
|
||||
|
||||
function getMessageFromError(error: any): string {
|
||||
if (!error || typeof error !== "object") {
|
||||
@ -514,7 +515,13 @@ export class Extensions extends React.Component<Props> {
|
||||
<section>
|
||||
<h1>Extensions</h1>
|
||||
|
||||
<Notice/>
|
||||
<Notice>
|
||||
<p>
|
||||
Add new features via Lens Extensions.{" "}
|
||||
Check out <a href={`${docsUrl}/extensions/`} target="_blank" rel="noreferrer">docs</a>{" "}
|
||||
and list of <a href="https://github.com/lensapp/lens-extensions/blob/main/README.md" target="_blank" rel="noreferrer">available extensions</a>.
|
||||
</p>
|
||||
</Notice>
|
||||
|
||||
<Install
|
||||
supportedFormats={supportedFormats}
|
||||
|
||||
@ -20,17 +20,14 @@
|
||||
*/
|
||||
|
||||
import styles from "./notice.module.css";
|
||||
import React from "react";
|
||||
import { docsUrl } from "../../../common/vars";
|
||||
import React, { DOMAttributes } from "react";
|
||||
|
||||
export function Notice() {
|
||||
interface Props extends DOMAttributes<any> {}
|
||||
|
||||
export function Notice(props: Props) {
|
||||
return (
|
||||
<div className={styles.notice}>
|
||||
<p>
|
||||
Add new features via Lens Extensions.{" "}
|
||||
Check out <a href={`${docsUrl}/extensions/`} target="_blank" rel="noreferrer">docs</a>{" "}
|
||||
and list of <a href="https://github.com/lensapp/lens-extensions/blob/main/README.md" target="_blank" rel="noreferrer">available extensions</a>.
|
||||
</p>
|
||||
{props.children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@ -39,12 +39,17 @@ export function GeneralSettings({ entity }: EntitySettingViewProps) {
|
||||
|
||||
return (
|
||||
<section>
|
||||
<section className="small">
|
||||
<p>General Cluster settings.</p>
|
||||
</section>
|
||||
<section>
|
||||
<components.ClusterNameSetting cluster={cluster} />
|
||||
</section>
|
||||
<hr/>
|
||||
<section>
|
||||
<components.ClusterIconSetting cluster={cluster} entity={entity as KubernetesCluster} />
|
||||
</section>
|
||||
<hr/>
|
||||
<section>
|
||||
<components.ClusterKubeconfig cluster={cluster} />
|
||||
</section>
|
||||
|
||||
@ -21,7 +21,6 @@
|
||||
|
||||
import React from "react";
|
||||
import type { Cluster } from "../../../../main/cluster";
|
||||
//import { FilePicker, OverSizeLimitStyle } from "../../file-picker";
|
||||
import { boundMethod } from "../../../utils";
|
||||
import { Button } from "../../button";
|
||||
import { observable } from "mobx";
|
||||
@ -67,15 +66,12 @@ export class ClusterIconSetting extends React.Component<Props> {
|
||||
}
|
||||
|
||||
getClearButton() {
|
||||
if (this.props.cluster.preferences.icon) {
|
||||
return <Button
|
||||
label="Clear"
|
||||
tooltip="Revert back to default icon"
|
||||
onClick={() => this.onIconPick([])}
|
||||
/>;
|
||||
}
|
||||
|
||||
return null;
|
||||
return <Button
|
||||
label="Clear"
|
||||
onClick={() => this.onIconPick([])}
|
||||
disabled={!this.props.cluster.preferences.icon}
|
||||
className="ml-5"
|
||||
/>;
|
||||
}
|
||||
|
||||
render() {
|
||||
@ -87,15 +83,16 @@ export class ClusterIconSetting extends React.Component<Props> {
|
||||
title={entity.metadata.name}
|
||||
source={entity.metadata.source}
|
||||
src={entity.spec.icon?.src}
|
||||
size={50}
|
||||
/>
|
||||
<span style={{marginRight: "var(--unit)"}}>Browse for new icon...</span>
|
||||
<Button className="ml-5">Upload Icon</Button>
|
||||
</>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<SubTitle title="Cluster Icon" />
|
||||
<div className="file-loader">
|
||||
<div className="file-loader flex flex-row items-center mt-2">
|
||||
<FilePicker
|
||||
accept="image/*"
|
||||
label={label}
|
||||
|
||||
@ -25,6 +25,7 @@ import { observer } from "mobx-react";
|
||||
import { SubTitle } from "../../layout/sub-title";
|
||||
import { boundMethod } from "../../../../common/utils";
|
||||
import { shell } from "electron";
|
||||
import { Notice } from "../../+extensions/notice";
|
||||
|
||||
interface Props {
|
||||
cluster: Cluster;
|
||||
@ -42,14 +43,12 @@ export class ClusterKubeconfig extends React.Component<Props> {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<>
|
||||
<Notice>
|
||||
<SubTitle title="Kubeconfig" />
|
||||
|
||||
<span>
|
||||
<a className="link value" onClick={this.openKubeconfig}>{this.props.cluster.kubeConfigPath}</a>
|
||||
</span>
|
||||
|
||||
</>
|
||||
</Notice>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -227,12 +227,12 @@ export class FilePicker extends React.Component<Props> {
|
||||
|
||||
getIconRight(): React.ReactNode {
|
||||
switch (this.status) {
|
||||
case FileInputStatus.CLEAR:
|
||||
return <Icon className="clean" material="cloud_upload"></Icon>;
|
||||
case FileInputStatus.PROCESSING:
|
||||
return <Spinner />;
|
||||
case FileInputStatus.ERROR:
|
||||
return <Icon material="error" title={this.errorText}></Icon>;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -163,7 +163,7 @@
|
||||
}
|
||||
|
||||
.Icon {
|
||||
color: var(--textColorSecondary);
|
||||
color: var(--textColorTertiary);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user