1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Minor ClusterSettings fixes

Signed-off-by: alexfront <alex.andreev.email@gmail.com>
This commit is contained in:
alexfront 2020-08-06 15:46:31 +03:00
parent 29dc7587f0
commit b4172b3982
3 changed files with 13 additions and 8 deletions

View File

@ -28,7 +28,9 @@ export class InstallFeature extends React.Component<Props> {
<Button
primary
disabled={disabled}
onClick={this.runAction("upgradeFeature")}
onClick={this.runAction(() =>
clusterIpc.upgradeFeature.invokeFromRenderer(cluster.id, feature))
}
>
Upgrade
</Button>
@ -37,7 +39,9 @@ export class InstallFeature extends React.Component<Props> {
<Button
accent
disabled={disabled}
onClick={this.runAction("uninstallFeature")}
onClick={this.runAction(() =>
clusterIpc.uninstallFeature.invokeFromRenderer(cluster.id, feature))
}
>
Uninstall
</Button>
@ -46,7 +50,9 @@ export class InstallFeature extends React.Component<Props> {
<Button
primary
disabled={disabled}
onClick={this.runAction("installFeature")}
onClick={this.runAction(() =>
clusterIpc.installFeature.invokeFromRenderer(cluster.id, feature))
}
>
Install
</Button>
@ -57,12 +63,12 @@ export class InstallFeature extends React.Component<Props> {
);
}
runAction(action: keyof typeof clusterIpc): () => Promise<void> {
runAction(action: () => Promise<any>): () => Promise<void> {
return async () => {
const { cluster, feature } = this.props;
try {
this.loading = true;
await clusterIpc[action].invokeFromRenderer(cluster.id, feature);
await action();
} catch (err) {
Notifications.error(err.toString());
}

View File

@ -22,8 +22,7 @@ export class RemoveClusterButton extends React.Component<Props> {
labelOk: <Trans>Yes</Trans>,
labelCancel: <Trans>No</Trans>,
ok: async () => {
await clusterIpc.disconnect.invokeFromRenderer(cluster.id);
await clusterStore.removeById(cluster.id);
await clusterStore.removeById(cluster.id);
}
})
}

View File

@ -43,7 +43,7 @@ export enum OverTotalSizeLimitStyle {
export interface BaseProps {
accept?: string;
label: React.ReactElement;
label: React.ReactNode;
multiple?: boolean;
// limit is the optional maximum number of files to upload