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