Minor ClusterSettings fixes

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

No files matched your search

@@ -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());
}
@@ -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);
}
})
}
@@ -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