Add advanced tab (#24267)

This commit is contained in:
Barbara Valdez
2023-09-01 16:53:46 -07:00
committed by GitHub
parent d2668d8eb8
commit e05ee98dae
4 changed files with 200 additions and 2 deletions

View File

@@ -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';

View File

@@ -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<Server> {
languageOptions: string[];
fullTextUpgradeOptions: string[];
}
export const enum FileGrowthType {

View File

@@ -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");

View File

@@ -69,6 +69,23 @@ export class ServerPropertiesDialog extends ObjectManagementDialogBase<Server, S
private logLocationInput: azdata.InputBoxComponent;
private backupLocationInput: azdata.InputBoxComponent;
private advancedTab: azdata.Tab;
private readonly advancedTabId: string = 'advancedId';
private allowTriggerToFireOthersDropdown: azdata.DropDownComponent;
private blockedProcThresholdInput: azdata.InputBoxComponent;
private cursorThresholdInput: azdata.InputBoxComponent;
private defaultFullTextLanguageInput: azdata.InputBoxComponent;
private defaultLanguageDropdown: azdata.DropDownComponent;
private fullTextUpgradeOptionDropdown: azdata.DropDownComponent;
private maxTextReplicationSizeInput: azdata.InputBoxComponent;
private optimizeAdHocWorkloadsDropdown: azdata.DropDownComponent;
private scanStartupProcsDropdown: azdata.DropDownComponent;
private twoDigitYearCutoffInput: azdata.InputBoxComponent;
private costThresholdParallelismInput: azdata.InputBoxComponent;
private locksInput: azdata.InputBoxComponent;
private maxDegreeParallelismInput: azdata.InputBoxComponent;
private queryWaitInput: azdata.InputBoxComponent;
private activeTabId: string;
constructor(objectManagementService: IObjectManagementService, options: ObjectManagementDialogOptions) {
@@ -93,6 +110,9 @@ export class ServerPropertiesDialog extends ObjectManagementDialogBase<Server, S
case this.databaseSettingsTabId:
helpUrl = constants.ViewDatabaseSettingsPropertiesDocUrl;
break;
case this.advancedTabId:
helpUrl = constants.ViewAdvancedServerPropertiesDocUrl;
break;
default:
break;
}
@@ -107,7 +127,8 @@ export class ServerPropertiesDialog extends ObjectManagementDialogBase<Server, S
this.initializeProcessorsSection();
this.initializeSecuritySection();
this.initializeDatabaseSettingsSection();
const serverPropertiesTabGroup = { title: '', tabs: [this.generalTab, this.memoryTab, this.processorsTab, this.securityTab, this.databaseSettingsTab] };
this.initializeAdvancedSection();
const serverPropertiesTabGroup = { title: '', tabs: [this.generalTab, this.memoryTab, this.processorsTab, this.securityTab, this.databaseSettingsTab, this.advancedTab] };
const serverPropertiesTabbedPannel = this.modelView.modelBuilder.tabbedPanel()
.withTabs([serverPropertiesTabGroup])
.withProps({
@@ -498,7 +519,9 @@ export class ServerPropertiesDialog extends ObjectManagementDialogBase<Server, S
if (this.sqlServerAndWindowsAuthRadioButton.checked) {
this.objectInfo.authenticationMode = ServerLoginMode.Mixed;
}
await vscode.window.showInformationMessage(localizedConstants.needToRestartServer, { modal: true });
if (this.objectInfo.authenticationMode !== this.originalObjectInfo.authenticationMode) {
await vscode.window.showInformationMessage(localizedConstants.needToRestartServer, { modal: true });
}
}
private async handleAuditLevelChange(): Promise<void> {
@@ -607,4 +630,148 @@ export class ServerPropertiesDialog extends ObjectManagementDialogBase<Server, S
}
return undefined;
}
private initializeAdvancedSection(): void {
this.allowTriggerToFireOthersDropdown = this.createDropdown(localizedConstants.allowTriggerToFireOthersLabel, async (newValue) => {
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);
}
}