Fixes to SQL MIAA Compute + Storage page (#20272)

* Max for syncsecondary. Fix syncsecondary update.

* Update the value not the placeholder for SQL MIAA

* Disable save toolbar icon after save/update complete

Co-authored-by: Candice Ye <canye@microsoft.com>
This commit is contained in:
Candice Ye
2022-08-08 18:24:09 -07:00
committed by GitHub
parent 973c1c2437
commit 7a6168d9e6
2 changed files with 16 additions and 11 deletions

View File

@@ -262,6 +262,7 @@ export class MiaaComputeAndStoragePage extends DashboardPage {
this.syncSecondaryToCommitBox = this.modelView.modelBuilder.inputBox().withProps({
readOnly: false,
min: -1,
max: 2,
inputType: 'number',
placeHolder: loc.loading,
ariaLabel: loc.syncSecondaryToCommit
@@ -323,7 +324,7 @@ export class MiaaComputeAndStoragePage extends DashboardPage {
}
private handleOnTextChanged(component: azdata.InputBoxComponent): boolean {
if ((!component.value)) {
if ((!component.placeHolder)) {
// if there is no text found in the inputbox component return false
return false;
} else if ((!component.valid)) {
@@ -349,8 +350,9 @@ export class MiaaComputeAndStoragePage extends DashboardPage {
currentCPUSize = '';
}
this.coresRequestBox!.placeHolder = currentCPUSize;
this.coresRequestBox!.value = '';
this.coresRequestBox!.value = currentCPUSize;
this.coresRequestBox!.placeHolder = '';
this.saveArgs.coresRequest = undefined;
currentCPUSize = this._miaaModel.config?.spec?.scheduling?.default?.resources?.limits?.cpu;
@@ -359,8 +361,9 @@ export class MiaaComputeAndStoragePage extends DashboardPage {
currentCPUSize = '';
}
this.coresLimitBox!.placeHolder = currentCPUSize;
this.coresLimitBox!.value = '';
this.coresLimitBox!.value = currentCPUSize;
this.coresLimitBox!.placeHolder = '';
this.saveArgs.coresLimit = undefined;
}
@@ -374,8 +377,8 @@ export class MiaaComputeAndStoragePage extends DashboardPage {
currentMemSizeConversion = convertToGibibyteString(currentMemorySize);
}
this.memoryRequestBox!.placeHolder = currentMemSizeConversion!;
this.memoryRequestBox!.value = '';
this.memoryRequestBox!.value = currentMemSizeConversion!;
this.memoryRequestBox!.placeHolder = '';
this.saveArgs.memoryRequest = undefined;
@@ -387,8 +390,9 @@ export class MiaaComputeAndStoragePage extends DashboardPage {
currentMemSizeConversion = convertToGibibyteString(currentMemorySize);
}
this.memoryLimitBox!.placeHolder = currentMemSizeConversion!;
this.memoryLimitBox!.value = '';
this.memoryLimitBox!.value = currentMemSizeConversion!;
this.memoryLimitBox!.placeHolder = '';
this.saveArgs.memoryLimit = undefined;
}
@@ -396,8 +400,8 @@ export class MiaaComputeAndStoragePage extends DashboardPage {
private editSyncSecondaryToCommit(): void {
let currentSyncSecondaryToCommit = this._miaaModel.config?.spec?.syncSecondaryToCommit;
this.syncSecondaryToCommitBox!.placeHolder = currentSyncSecondaryToCommit!;
this.syncSecondaryToCommitBox!.value = '';
this.syncSecondaryToCommitBox!.value = currentSyncSecondaryToCommit!;
this.syncSecondaryToCommitBox!.placeHolder = '';
this.saveArgs.syncSecondaryToCommit = undefined;
}

View File

@@ -265,6 +265,7 @@ export class AzTool implements azExt.IAzApi {
if (args.memoryRequest) { argsArray.push('--memory-request', args.memoryRequest); }
if (args.noWait) { argsArray.push('--no-wait'); }
if (args.retentionDays) { argsArray.push('--retention-days', args.retentionDays); }
if (args.syncSecondaryToCommit) { argsArray.push('--sync-secondary-to-commit', args.syncSecondaryToCommit); }
if (resourceGroup) { argsArray.push('--resource-group', resourceGroup); }
if (namespace) { argsArray.push('--k8s-namespace', namespace); }
if (usek8s) { argsArray.push('--use-k8s'); }