mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add eslint rule padding-line-between-statements (#1593)
Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
This commit is contained in:
1 parent
7b77f18376
commit
dcf253e7d5
401 files changed
+2018
-40
No files matched your search
@@ -49,6 +49,7 @@ export class ClusterSettings extends React.Component<Props> {
|
||||
|
||||
render() {
|
||||
const cluster = this.cluster;
|
||||
|
||||
if (!cluster) return null;
|
||||
const header = (
|
||||
<>
|
||||
@@ -56,6 +57,7 @@ export class ClusterSettings extends React.Component<Props> {
|
||||
<h2>{cluster.preferences.clusterName}</h2>
|
||||
</>
|
||||
);
|
||||
|
||||
return (
|
||||
<PageLayout className="ClusterSettings" header={header}>
|
||||
<Status cluster={cluster}></Status>
|
||||
|
||||
@@ -25,9 +25,11 @@ export class ClusterIconSetting extends React.Component<Props> {
|
||||
@autobind()
|
||||
async onIconPick([file]: File[]) {
|
||||
const { cluster } = this.props;
|
||||
|
||||
try {
|
||||
if (file) {
|
||||
const buf = Buffer.from(await file.arrayBuffer());
|
||||
|
||||
cluster.preferences.icon = `data:${file.type};base64,${buf.toString("base64")}`;
|
||||
} else {
|
||||
// this has to be done as a seperate branch (and not always) because `cluster`
|
||||
@@ -57,6 +59,7 @@ export class ClusterIconSetting extends React.Component<Props> {
|
||||
{"Browse for new icon..."}
|
||||
</>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<SubTitle title="Cluster Icon" />
|
||||
|
||||
@@ -23,6 +23,7 @@ export class ClusterPrometheusSetting extends React.Component<Props> {
|
||||
|
||||
@computed get canEditPrometheusPath() {
|
||||
if (this.provider === "" || this.provider === "lens") return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -30,12 +31,15 @@ export class ClusterPrometheusSetting extends React.Component<Props> {
|
||||
disposeOnUnmount(this,
|
||||
autorun(() => {
|
||||
const { prometheus, prometheusProvider } = this.props.cluster.preferences;
|
||||
|
||||
if (prometheus) {
|
||||
const prefix = prometheus.prefix || "";
|
||||
|
||||
this.path = `${prometheus.namespace}/${prometheus.service}:${prometheus.port}${prefix}`;
|
||||
} else {
|
||||
this.path = "";
|
||||
}
|
||||
|
||||
if (prometheusProvider) {
|
||||
this.provider = prometheusProvider.type;
|
||||
} else {
|
||||
@@ -51,9 +55,11 @@ export class ClusterPrometheusSetting extends React.Component<Props> {
|
||||
}
|
||||
const parsed = this.path.split(/\/|:/, 3);
|
||||
const apiPrefix = this.path.substring(parsed.join("/").length);
|
||||
|
||||
if (!parsed[0] || !parsed[1] || !parsed[2]) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return {
|
||||
namespace: parsed[0],
|
||||
service: parsed[1],
|
||||
|
||||
@@ -24,6 +24,7 @@ export class InstallFeature extends React.Component<Props> {
|
||||
const statusUpdate = interval(20, () => {
|
||||
feature.updateStatus(cluster);
|
||||
});
|
||||
|
||||
statusUpdate.start(true);
|
||||
|
||||
disposeOnUnmount(this, () => {
|
||||
@@ -42,6 +43,7 @@ export class InstallFeature extends React.Component<Props> {
|
||||
const { cluster, feature } = this.props;
|
||||
const disabled = !cluster.isAdmin || this.loading;
|
||||
const loadingIcon = this.loading ? <Spinner/> : null;
|
||||
|
||||
return (
|
||||
<div className="flex gaps align-center">
|
||||
{feature.status.canUpgrade &&
|
||||
|
||||
@@ -16,6 +16,7 @@ export class RemoveClusterButton extends React.Component<Props> {
|
||||
@autobind()
|
||||
confirmRemoveCluster() {
|
||||
const { cluster } = this.props;
|
||||
|
||||
ConfirmDialog.open({
|
||||
message: <p>Are you sure you want to remove <b>{cluster.preferences.clusterName}</b> from Lens?</p>,
|
||||
labelOk: <Trans>Yes</Trans>,
|
||||
@@ -28,6 +29,7 @@ export class RemoveClusterButton extends React.Component<Props> {
|
||||
|
||||
render() {
|
||||
const { cluster } = this.props;
|
||||
|
||||
return (
|
||||
<Button accent onClick={this.confirmRemoveCluster} className="button-area" disabled={cluster.isManaged}>
|
||||
Remove Cluster
|
||||
|
||||
@@ -11,6 +11,7 @@ interface Props {
|
||||
export class Features extends React.Component<Props> {
|
||||
render() {
|
||||
const { cluster } = this.props;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h2>Features</h2>
|
||||
|
||||
@@ -14,6 +14,7 @@ export class Status extends React.Component<Props> {
|
||||
@autobind()
|
||||
openKubeconfig() {
|
||||
const { cluster } = this.props;
|
||||
|
||||
shell.showItemInFolder(cluster.kubeConfigPath);
|
||||
}
|
||||
|
||||
@@ -26,6 +27,7 @@ export class Status extends React.Component<Props> {
|
||||
["API Address", cluster.apiUrl || "N/A"],
|
||||
["Nodes Count", cluster.metadata.nodes ? String(cluster.metadata.nodes) : "N/A"]
|
||||
];
|
||||
|
||||
return (
|
||||
<Table scrollable={false}>
|
||||
{rows.map(([name, value]) => {
|
||||
|
||||
Reference in new issue
Block a user