mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-03 01:25:38 -05:00
Edit Postgres Engine Settings Per Role (#15481)
* Enables being able to view and edit Coordinator node scheduling params (#15114) * Trying to save per role settings * Updated spec * Cleaning up * Removed unneccessary code and comments * Added separate type for { w?: string, c?: string}, PR fixes * Added methods to refresh mr,ml,cr,cl versus per role * Fixed spec * Put back optional properties, removed passing empty string to reset scheduling params * Spacing * vBump arc * Included roles in fake show output for testing (#15196) * Update arc specs (#15225) * Update azdata Arc specs to match April azdata * vcores -> cpu * fix spacing * Consolidate types and update storage volumes * Fix compile * Fix spec * include coordinator * Adding args * Query call success * Check for success in query * List full coordinator params * Change name * Update unit test for engine settings * Pr changes * Fix query Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>
This commit is contained in:
@@ -269,6 +269,13 @@ export abstract class PostgresParametersPage extends DashboardPage {
|
||||
|
||||
this.disposables.push(
|
||||
this.connectToServerButton.onDidClick(async () => {
|
||||
let scale = this._postgresModel.config?.spec.scale;
|
||||
let nodes = (scale?.workers ?? scale?.shards ?? 0);
|
||||
if (this.title === loc.workerNodeParameters && nodes === 0) {
|
||||
vscode.window.showInformationMessage(loc.noWorkerPods);
|
||||
return;
|
||||
}
|
||||
|
||||
this.connectToServerButton!.enabled = false;
|
||||
if (!vscode.extensions.getExtension(loc.postgresExtension)) {
|
||||
const response = await vscode.window.showErrorMessage(loc.missingExtension('PostgreSQL'), loc.yes, loc.no);
|
||||
@@ -437,11 +444,13 @@ export abstract class PostgresParametersPage extends DashboardPage {
|
||||
let valueComponent: azdata.Component;
|
||||
if (engineSetting.type === 'enum') {
|
||||
// If type is enum, component should be drop down menu
|
||||
let options = engineSetting.options?.slice(1, -1).split(',');
|
||||
let values: string[] = [];
|
||||
options!.forEach(option => {
|
||||
values.push(option.slice(option.indexOf('"') + 1, -1));
|
||||
});
|
||||
if (typeof engineSetting.options === 'string') {
|
||||
let options = engineSetting.options?.slice(1, -1).split(',');
|
||||
values = options.map(option => option.slice(option.indexOf('"') + 1, -1));
|
||||
} else if (engineSetting.options) {
|
||||
values = engineSetting.options;
|
||||
}
|
||||
|
||||
let valueBox = this.modelView.modelBuilder.dropDown().withProps({
|
||||
values: values,
|
||||
|
||||
Reference in New Issue
Block a user