mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Notify user to restart server (#24351)
This commit is contained in:
@@ -87,9 +87,13 @@ export class ServerPropertiesDialog extends ObjectManagementDialogBase<Server, S
|
|||||||
private queryWaitInput: azdata.InputBoxComponent;
|
private queryWaitInput: azdata.InputBoxComponent;
|
||||||
|
|
||||||
private activeTabId: string;
|
private activeTabId: string;
|
||||||
|
private shouldRestartServer: boolean = false;
|
||||||
|
|
||||||
constructor(objectManagementService: IObjectManagementService, options: ObjectManagementDialogOptions) {
|
constructor(objectManagementService: IObjectManagementService, options: ObjectManagementDialogOptions) {
|
||||||
super(objectManagementService, options);
|
super(objectManagementService, options);
|
||||||
|
this.disposables.push(this.dialogObject.onClosed(async () => {
|
||||||
|
await this.notifyServerRestart();
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override get helpUrl(): string {
|
protected override get helpUrl(): string {
|
||||||
@@ -364,6 +368,13 @@ export class ServerPropertiesDialog extends ObjectManagementDialogBase<Server, S
|
|||||||
return errors;
|
return errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async notifyServerRestart(): Promise<void> {
|
||||||
|
if (this.shouldRestartServer) {
|
||||||
|
await vscode.window.showInformationMessage(localizedConstants.needToRestartServer, { modal: true });
|
||||||
|
this.shouldRestartServer = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private initializeProcessorsSection(): void {
|
private initializeProcessorsSection(): void {
|
||||||
const isEnabled = this.engineEdition !== azdata.DatabaseEngineEdition.SqlManagedInstance;
|
const isEnabled = this.engineEdition !== azdata.DatabaseEngineEdition.SqlManagedInstance;
|
||||||
let nodes: NumaNode[] = this.objectInfo.numaNodes;
|
let nodes: NumaNode[] = this.objectInfo.numaNodes;
|
||||||
@@ -491,7 +502,7 @@ export class ServerPropertiesDialog extends ObjectManagementDialogBase<Server, S
|
|||||||
|
|
||||||
private initializeSecuritySection(): void {
|
private initializeSecuritySection(): void {
|
||||||
// cannot change auth mode in sql managed instance or non windows instances
|
// cannot change auth mode in sql managed instance or non windows instances
|
||||||
const isEnabled = this.engineEdition !== azdata.DatabaseEngineEdition.SqlManagedInstance && this.objectInfo.platform !== 'Windows';
|
const isEnabled = this.engineEdition !== azdata.DatabaseEngineEdition.SqlManagedInstance && this.objectInfo.platform === 'Windows';
|
||||||
const radioServerGroupName = 'serverAuthenticationRadioGroup';
|
const radioServerGroupName = 'serverAuthenticationRadioGroup';
|
||||||
this.onlyWindowsAuthRadioButton = this.createRadioButton(localizedConstants.onlyWindowsAuthModeText, radioServerGroupName, this.objectInfo.authenticationMode === ServerLoginMode.Integrated, async () => { await this.handleAuthModeChange(); });
|
this.onlyWindowsAuthRadioButton = this.createRadioButton(localizedConstants.onlyWindowsAuthModeText, radioServerGroupName, this.objectInfo.authenticationMode === ServerLoginMode.Integrated, async () => { await this.handleAuthModeChange(); });
|
||||||
this.sqlServerAndWindowsAuthRadioButton = this.createRadioButton(localizedConstants.sqlServerAndWindowsAuthText, radioServerGroupName, this.objectInfo.authenticationMode === ServerLoginMode.Mixed, async () => { await this.handleAuthModeChange(); });
|
this.sqlServerAndWindowsAuthRadioButton = this.createRadioButton(localizedConstants.sqlServerAndWindowsAuthText, radioServerGroupName, this.objectInfo.authenticationMode === ServerLoginMode.Mixed, async () => { await this.handleAuthModeChange(); });
|
||||||
@@ -529,7 +540,7 @@ export class ServerPropertiesDialog extends ObjectManagementDialogBase<Server, S
|
|||||||
this.objectInfo.authenticationMode = ServerLoginMode.Mixed;
|
this.objectInfo.authenticationMode = ServerLoginMode.Mixed;
|
||||||
}
|
}
|
||||||
if (this.objectInfo.authenticationMode !== this.originalObjectInfo.authenticationMode) {
|
if (this.objectInfo.authenticationMode !== this.originalObjectInfo.authenticationMode) {
|
||||||
await vscode.window.showInformationMessage(localizedConstants.needToRestartServer, { modal: true });
|
this.shouldRestartServer = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -580,21 +591,33 @@ export class ServerPropertiesDialog extends ObjectManagementDialogBase<Server, S
|
|||||||
|
|
||||||
this.dataLocationInput = this.createInputBox(async (newValue) => {
|
this.dataLocationInput = this.createInputBox(async (newValue) => {
|
||||||
this.objectInfo.dataLocation = newValue;
|
this.objectInfo.dataLocation = newValue;
|
||||||
|
if (this.objectInfo.dataLocation !== this.originalObjectInfo.dataLocation) {
|
||||||
|
this.shouldRestartServer = true;
|
||||||
|
}
|
||||||
}, dataLocationInputboxProps);
|
}, dataLocationInputboxProps);
|
||||||
const dataLocationButton = this.createBrowseButton(async () => {
|
const dataLocationButton = this.createBrowseButton(async () => {
|
||||||
const newPath = await this.selectFolder(this.objectInfo.dataLocation);
|
const newPath = await this.selectFolder(this.objectInfo.dataLocation);
|
||||||
this.dataLocationInput.value = newPath;
|
this.dataLocationInput.value = newPath;
|
||||||
this.objectInfo.dataLocation = newPath;
|
this.objectInfo.dataLocation = newPath;
|
||||||
|
if (this.objectInfo.dataLocation !== this.originalObjectInfo.dataLocation) {
|
||||||
|
this.shouldRestartServer = true;
|
||||||
|
}
|
||||||
}, isEnabled);
|
}, isEnabled);
|
||||||
const dataLocationInputContainer = this.createLabelInputContainer(localizedConstants.dataLocationText, [this.dataLocationInput, dataLocationButton])
|
const dataLocationInputContainer = this.createLabelInputContainer(localizedConstants.dataLocationText, [this.dataLocationInput, dataLocationButton])
|
||||||
|
|
||||||
this.logLocationInput = this.createInputBox(async (newValue) => {
|
this.logLocationInput = this.createInputBox(async (newValue) => {
|
||||||
this.objectInfo.logLocation = newValue;
|
this.objectInfo.logLocation = newValue;
|
||||||
|
if (this.objectInfo.logLocation !== this.originalObjectInfo.logLocation) {
|
||||||
|
this.shouldRestartServer = true;
|
||||||
|
}
|
||||||
}, logLocationInputboxProps);
|
}, logLocationInputboxProps);
|
||||||
const logLocationButton = this.createBrowseButton(async () => {
|
const logLocationButton = this.createBrowseButton(async () => {
|
||||||
const newPath = await this.selectFolder(this.objectInfo.logLocation);
|
const newPath = await this.selectFolder(this.objectInfo.logLocation);
|
||||||
this.logLocationInput.value = newPath;
|
this.logLocationInput.value = newPath;
|
||||||
this.objectInfo.logLocation = newPath;
|
this.objectInfo.logLocation = newPath;
|
||||||
|
if (this.objectInfo.logLocation !== this.originalObjectInfo.logLocation) {
|
||||||
|
this.shouldRestartServer = true;
|
||||||
|
}
|
||||||
}, isEnabled);
|
}, isEnabled);
|
||||||
const logLocationInputContainer = this.createLabelInputContainer(localizedConstants.logLocationText, [this.logLocationInput, logLocationButton])
|
const logLocationInputContainer = this.createLabelInputContainer(localizedConstants.logLocationText, [this.logLocationInput, logLocationButton])
|
||||||
|
|
||||||
@@ -782,5 +805,4 @@ export class ServerPropertiesDialog extends ObjectManagementDialogBase<Server, S
|
|||||||
|
|
||||||
this.advancedTab = this.createTab(this.advancedTabId, localizedConstants.AdvancedSectionHeader, advancedTabContainer);
|
this.advancedTab = this.createTab(this.advancedTabId, localizedConstants.AdvancedSectionHeader, advancedTabContainer);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user