Skip to content

Commit

Permalink
add progress while getting info
Browse files Browse the repository at this point in the history
  • Loading branch information
msivasubramaniaan committed Jul 15, 2024
1 parent aee0e9d commit 405d3da
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 405d3da

Please sign in to comment.