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

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