{filePath} as kubeconfig: {String(err)}{filePath} as kubeconfig: {String(err)}Add clusters by clicking the Add Cluster button. - You'll need to obtain a working kubeconfig for the cluster you want to add. + You'll need to obtain a working kubeconfig for the cluster you want to add. You can either browse it from the file system or paste it as a text from the clipboard. - Read more about adding clusters here. + Read more about adding clusters here.
); } @@ -301,7 +300,7 @@ export class AddCluster extends React.Component { ); } - onKubeConfigInputBlur = (evt: React.FocusEvent
-
Use pre-installed Prometheus service for metrics. Please refer to the{" "} - guide{" "} + guide{" "} for possible configuration changes.
Prometheus installation method.
@@ -103,11 +103,11 @@ export class ClusterPrometheusSetting extends React.ComponentExtension {displayName} successfully uninstalled!
); + this.extensionState.delete(id); }); - removedUninstalling.forEach(({ id }) => { + this.addedInstalling.forEach(({ id, displayName }) => { + Notifications.ok( +Extension {displayName} successfully installed!
+ ); this.extensionState.delete(id); + this.installPath = ""; }); }) ); @@ -91,6 +103,7 @@ export class Extensions extends React.Component { @computed get extensions() { const searchText = this.search.toLowerCase(); + return Array.from(extensionLoader.userExtensions.values()).filter(ext => { const { name, description } = ext.manifest; return [ @@ -123,6 +136,7 @@ export class Extensions extends React.Component { { name: "tarball", extensions: this.supportedFormats } ] }); + if (!canceled && filePaths.length) { this.requestInstall( filePaths.map(filePath => ({ @@ -137,6 +151,7 @@ export class Extensions extends React.Component { const { installPath } = this; if (!installPath) return; const fileName = path.basename(installPath); + try { // install via url // fixme: improve error messages for non-tar-file URLs @@ -157,7 +172,7 @@ export class Extensions extends React.Component { }; installOnDrop = (files: File[]) => { - logger.info('Install from D&D'); + logger.info("Install from D&D"); return this.requestInstall( files.map(file => ({ fileName: path.basename(file.path), @@ -172,13 +187,13 @@ export class Extensions extends React.Component { await Promise.all( requests .filter(req => !req.data && req.filePath) - .map(req => { - return fse.readFile(req.filePath).then(data => { - req.data = data; - preloadedRequests.push(req); + .map(request => { + return fse.readFile(request.filePath).then(data => { + request.data = data; + preloadedRequests.push(request); }).catch(error => { if (showError) { - Notifications.error(`Error while reading "${req.filePath}": ${String(error)}`); + Notifications.error(`Error while reading "${request.filePath}": ${String(error)}`); } }); }) @@ -198,11 +213,13 @@ export class Extensions extends React.Component { if (!tarFiles.includes(manifestLocation)) { throw new Error(`invalid extension bundle, ${manifestFilename} not found`); } + const manifest = await readFileFromTarExtension {extName} successfully installed!
- ); } catch (error) { Notifications.error( -Installing extension {extName} has failed: {error}
+Installing extension {displayName} has failed: {error}
); + // Remove install state on install failure + if (this.extensionState.get(extensionId)?.state === "installing") { + this.extensionState.delete(extensionId); + } } finally { // clean up fse.remove(unpackingTempFolder).catch(Function); @@ -340,7 +372,9 @@ export class Extensions extends React.Component {Uninstalling extension {displayName} has failed: {error?.message ?? ""}
); // Remove uninstall state on uninstall failure - this.extensionState.delete(extension.id); + if (this.extensionState.get(extension.id)?.state === "uninstalling") { + this.extensionState.delete(extension.id); + } } } @@ -394,9 +428,17 @@ export class Extensions extends React.Component { }); } + /** + * True if at least one extension is in installing state + */ + @computed get isInstalling() { + return [...this.extensionState.values()].some(extension => extension.state === "installing"); + } + render() { const topHeader ={lb}
), ingress.getRoutes().map(route =>{route}
), diff --git a/src/renderer/components/+network-policies/network-policies.tsx b/src/renderer/components/+network-policies/network-policies.tsx index b54b6a80aa..a76845a633 100644 --- a/src/renderer/components/+network-policies/network-policies.tsx +++ b/src/renderer/components/+network-policies/network-policies.tsx @@ -43,7 +43,7 @@ export class NetworkPolicies extends React.Component