diff --git a/extensions/mssql/src/objectManagement/constants.ts b/extensions/mssql/src/objectManagement/constants.ts index dc600ea0a1..ee73ce8291 100644 --- a/extensions/mssql/src/objectManagement/constants.ts +++ b/extensions/mssql/src/objectManagement/constants.ts @@ -33,6 +33,7 @@ export const ViewMemoryServerPropertiesDocUrl = 'https://learn.microsoft.com/sql export const ViewProcessorsServerPropertiesDocUrl = 'https://learn.microsoft.com/sql/database-engine/configure-windows/server-properties-processors-page'; export const ViewSecurityServerPropertiesDocUrl = 'https://learn.microsoft.com/sql/database-engine/configure-windows/server-properties-security-page'; export const ViewDatabaseSettingsPropertiesDocUrl = 'https://learn.microsoft.com/sql/database-engine/configure-windows/server-properties-database-settings-page'; +export const ViewAdvancedServerPropertiesDocUrl = 'https://learn.microsoft.com/sql/database-engine/configure-windows/server-properties-advanced-page'; export const DetachDatabaseDocUrl = 'https://go.microsoft.com/fwlink/?linkid=2240322'; export const AttachDatabaseDocUrl = 'https://learn.microsoft.com/sql/relational-databases/databases/attach-a-database#to-attach-a-database'; export const DatabaseGeneralPropertiesDocUrl = 'https://learn.microsoft.com/sql/relational-databases/databases/database-properties-general-page'; diff --git a/extensions/mssql/src/objectManagement/interfaces.ts b/extensions/mssql/src/objectManagement/interfaces.ts index 04c8141fe9..4ee4aa8f0c 100644 --- a/extensions/mssql/src/objectManagement/interfaces.ts +++ b/extensions/mssql/src/objectManagement/interfaces.ts @@ -546,6 +546,20 @@ export interface Server extends ObjectManagement.SqlObject { dataLocation: string; logLocation: string; backupLocation: string; + allowTriggerToFireOthers: boolean; + blockedProcThreshold: NumericServerProperty; + cursorThreshold: NumericServerProperty; + defaultFullTextLanguage: string; + defaultLanguage: string; + fullTextUpgradeOption: string; + maxTextReplicationSize: NumericServerProperty; + optimizeAdHocWorkloads: boolean; + scanStartupProcs: boolean; + twoDigitYearCutoff: number; + costThresholdParallelism: NumericServerProperty; + locks: NumericServerProperty; + maxDegreeParallelism: NumericServerProperty; + queryWait: NumericServerProperty; } /** @@ -573,6 +587,8 @@ export interface NumericServerProperty { } export interface ServerViewInfo extends ObjectManagement.ObjectViewInfo { + languageOptions: string[]; + fullTextUpgradeOptions: string[]; } export const enum FileGrowthType { diff --git a/extensions/mssql/src/objectManagement/localizedConstants.ts b/extensions/mssql/src/objectManagement/localizedConstants.ts index 2bbc9b4362..b02d84b507 100644 --- a/extensions/mssql/src/objectManagement/localizedConstants.ts +++ b/extensions/mssql/src/objectManagement/localizedConstants.ts @@ -328,6 +328,20 @@ export const databaseSettingsText = localize('objectManagement.databaseSettings' export const compressBackupText = localize('objectManagement.compressBackupText', "Compress Backup"); export const backupChecksumText = localize('objectManagement.backupChecksumText', "Backup checksum"); export const backupAndRestoreText = localize('objectManagement.backupAndRestoreText', "Backup and Restore"); +export const allowTriggerToFireOthersLabel = localize('objectManagement.allowTriggerToFireOthersLabel', "Allow Triggers to Fire Others"); +export const blockedProcThresholdLabel = localize('objectManagement.blockedProcThresholdLabel', "Blocked Process Threshold"); +export const cursorThresholdLabel = localize('objectManagement.cursorThresholdLabel', "Cursor Threshold"); +export const defaultFullTextLanguageLabel = localize('objectManagement.defaultFullTextLanguageLabel', "Default Full-Text Language"); +export const defaultLanguageLabel = localize('objectManagement.defaultLanguageLabel', "Default Language"); +export const fullTextUpgradeOptionLabel = localize('objectManagement.fullTextUpgradeOptionLabel', "Full-Text Upgrade Option"); +export const maxTextReplicationSizeLabel = localize('objectManagement.maxTextReplicationSizeLabel', "Max Text Replication Size"); +export const optimizeAdHocWorkloadsLabel = localize('objectManagement.optimizeAdHocWorkloadsLabel', "Optimize Ad Hoc Workloads"); +export const scanStartupProcsLabel = localize('objectManagement.scanStartupProcsLabel', "Scan Startup Procs "); +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 const maxDegreeParallelismLabel = localize('objectManagement.maxDegreeParallelismLabel', "Max Degree Parallelism"); +export const queryWaitLabel = localize('objectManagement.queryWaitLabel', "Query Wait"); //Database properties Dialog export const LastDatabaseBackupText = localize('objectManagement.lastDatabaseBackup', "Last Database Backup"); diff --git a/extensions/mssql/src/objectManagement/ui/serverPropertiesDialog.ts b/extensions/mssql/src/objectManagement/ui/serverPropertiesDialog.ts index 462d558333..1bb091e107 100644 --- a/extensions/mssql/src/objectManagement/ui/serverPropertiesDialog.ts +++ b/extensions/mssql/src/objectManagement/ui/serverPropertiesDialog.ts @@ -69,6 +69,23 @@ export class ServerPropertiesDialog extends ObjectManagementDialogBase { @@ -607,4 +630,148 @@ export class ServerPropertiesDialog extends ObjectManagementDialogBase { + this.objectInfo.allowTriggerToFireOthers = newValue === 'True'; + }, ['True', 'False'], this.objectInfo.allowTriggerToFireOthers ? 'True' : 'False'); + const allowTriggerToFireOthersContainer = this.createLabelInputContainer(localizedConstants.allowTriggerToFireOthersLabel, this.allowTriggerToFireOthersDropdown); + + this.blockedProcThresholdInput = this.createInputBox(async (newValue) => { + this.objectInfo.blockedProcThreshold.value = +newValue; + }, { + ariaLabel: localizedConstants.blockedProcThresholdLabel, + inputType: 'number', + min: this.objectInfo.blockedProcThreshold.minimumValue, + max: this.objectInfo.blockedProcThreshold.maximumValue, + value: this.objectInfo.blockedProcThreshold.value.toString() + }); + const blockedProcThresholdContainer = this.createLabelInputContainer(localizedConstants.blockedProcThresholdLabel, this.blockedProcThresholdInput); + + this.cursorThresholdInput = this.createInputBox(async (newValue) => { + this.objectInfo.cursorThreshold.value = +newValue; + }, { + ariaLabel: localizedConstants.cursorThresholdLabel, + inputType: 'number', + min: this.objectInfo.cursorThreshold.minimumValue, + max: this.objectInfo.cursorThreshold.maximumValue, + value: this.objectInfo.cursorThreshold.value.toString() + }); + const cursorThresholdContainer = this.createLabelInputContainer(localizedConstants.cursorThresholdLabel, this.cursorThresholdInput); + + this.defaultFullTextLanguageInput = this.createInputBox(async (newValue) => { + this.objectInfo.defaultFullTextLanguage = newValue; + }, { + ariaLabel: localizedConstants.defaultFullTextLanguageLabel, + value: this.objectInfo.defaultFullTextLanguage + }); + const defaultFullTextLanguageContainer = this.createLabelInputContainer(localizedConstants.defaultFullTextLanguageLabel, this.defaultFullTextLanguageInput); + + this.defaultLanguageDropdown = this.createDropdown(localizedConstants.defaultLanguageLabel, async (newValue) => { + this.objectInfo.defaultLanguage = newValue; + }, this.viewInfo.languageOptions, this.objectInfo.defaultLanguage); + const defaultLanguageContainer = this.createLabelInputContainer(localizedConstants.defaultLanguageLabel, this.defaultLanguageDropdown); + + this.fullTextUpgradeOptionDropdown = this.createDropdown(localizedConstants.fullTextUpgradeOptionLabel, async (newValue) => { + this.objectInfo.fullTextUpgradeOption = newValue; + }, this.viewInfo.fullTextUpgradeOptions, this.objectInfo.fullTextUpgradeOption); + const fullTextUpgradeOptionContainer = this.createLabelInputContainer(localizedConstants.fullTextUpgradeOptionLabel, this.fullTextUpgradeOptionDropdown); + + this.maxTextReplicationSizeInput = this.createInputBox(async (newValue) => { + this.objectInfo.maxTextReplicationSize.value = +newValue; + }, { + ariaLabel: localizedConstants.maxTextReplicationSizeLabel, + inputType: 'number', + min: this.objectInfo.maxTextReplicationSize.minimumValue, + max: this.objectInfo.maxTextReplicationSize.maximumValue, + value: this.objectInfo.maxTextReplicationSize.value.toString() + }); + const maxTextReplicationSizeContainer = this.createLabelInputContainer(localizedConstants.maxTextReplicationSizeLabel, this.maxTextReplicationSizeInput); + + this.optimizeAdHocWorkloadsDropdown = this.createDropdown(localizedConstants.optimizeAdHocWorkloadsLabel, async (newValue) => { + this.objectInfo.optimizeAdHocWorkloads = newValue === 'True'; + }, ['True', 'False'], this.objectInfo.optimizeAdHocWorkloads ? 'True' : 'False'); + const optimizeAdHocWorkloadsContainer = this.createLabelInputContainer(localizedConstants.optimizeAdHocWorkloadsLabel, this.optimizeAdHocWorkloadsDropdown); + + this.scanStartupProcsDropdown = this.createDropdown(localizedConstants.scanStartupProcsLabel, async (newValue) => { + this.objectInfo.scanStartupProcs = newValue === 'True'; + }, ['True', 'False'], this.objectInfo.scanStartupProcs ? 'True' : 'False'); + const scanStartupProcsContainer = this.createLabelInputContainer(localizedConstants.scanStartupProcsLabel, this.scanStartupProcsDropdown); + + this.twoDigitYearCutoffInput = this.createInputBox(async (newValue) => { + this.objectInfo.twoDigitYearCutoff = +newValue; + }, { + ariaLabel: localizedConstants.twoDigitYearCutoffLabel, + inputType: 'number', + value: this.objectInfo.twoDigitYearCutoff.toString() + }); + const twoDigitYearCutoffContainer = this.createLabelInputContainer(localizedConstants.twoDigitYearCutoffLabel, this.twoDigitYearCutoffInput); + + this.costThresholdParallelismInput = this.createInputBox(async (newValue) => { + this.objectInfo.costThresholdParallelism.value = +newValue; + }, { + ariaLabel: localizedConstants.costThresholdParallelismLabel, + inputType: 'number', + min: this.objectInfo.costThresholdParallelism.minimumValue, + max: this.objectInfo.costThresholdParallelism.maximumValue, + value: this.objectInfo.costThresholdParallelism.value.toString() + }); + const costThresholdParallelismContainer = this.createLabelInputContainer(localizedConstants.costThresholdParallelismLabel, this.costThresholdParallelismInput); + + this.locksInput = this.createInputBox(async (newValue) => { + this.objectInfo.locks.value = +newValue; + }, { + ariaLabel: localizedConstants.locksLabel, + inputType: 'number', + max: this.objectInfo.locks.maximumValue, + value: this.objectInfo.locks.value.toString() + }); + const locksContainer = this.createLabelInputContainer(localizedConstants.locksLabel, this.locksInput); + + this.maxDegreeParallelismInput = this.createInputBox(async (newValue) => { + this.objectInfo.maxDegreeParallelism.value = +newValue; + }, { + ariaLabel: localizedConstants.maxDegreeParallelismLabel, + inputType: 'number', + min: this.objectInfo.maxDegreeParallelism.minimumValue, + max: this.objectInfo.maxDegreeParallelism.maximumValue, + value: this.objectInfo.maxDegreeParallelism.value.toString() + }); + const maxDegreeParallelismContainer = this.createLabelInputContainer(localizedConstants.maxDegreeParallelismLabel, this.maxDegreeParallelismInput); + + this.queryWaitInput = this.createInputBox(async (newValue) => { + this.objectInfo.queryWait.value = +newValue; + }, { + ariaLabel: localizedConstants.queryWaitLabel, + inputType: 'number', + min: this.objectInfo.queryWait.minimumValue, + max: this.objectInfo.queryWait.maximumValue, + value: this.objectInfo.queryWait.value.toString() + }); + const queryWaitContainer = this.createLabelInputContainer(localizedConstants.queryWaitLabel, this.queryWaitInput); + + const miscellaneousSection = this.createGroup('Miscellaneous', [ + allowTriggerToFireOthersContainer, + blockedProcThresholdContainer, + cursorThresholdContainer, + defaultFullTextLanguageContainer, + defaultLanguageContainer, + fullTextUpgradeOptionContainer, + maxTextReplicationSizeContainer, + optimizeAdHocWorkloadsContainer, + scanStartupProcsContainer, + twoDigitYearCutoffContainer + ], true); + const parallelismSection = this.createGroup('Parallelism', [ + costThresholdParallelismContainer, + locksContainer, + maxDegreeParallelismContainer, + queryWaitContainer + ], true); + + const advancedTabContainer = this.createGroup('', [miscellaneousSection, parallelismSection]) + + this.advancedTab = this.createTab(this.advancedTabId, localizedConstants.AdvancedSectionHeader, advancedTabContainer); + } + }