diff --git a/extensions/mssql/src/objectManagement/constants.ts b/extensions/mssql/src/objectManagement/constants.ts index b423084652ed..bef7fbe02dbd 100644 --- a/extensions/mssql/src/objectManagement/constants.ts +++ b/extensions/mssql/src/objectManagement/constants.ts @@ -16,6 +16,7 @@ export const enum FolderType { } export const PublicServerRoleName = 'public'; +export const Windows = 'Windows'; export const CreateUserDocUrl = 'https://learn.microsoft.com/sql/t-sql/statements/create-user-transact-sql'; export const AlterUserDocUrl = 'https://learn.microsoft.com/sql/t-sql/statements/alter-user-transact-sql'; diff --git a/extensions/mssql/src/objectManagement/interfaces.ts b/extensions/mssql/src/objectManagement/interfaces.ts index 445699ca6cfa..971c2555d748 100644 --- a/extensions/mssql/src/objectManagement/interfaces.ts +++ b/extensions/mssql/src/objectManagement/interfaces.ts @@ -593,8 +593,8 @@ export interface Server extends ObjectManagement.SqlObject { * The server login types. */ export const enum ServerLoginMode { - Integrated, //windows auth only - Mixed // both sql server and windows auth + Integrated = 1, //windows auth only + Mixed = 2// both sql server and windows auth } /** diff --git a/extensions/mssql/src/objectManagement/localizedConstants.ts b/extensions/mssql/src/objectManagement/localizedConstants.ts index c28eb6c08cf7..29c0efce7d87 100644 --- a/extensions/mssql/src/objectManagement/localizedConstants.ts +++ b/extensions/mssql/src/objectManagement/localizedConstants.ts @@ -350,6 +350,7 @@ export const scanStartupProcsLabel = localize('objectManagement.scanStartupProcs export const twoDigitYearCutoffLabel = localize('objectManagement.twoDigitYearCutoffLabel', "Two Digit Year Cutoff"); export const costThresholdParallelismLabel = localize('objectManagement.costThresholdParallelismLabel', "Cost Threshold Parallelism"); export const locksLabel = localize('objectManagement.locksLabel', "Locks"); +export function locksValidation(minValue: number): string { return localize('objectManagement.locksValidation', "Value should be greater than {0}. Choose 0 for default settings.", minValue); } export const maxDegreeParallelismLabel = localize('objectManagement.maxDegreeParallelismLabel', "Max Degree Parallelism"); export const queryWaitLabel = localize('objectManagement.queryWaitLabel', "Query Wait"); diff --git a/extensions/mssql/src/objectManagement/ui/serverPropertiesDialog.ts b/extensions/mssql/src/objectManagement/ui/serverPropertiesDialog.ts index e803eaa073ac..c20d1077a718 100644 --- a/extensions/mssql/src/objectManagement/ui/serverPropertiesDialog.ts +++ b/extensions/mssql/src/objectManagement/ui/serverPropertiesDialog.ts @@ -91,8 +91,11 @@ export class ServerPropertiesDialog extends ObjectManagementDialogBase { - await this.notifyServerRestart(); + this.disposables.push(this.dialogObject.onClosed(async (reason: azdata.window.CloseReason) => { + if (reason === 'ok') { + // only show message if user apply changes + await this.notifyServerRestart(); + } })); } @@ -501,8 +504,9 @@ export class ServerPropertiesDialog extends ObjectManagementDialogBase { await this.handleAuthModeChange(); }); this.sqlServerAndWindowsAuthRadioButton = this.createRadioButton(localizedConstants.sqlServerAndWindowsAuthText, radioServerGroupName, this.objectInfo.authenticationMode === ServerLoginMode.Mixed, async () => { await this.handleAuthModeChange(); }); @@ -518,6 +522,11 @@ export class ServerPropertiesDialog extends ObjectManagementDialogBase { await this.handleAuditLevelChange(); }); this.successfulLoginsOnlyRadioButton = this.createRadioButton(localizedConstants.successfulLoginsOnlyText, radioLoginsGroupName, this.objectInfo.loginAuditing === AuditLevel.Success, async () => { await this.handleAuditLevelChange(); }); this.bothFailedAndSuccessfulLoginsRadioButton = this.createRadioButton(localizedConstants.bothFailedAndSuccessfulLoginsText, radioLoginsGroupName, this.objectInfo.loginAuditing === AuditLevel.All, async () => { await this.handleAuditLevelChange(); }); + // cannot change values in serverLogin section on Linux + this.noneRadioButton.enabled = isWindows; + this.failedLoginsOnlyRadioButton.enabled = isWindows; + this.successfulLoginsOnlyRadioButton.enabled = isWindows; + this.bothFailedAndSuccessfulLoginsRadioButton.enabled = isWindows; const serverLoginSection = this.createGroup(localizedConstants.loginAuditingText, [ this.noneRadioButton, this.failedLoginsOnlyRadioButton, @@ -670,6 +679,7 @@ export class ServerPropertiesDialog extends ObjectManagementDialogBase { this.objectInfo.allowTriggerToFireOthers = newValue === 'True'; }, ['True', 'False'], this.objectInfo.allowTriggerToFireOthers ? 'True' : 'False'); @@ -733,7 +743,7 @@ export class ServerPropertiesDialog extends ObjectManagementDialogBase { this.objectInfo.scanStartupProcs = newValue === 'True'; - }, ['True', 'False'], this.objectInfo.scanStartupProcs ? 'True' : 'False'); + }, ['True', 'False'], this.objectInfo.scanStartupProcs ? 'True' : 'False', isEnabled); const scanStartupProcsContainer = this.createLabelInputContainer(localizedConstants.scanStartupProcsLabel, this.scanStartupProcsDropdown); this.twoDigitYearCutoffInput = this.createInputBox(async (newValue) => { @@ -761,8 +771,13 @@ export class ServerPropertiesDialog extends ObjectManagementDialogBase { + return !(+this.locksInput.value < this.objectInfo.locks.minimumValue && +this.locksInput.value !== 0); }); const locksContainer = this.createLabelInputContainer(localizedConstants.locksLabel, this.locksInput);