From 405d3da98a8e2eb9cc67b9ccab3cefd9df29c550 Mon Sep 17 00:00:00 2001 From: msivasubramaniaan Date: Mon, 15 Jul 2024 23:05:03 +0530 Subject: [PATCH] add progress while getting info --- src/deployment.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/deployment.ts b/src/deployment.ts index 990e84213..6991be5c1 100644 --- a/src/deployment.ts +++ b/src/deployment.ts @@ -14,6 +14,7 @@ import { validateRFC1123DNSLabel } from './openshift/nameValidator'; import { inputValue, quickBtn } from './util/inputValue'; import { vsCommand } from './vscommand'; import { OpenShiftTerminalManager } from './webview/openshift-terminal/openShiftTerminal'; +import { Progress } from './util/progress'; export class Deployment { @@ -162,14 +163,19 @@ export class Deployment { })); disposables.push(inputBox.onDidAccept(async (_e) => { - //check url has image if (inputBox.validationMessage === undefined && inputBox.value !== undefined) { - if (! await Oc.Instance.hasImageInfo(inputBox.value)) { - inputBox.validationMessage = 'Image referece is not valid' - } else { - inputBox.validationMessage = undefined; - } + inputBox.busy = true; + inputBox.enabled = false; + await Progress.execFunctionWithProgress(`Fetching Image info ${inputBox.value}`, async () => { + if (! await Oc.Instance.hasImageInfo(inputBox.value)) { + inputBox.validationMessage = 'Image referece is not valid' + } else { + inputBox.validationMessage = undefined; + } + }); + inputBox.enabled = true; + inputBox.busy = false; } if (inputBox.validationMessage === undefined && inputBox.value !== undefined) {