Changing Postgres Hyperscale to Postgres Azure Arc in ADS (#20445)

* Hard code enginer ver to 14 and remove extension from wizard field and notebook

* Removed hyperscale text from everywhere but links

* Made PostgreSQL into PostgreSQL server and other text changes. Removed worker nodes

* Removed coordinator node text

* Removed worker nodes from compute + storage. Changed az arc-server to server-arc. postgresParameters.ts may need

* Removed tabs for extensions, coord nodes, worker nodes, resource health, diagnose and solve

* Removed node configuation and pg version from overview and properties. Edited arialabels

* Change server group nodes to server

* Removed type from overview table and aded Preview tags

* Removed info bubble and added padding to top of title

* Removed checkbox from PG create wizard. Added link and text

* Remove engine version

* Changed naming conventions

* Removed coord and server group from variables

* Removed properties

* Removed Server table, admin username, reset password

* Removed function from notebook

* Change wording

* bump version

Co-authored-by: Candice Ye <canye@microsoft.com>
This commit is contained in:
Candice Ye
2022-08-26 13:24:48 -07:00
committed by GitHub
parent 04ca5fbe42
commit bd0c4cdb51
26 changed files with 307 additions and 936 deletions

View File

@@ -10,10 +10,10 @@ const localize = nls.loadMessageBundle();
export const arcDeploymentDeprecation = localize('arc.arcDeploymentDeprecation', "The Arc Deployment extension has been replaced by the Arc extension and has been uninstalled.");
export function arcControllerDashboard(name: string): string { return localize('arc.controllerDashboard', "Azure Arc Data Controller Dashboard - {0}", name); }
export function miaaDashboard(name: string): string { return localize('arc.miaaDashboard', "SQL managed instance - Azure Arc Dashboard - {0}", name); }
export function postgresDashboard(name: string): string { return localize('arc.postgresDashboard', "PostgreSQL Hyperscale - Azure Arc Dashboard - {0}", name); }
export function postgresDashboard(name: string): string { return localize('arc.postgresDashboard', "PostgreSQL server - Azure Arc Dashboard (Preview) - {0}", name); }
export const dataControllersType = localize('arc.dataControllersType', "Azure Arc Data Controller");
export const pgSqlType = localize('arc.pgSqlType', "PostgreSQL Hyperscale - Azure Arc");
export const pgSqlType = localize('arc.pgSqlType', "PostgreSQL server - Azure Arc");
export const miaaType = localize('arc.miaaType', "SQL managed instance - Azure Arc");
export const overview = localize('arc.overview', "Overview");
@@ -130,7 +130,7 @@ export const noInstancesAvailable = localize('arc.noInstancesAvailable', "No ins
export const connectToServer = localize('arc.connectToServer', "Connect to Server");
export const connectToController = localize('arc.connectToController', "Connect to Existing Controller");
export function connectToMSSql(name: string): string { return localize('arc.connectToMSSql', "Connect to SQL managed instance - Azure Arc ({0})", name); }
export function connectToPGSql(name: string): string { return localize('arc.connectToPGSql', "Connect to PostgreSQL Hyperscale - Azure Arc ({0})", name); }
export function connectToPGSql(name: string): string { return localize('arc.connectToPGSql', "Connect to PostgreSQL server - Azure Arc ({0})", name); }
export const passwordToController = localize('arc.passwordToController', "Provide Password to Controller");
export const controllerUrl = localize('arc.controllerUrl', "Controller URL");
export const controllerUrlPlaceholder = localize('arc.controllerUrlPlaceholder', "https://<IP or hostname>:<port>");
@@ -171,7 +171,7 @@ export const postgresAdminUsername = localize('arc.postgresAdminUsername', "Admi
export const nodeConfiguration = localize('arc.nodeConfiguration', "Node configuration");
export const postgresVersion = localize('arc.postgresVersion', "PostgreSQL version");
export const serverGroupType = localize('arc.serverGroupType', "Server group type");
export const serverGroupNodes = localize('arc.serverGroupNodes', "Server group nodes");
export const server = localize('arc.server', "Server");
export const fullyQualifiedDomain = localize('arc.fullyQualifiedDomain', "Fully qualified domain");
export const postgresArcProductName = localize('arc.postgresArcProductName', "Azure Database for PostgreSQL - Azure Arc");
export const coordinator = localize('arc.coordinator', "Coordinator");
@@ -183,10 +183,10 @@ export const newDatabase = localize('arc.newDatabase', "New Database");
export const databaseName = localize('arc.databaseName', "Database name");
export const enterNewPassword = localize('arc.enterNewPassword', "Enter a new password");
export const confirmNewPassword = localize('arc.confirmNewPassword', "Confirm the new password");
export const learnAboutPostgresClients = localize('arc.learnAboutPostgresClients', "Learn more about Azure PostgreSQL Hyperscale client interfaces");
export const learnAboutPostgresClients = localize('arc.learnAboutPostgresClients', "Learn more about Azure PostgreSQL client interfaces");
export const coordinatorNodeParametersDescription = localize('arc.coordinatorNodeParametersDescription', " These server parameters of the Coordinator node can be set to custom (non-default) values. Search to find parameters.");
export const workerNodesParametersDescription = localize('arc.workerNodesParametersDescription', " These server parameters of the Worker nodes can be set to custom (non-default) values. Search to find parameters.");
export const learnAboutNodeParameters = localize('arc.learnAboutNodeParameters', "Learn more about database engine settings for Azure Arc-enabled PostgreSQL Hyperscale");
export const learnAboutNodeParameters = localize('arc.learnAboutNodeParameters', "Learn more about database engine settings for Azure Arc-enabled PostgreSQL");
export const noNodeParametersFound = localize('arc.noNodeParametersFound', "No worker server parameters found...");
export const searchToFilter = localize('arc.searchToFilter', "Search to filter items...");
export const scalingCompute = localize('arc.scalingCompute', "scaling compute vCores and memory.");
@@ -196,7 +196,7 @@ export const miaaBackupsDatabasesDescription = localize('arc.miaaBackupsDatabase
export const pitrInfo = localize('arc.pitrInfo', "Specify how long you want to keep your point-in-time backups. Customize this for backup availability.");
export const restoreInfo = localize('arc.restoreInfo', "Restore a database to an Azure Arc enabled SQL Managed Instance.");
export const restorePointText = localize('arc.restorePointText', "Enter a restore point in the specified time format within given range of earliest and latest restore time.");
export const postgresComputeAndStorageDescriptionPartTwo = localize('arc.postgres.computeAndStorageDescriptionPartTwo', "PostgreSQL Hyperscale server group by");
export const postgresComputeAndStorageDescriptionPartTwo = localize('arc.postgres.computeAndStorageDescriptionPartTwo', "PostgreSQL by");
export const computeAndStorageDescriptionPartThree = localize('arc.computeAndStorageDescriptionPartThree', "without downtime and by");
export const computeAndStorageDescriptionPartFour = localize('arc.computeAndStorageDescriptionPartFour', "Before doing so, you need to ensure");
export const computeAndStorageDescriptionPartFive = localize('arc.computeAndStorageDescriptionPartFive', "there are sufficient resources available");
@@ -205,24 +205,16 @@ export const computeAndStorageDescriptionPartSix = localize('arc.computeAndStora
export const node = localize('arc.node', "node");
export const nodes = localize('arc.nodes', "nodes");
export const workerNodes = localize('arc.workerNodes', "Worker Nodes");
export const coordinatorNode = localize('arc.coordinatorNode', "Coordinator Node");
export const storagePerNode = localize('arc.storagePerNode', "storage per node");
export const workerNodeCount = localize('arc.workerNodeCount', "Worker node count");
export const configurationPerNode = localize('arc.configurationPerNode', "Configuration (per node)");
export const configuration = localize('arc.configurationCoordinatorNode', "Configuration");
export const computeConfiguration = localize('arc.computeConfiguration', "Compute Configuration");
export const configurationPerNode = localize('arc.configurationPerNode', "Configuration");
export const configuration = localize('arc.configurationCoordinatorNode', "Node Configuration");
export const coresLimit = localize('arc.coresLimit', "CPU limit");
export const workerCoresLimit = localize('arc.workerCoresLimit', "Worker Nodes CPU limit");
export const coordinatorCoresLimit = localize('arc.coordinatorCoresLimit', "Coordinator Node CPU limit");
export const coresRequest = localize('arc.coresRequest', "CPU request");
export const workerCoresRequest = localize('arc.workerCoresRequest', "Worker Nodes CPU request");
export const coordinatorCoresRequest = localize('arc.coordinatorCoresRequest', "Coordinator Node CPU request");
export const memoryLimit = localize('arc.memoryLimit', "Memory limit (in GB)");
export const retentionDays = localize('arc.retentionDays', "Point-In-Time Recovery retention (days)");
export const workerMemoryLimit = localize('arc.workerMemoryLimit', "Worker Nodes Memory limit (in GB)");
export const coordinatorMemoryLimit = localize('arc.coordinatorMemoryLimit', "Coordinator Node Memory limit (in GB)");
export const memoryRequest = localize('arc.memoryRequest', "Memory request (in GB)");
export const workerMemoryRequest = localize('arc.workerMemoryRequest', "Worker Nodes Memory request (in GB)");
export const coordinatorMemoryRequest = localize('arc.coordinatorMemoryRequest', "Coordinator Node Memory request (in GB)");
export const syncSecondaryToCommit = localize('arc.syncSecondaryToCommit', "Sync Secondary To Commit");
export const arcResources = localize('arc.arcResources', "Azure Arc Resources");
export const enterANonEmptyPassword = localize('arc.enterANonEmptyPassword', "Enter a non empty password or press escape to exit.");
@@ -242,7 +234,7 @@ export const connectToPostgresDescription = localize('arc.connectToPostgresDescr
export const postgresExtension = localize('arc.postgresExtension', "microsoft.azuredatastudio-postgresql");
export const podInitialized = localize('arc.podInitialized', "Pod is initialized.");
export const podReady = localize('arc.podReady', "Pod is ready.");
export const noPodIssuesDetected = localize('arc.noPodIssuesDetected', "There arent any known issues affecting this PostgreSQL Hyperscale instance.");
export const noPodIssuesDetected = localize('arc.noPodIssuesDetected', "There arent any known issues affecting this PostgreSQL instance.");
export const podIssuesDetected = localize('arc.podIssuesDetected', "The pods listed below are experiencing issues that may affect performance or availability.");
export const containerReady = localize('arc.containerReady', "Pod containers are ready.");
export const podScheduled = localize('arc.podScheduled', "Pod is schedulable.");
@@ -306,7 +298,7 @@ export function pageDiscardFailed(error: any): string { return localize('arc.pag
export function databaseCreationFailed(name: string, error: any): string { return localize('arc.databaseCreationFailed', "Failed to create database {0}. {1}", name, getErrorMessage(error)); }
export function connectToControllerFailed(url: string, error: any): string { return localize('arc.connectToControllerFailed', "Could not connect to controller {0}. {1}", url, getErrorMessage(error)); }
export function connectToMSSqlFailed(serverName: string, error: any): string { return localize('arc.connectToMSSqlFailed', "Could not connect to SQL managed instance - Azure Arc Instance {0}. {1}", serverName, getErrorMessage(error)); }
export function connectToPGSqlFailed(serverName: string, error: any): string { return localize('arc.connectToPGSqlFailed', "Could not connect to PostgreSQL Hyperscale - Azure Arc Instance {0}. {1}", serverName, getErrorMessage(error)); }
export function connectToPGSqlFailed(serverName: string, error: any): string { return localize('arc.connectToPGSqlFailed', "Could not connect to PostgreSQL server - Azure Arc Instance {0}. {1}", serverName, getErrorMessage(error)); }
export function missingExtension(extensionName: string): string { return localize('arc.missingExtension', "The {0} extension is required to view engine settings. Do you wish to install it now?", extensionName); }
export function extensionInstallationFailed(extensionName: string): string { return localize('arc.extensionInstallationFailed', "Failed to install extension {0}.", extensionName); }
export function fetchConfigFailed(name: string, error: any): string { return localize('arc.fetchConfigFailed', "An unexpected error occurred retrieving the config for '{0}'. {1}", name, getErrorMessage(error)); }

View File

@@ -101,7 +101,7 @@ export class ControllerModel {
]);
const newRegistrations: Registration[] = [];
await Promise.all([
this._azApi.az.postgres.arcserver.list(namespace, this.azAdditionalEnvVars).then(result => {
this._azApi.az.postgres.serverarc.list(namespace, this.azAdditionalEnvVars).then(result => {
newRegistrations.push(...result.stdout.map(r => {
return {
instanceName: r.name,

View File

@@ -118,7 +118,7 @@ export class PostgresModel extends ResourceModel {
}
this._refreshPromise = new Deferred();
try {
this._config = (await this._azApi.az.postgres.arcserver.show(this.info.name, this.controllerModel.info.namespace, this.controllerModel.azAdditionalEnvVars)).stdout;
this._config = (await this._azApi.az.postgres.serverarc.show(this.info.name, this.controllerModel.info.namespace, this.controllerModel.azAdditionalEnvVars)).stdout;
this.configLastUpdated = new Date();
this._onConfigUpdated.fire(this._config);
this._refreshPromise.resolve();

View File

@@ -13,7 +13,6 @@ import { PostgresModel } from '../../../models/postgresModel';
import { convertToGibibyteString } from '../../../common/utils';
export type RoleSpecifier = {
workers?: string,
coordinator?: string
};
@@ -28,12 +27,6 @@ export type ConfigurationSpecModel = {
export class PostgresComputeAndStoragePage extends DashboardPage {
private userInputContainer!: azdata.DivContainer;
private workerCountBox!: azdata.InputBoxComponent;
private workerCoresLimitBox!: azdata.InputBoxComponent;
private workerCoresRequestBox!: azdata.InputBoxComponent;
private workerMemoryLimitBox!: azdata.InputBoxComponent;
private workerMemoryRequestBox!: azdata.InputBoxComponent;
private coordinatorCoresLimitBox!: azdata.InputBoxComponent;
private coordinatorCoresRequestBox!: azdata.InputBoxComponent;
private coordinatorMemoryLimitBox!: azdata.InputBoxComponent;
@@ -88,12 +81,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
CSSStyles: { ...cssStyles.text, 'margin-block-start': '0px', 'margin-block-end': '0px' }
}).component();
const workerNodeslink = this.modelView.modelBuilder.hyperlink().withProps({
label: loc.addingWorkerNodes,
url: 'https://docs.microsoft.com/azure/azure-arc/data/scale-up-down-postgresql-hyperscale-server-group-using-cli',
CSSStyles: { 'margin-block-start': '0px', 'margin-block-end': '0px' }
}).component();
const infoComputeStorage_p3 = this.modelView.modelBuilder.text().withProps({
value: loc.computeAndStorageDescriptionPartThree,
CSSStyles: { ...cssStyles.text, 'margin-block-start': '0px', 'margin-block-end': '0px' }
@@ -125,7 +112,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
.withItems([
infoComputeStorage_p1,
infoComputeStorage_p2,
workerNodeslink,
infoComputeStorage_p3,
memoryVCoreslink,
infoComputeStorage_p4,
@@ -165,10 +151,9 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
},
async (_progress, _token): Promise<void> => {
try {
await this._azApi.az.postgres.arcserver.edit(
await this._azApi.az.postgres.serverarc.update(
this._postgresModel.info.name,
{
workers: this.saveArgs.workers,
coresRequest: this.schedulingParamsToEdit(this.saveArgs.coresRequest!),
coresLimit: this.schedulingParamsToEdit(this.saveArgs.coresLimit!),
memoryRequest: this.schedulingParamsToEdit(this.saveArgs.memoryRequest!),
@@ -210,11 +195,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
this.discardButton.onDidClick(async () => {
this.discardButton.enabled = false;
try {
this.workerCountBox.value = this.currentConfiguration.workers!.toString();
this.workerCoresRequestBox.value = this.currentConfiguration.coresRequest!.workers;
this.workerCoresLimitBox.value = this.currentConfiguration.coresLimit!.workers;
this.workerMemoryRequestBox.value = this.currentConfiguration.memoryRequest!.workers;
this.workerMemoryLimitBox.value = this.currentConfiguration.memoryLimit!.workers;
this.coordinatorCoresRequestBox.value = this.currentConfiguration.coresRequest!.coordinator;
this.coordinatorCoresLimitBox.value = this.currentConfiguration.coresLimit!.coordinator;
this.coordinatorMemoryRequestBox.value = this.currentConfiguration.memoryRequest!.coordinator;
@@ -234,131 +214,21 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
private schedulingParamsToEdit(arg: RoleSpecifier): string | undefined {
// A comma-separated list of roles with values can be specified in format <role>=<value>.
if (arg.workers && arg.coordinator) {
return `"${arg.workers},${arg.coordinator}"`;
if (arg.coordinator) {
return `"${arg.coordinator}"`;
} else {
return arg.workers ?? arg.coordinator ?? undefined;
return arg.coordinator ?? undefined;
}
}
private initializeConfigurationBoxes(): void {
// Worker node count
this.workerCountBox = this.modelView.modelBuilder.inputBox().withProps({
readOnly: false,
min: 0,
inputType: 'number',
placeHolder: loc.loading,
required: true,
ariaLabel: loc.workerNodeCount,
validationErrorMessage: loc.workerOneNodeValidationMessage
}).withValidation((component) => {
if (component.value === '1') {
return false;
}
return true;
}).component();
this.disposables.push(
this.workerCountBox.onTextChanged(() => {
if (!this.saveValueToEdit(this.workerCountBox, this.currentConfiguration.workers!.toString())) {
this.saveArgs.workers = undefined;
} else {
this.saveArgs.workers = parseInt(this.workerCountBox.value!);
}
})
);
// Worker nodes cores request
this.workerCoresRequestBox = this.modelView.modelBuilder.inputBox().withProps({
readOnly: false,
min: 1,
inputType: 'number',
placeHolder: loc.loading,
ariaLabel: loc.workerCoresRequest
}).component();
this.disposables.push(
this.workerCoresRequestBox.onTextChanged(() => {
if (!(this.saveValueToEdit(this.workerCoresRequestBox, this.currentConfiguration.coresRequest!.workers!))) {
this.saveArgs.coresRequest!.workers = undefined;
} else if (this.workerCoresRequestBox.value === '') {
this.saveArgs.coresRequest!.workers = 'w=';
} else {
this.saveArgs.coresRequest!.workers = `w=${this.workerCoresRequestBox.value}`;
}
})
);
// Worker nodes cores limit
this.workerCoresLimitBox = this.modelView.modelBuilder.inputBox().withProps({
readOnly: false,
min: 1,
inputType: 'number',
placeHolder: loc.loading,
ariaLabel: loc.workerCoresLimit
}).component();
this.disposables.push(
this.workerCoresLimitBox.onTextChanged(() => {
if (!(this.saveValueToEdit(this.workerCoresLimitBox, this.currentConfiguration.coresLimit!.workers!))) {
this.saveArgs.coresLimit!.workers = undefined;
} else if (this.workerCoresLimitBox.value === '') {
this.saveArgs.coresLimit!.workers = 'w=';
} else {
this.saveArgs.coresLimit!.workers = `w=${this.workerCoresLimitBox.value}`;
}
})
);
// Worker nodes memory request
this.workerMemoryRequestBox = this.modelView.modelBuilder.inputBox().withProps({
readOnly: false,
min: 0.25,
inputType: 'number',
placeHolder: loc.loading,
ariaLabel: loc.workerMemoryRequest
}).component();
this.disposables.push(
this.workerMemoryRequestBox.onTextChanged(() => {
if (!(this.saveValueToEdit(this.workerMemoryRequestBox, this.currentConfiguration.memoryRequest!.workers!))) {
this.saveArgs.memoryRequest!.workers = undefined;
} else if (this.workerMemoryRequestBox.value === '') {
this.saveArgs.memoryRequest!.workers = 'w=';
} else {
this.saveArgs.memoryRequest!.workers = `w=${this.workerMemoryRequestBox.value}Gi`;
}
})
);
// Worker nodes memory limit
this.workerMemoryLimitBox = this.modelView.modelBuilder.inputBox().withProps({
readOnly: false,
min: 0.25,
inputType: 'number',
placeHolder: loc.loading,
ariaLabel: loc.workerMemoryLimit
}).component();
this.disposables.push(
this.workerMemoryLimitBox.onTextChanged(() => {
if (!(this.saveValueToEdit(this.workerMemoryLimitBox, this.currentConfiguration.memoryLimit!.workers!))) {
this.saveArgs.memoryLimit!.workers = undefined;
} else if (this.workerMemoryLimitBox.value === '') {
this.saveArgs.memoryLimit!.workers = 'w=';
} else {
this.saveArgs.memoryLimit!.workers = `w=${this.workerMemoryLimitBox.value}Gi`;
}
})
);
// Coordinator node cores request
this.coordinatorCoresRequestBox = this.modelView.modelBuilder.inputBox().withProps({
readOnly: false,
min: 1,
inputType: 'number',
placeHolder: loc.loading,
ariaLabel: loc.coordinatorCoresRequest
ariaLabel: loc.coresRequest
}).component();
this.disposables.push(
@@ -379,7 +249,7 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
min: 1,
inputType: 'number',
placeHolder: loc.loading,
ariaLabel: loc.coordinatorCoresLimit
ariaLabel: loc.coresLimit
}).component();
this.disposables.push(
@@ -400,7 +270,7 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
min: 0.25,
inputType: 'number',
placeHolder: loc.loading,
ariaLabel: loc.coordinatorMemoryRequest
ariaLabel: loc.memoryRequest
}).component();
this.disposables.push(
@@ -421,7 +291,7 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
min: 0.25,
inputType: 'number',
placeHolder: loc.loading,
ariaLabel: loc.coordinatorMemoryLimit
ariaLabel: loc.memoryLimit
}).component();
this.disposables.push(
@@ -439,7 +309,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
private createUserInputWorkerSection(): azdata.Component[] {
if (this._postgresModel.configLastUpdated) {
this.editWorkerNodeCount();
this.refreshCoresRequest();
this.refreshCoresLimit();
this.refreshMemoryRequest();
@@ -447,21 +316,7 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
}
return [
this.modelView.modelBuilder.text().withProps({
value: loc.workerNodes,
CSSStyles: { ...cssStyles.title, 'margin-top': '25px' }
}).component(),
this.createWorkerNodesSectionContainer(),
this.createCoresMemorySection(loc.configurationPerNode, loc.workerNodesConfigurationInformation),
this.createConfigurationSectionContainer(loc.coresRequest, this.workerCoresRequestBox),
this.createConfigurationSectionContainer(loc.coresLimit, this.workerCoresLimitBox),
this.createConfigurationSectionContainer(loc.memoryRequest, this.workerMemoryRequestBox),
this.createConfigurationSectionContainer(loc.memoryLimit, this.workerMemoryLimitBox),
this.modelView.modelBuilder.text().withProps({
value: loc.coordinatorNode,
CSSStyles: { ...cssStyles.title, 'margin-top': '25px' }
}).component(),
this.createCoresMemorySection(loc.configuration, loc.coordinatorNodeConfigurationInformation),
this.createCoresMemorySection(loc.configuration),
this.createConfigurationSectionContainer(loc.coresRequest, this.coordinatorCoresRequestBox),
this.createConfigurationSectionContainer(loc.coresLimit, this.coordinatorCoresLimitBox),
this.createConfigurationSectionContainer(loc.memoryRequest, this.coordinatorMemoryRequestBox),
@@ -469,34 +324,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
];
}
private createWorkerNodesSectionContainer(): azdata.FlexContainer {
const inputFlex = { flex: '0 1 150px' };
const keyFlex = { flex: `0 1 250px` };
const flexContainer = this.modelView.modelBuilder.flexContainer().withLayout({
flexWrap: 'wrap',
alignItems: 'center'
}).component();
const keyComponent = this.modelView.modelBuilder.text().withProps({
value: loc.workerNodeCount,
requiredIndicator: true,
description: loc.workerNodesInformation,
CSSStyles: { ...cssStyles.text, 'margin-block-start': '0px', 'margin-block-end': '0px' }
}).component();
const keyContainer = this.modelView.modelBuilder.flexContainer().withLayout({ alignItems: 'center' }).component();
keyContainer.addItem(keyComponent, { CSSStyles: { 'margin-right': '0px', 'margin-bottom': '15px' } });
flexContainer.addItem(keyContainer, keyFlex);
const inputContainer = this.modelView.modelBuilder.flexContainer().withLayout({ alignItems: 'center' }).component();
inputContainer.addItem(this.workerCountBox, { CSSStyles: { 'margin-bottom': '15px', 'min-width': '50px', 'max-width': '225px' } });
flexContainer.addItem(inputContainer, inputFlex);
return flexContainer;
}
private createConfigurationSectionContainer(key: string, input: azdata.Component): azdata.FlexContainer {
const inputFlex = { flex: '0 1 150px' };
@@ -550,17 +377,7 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
}
}
private editWorkerNodeCount(): void {
// scale.shards was renamed to scale.workers. Check both for backwards compatibility.
let scale = this._postgresModel.config?.spec.scale;
this.currentConfiguration.workers = scale?.workers ?? scale?.shards ?? 0;
this.workerCountBox.placeHolder = '';
this.workerCountBox.value = this.currentConfiguration.workers.toString();
this.saveArgs.workers = undefined;
}
private createCoresMemorySection(title: string, description: string): azdata.DivContainer {
private createCoresMemorySection(title: string): azdata.DivContainer {
const titleFlex = { flex: `0 1 250px` };
const flexContainer = this.modelView.modelBuilder.flexContainer().withLayout({
@@ -570,12 +387,11 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
const titleComponent = this.modelView.modelBuilder.text().withProps({
value: title,
description: description,
CSSStyles: { ...cssStyles.title, 'font-weight': 'bold', 'margin-block-start': '0px', 'margin-block-end': '0px' }
}).component();
const titleContainer = this.modelView.modelBuilder.flexContainer().withLayout({ alignItems: 'center' }).component();
titleContainer.addItem(titleComponent, { CSSStyles: { 'margin-right': '0px', 'margin-bottom': '15px' } });
titleContainer.addItem(titleComponent, { CSSStyles: { 'margin-right': '0px', 'margin-bottom': '15px', 'margin-top': '15px' } });
flexContainer.addItem(titleContainer, titleFlex);
@@ -586,15 +402,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
}
private refreshCoresRequest(): void {
// Workers
let workersCR = this._postgresModel.config?.spec.scheduling?.roles?.worker?.resources?.requests?.cpu ?? this._postgresModel.config?.spec.scheduling?.default?.resources?.requests?.cpu;
if (!workersCR) {
workersCR = '';
}
this.workerCoresRequestBox.placeHolder = '';
this.workerCoresRequestBox.value = workersCR;
// Coordinator
let coordinatorCR = this._postgresModel.config?.spec.scheduling?.roles?.coordinator?.resources?.requests?.cpu ?? this._postgresModel.config?.spec.scheduling?.default?.resources?.requests?.cpu;
if (!coordinatorCR) {
@@ -606,7 +413,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
// Update saved current configuration
this.currentConfiguration.coresRequest = {
workers: workersCR,
coordinator: coordinatorCR
};
@@ -615,15 +421,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
}
private refreshCoresLimit(): void {
// Workers
let workersCL = this._postgresModel.config?.spec.scheduling?.roles?.worker?.resources?.limits?.cpu ?? this._postgresModel.config?.spec.scheduling?.default?.resources?.limits?.cpu;
if (!workersCL) {
workersCL = '';
}
this.workerCoresLimitBox.placeHolder = '';
this.workerCoresLimitBox.value = workersCL;
// Coordinator
let coordinatorCL = this._postgresModel.config?.spec.scheduling?.roles?.coordinator?.resources?.limits?.cpu ?? this._postgresModel.config?.spec.scheduling?.default?.resources?.limits?.cpu;
if (!coordinatorCL) {
@@ -635,7 +432,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
// Update saved current configuration
this.currentConfiguration.coresLimit = {
workers: workersCL,
coordinator: coordinatorCL
};
@@ -644,16 +440,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
}
private refreshMemoryRequest(): void {
// Workers
let currentWorkersMemoryRequest = this._postgresModel.config?.spec.scheduling?.roles?.worker?.resources?.requests?.memory ?? this._postgresModel.config?.spec.scheduling?.default?.resources?.requests?.memory;
let workersMR = '';
if (currentWorkersMemoryRequest) {
workersMR = convertToGibibyteString(currentWorkersMemoryRequest);
}
this.workerMemoryRequestBox.placeHolder = '';
this.workerMemoryRequestBox.value = workersMR;
// Coordinator
let currentCoordinatorMemoryRequest = this._postgresModel.config?.spec.scheduling?.roles?.coordinator?.resources?.requests?.memory ?? this._postgresModel.config?.spec.scheduling?.default?.resources?.requests?.memory;
let coordinatorMR = '';
@@ -666,7 +452,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
// Update saved current configuration
this.currentConfiguration.memoryRequest = {
workers: workersMR,
coordinator: coordinatorMR
};
@@ -675,16 +460,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
}
private refreshMemoryLimit(): void {
// Workers
let currentWorkersMemoryLimit = this._postgresModel.config?.spec.scheduling?.roles?.worker?.resources?.limits?.memory ?? this._postgresModel.config?.spec.scheduling?.default?.resources?.limits?.memory;
let workersML = '';
if (currentWorkersMemoryLimit) {
workersML = convertToGibibyteString(currentWorkersMemoryLimit);
}
this.workerMemoryLimitBox.placeHolder = '';
this.workerMemoryLimitBox.value = workersML;
// Coordinator
let currentCoordinatorMemoryLimit = this._postgresModel.config?.spec.scheduling?.roles?.coordinator?.resources?.limits?.memory ?? this._postgresModel.config?.spec.scheduling?.default?.resources?.limits?.memory;
let coordinatorML = '';
@@ -697,7 +472,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
// Update saved current configuration
this.currentConfiguration.memoryLimit = {
workers: workersML,
coordinator: coordinatorML
};
@@ -706,7 +480,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
}
private handleServiceUpdated(): void {
this.editWorkerNodeCount();
this.refreshCoresRequest();
this.refreshCoresLimit();
this.refreshMemoryRequest();

View File

@@ -35,28 +35,4 @@ export class PostgresCoordinatorNodeParametersPage extends PostgresParametersPag
return this._postgresModel.coordinatorNodeEngineSettings;
}
protected async saveParameterEdits(engineSettings: string): Promise<void> {
await this._azApi.az.postgres.arcserver.edit(
this._postgresModel.info.name,
{ coordinatorEngineSettings: engineSettings },
this._postgresModel.controllerModel.info.namespace,
this._postgresModel.controllerModel.azAdditionalEnvVars);
}
protected async resetAllParameters(): Promise<void> {
await this._azApi.az.postgres.arcserver.edit(
this._postgresModel.info.name,
{ coordinatorEngineSettings: `''`, replaceEngineSettings: true },
this._postgresModel.controllerModel.info.namespace,
this._postgresModel.controllerModel.azAdditionalEnvVars);
}
protected async resetParameter(parameterName: string): Promise<void> {
await this._azApi.az.postgres.arcserver.edit(
this._postgresModel.info.name,
{ coordinatorEngineSettings: parameterName + '=' },
this._postgresModel.controllerModel.info.namespace,
this._postgresModel.controllerModel.azAdditionalEnvVars);
}
}

View File

@@ -3,7 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as vscode from 'vscode';
import * as azdata from 'azdata';
import * as loc from '../../../localizedConstants';
import { ControllerModel } from '../../../models/controllerModel';
@@ -11,17 +10,11 @@ import { PostgresModel } from '../../../models/postgresModel';
import { PostgresOverviewPage } from './postgresOverviewPage';
import { PostgresConnectionStringsPage } from './postgresConnectionStringsPage';
import { Dashboard } from '../../components/dashboard';
import { PostgresDiagnoseAndSolveProblemsPage } from './postgresDiagnoseAndSolveProblemsPage';
import { PostgresSupportRequestPage } from './postgresSupportRequestPage';
import { PostgresComputeAndStoragePage } from './postgresComputeAndStoragePage';
import { PostgresWorkerNodeParametersPage } from './postgresWorkerNodeParametersPage';
import { PostgresPropertiesPage } from './postgresPropertiesPage';
import { PostgresResourceHealthPage } from './postgresResourceHealthPage';
import { PostgresCoordinatorNodeParametersPage } from './postgresCoordinatorNodeParametersPage';
import { PostgresExtensionsPage } from './postgresExtensionsPage';
export class PostgresDashboard extends Dashboard {
constructor(private _context: vscode.ExtensionContext, private _controllerModel: ControllerModel, private _postgresModel: PostgresModel) {
constructor(private _controllerModel: ControllerModel, private _postgresModel: PostgresModel) {
super(loc.postgresDashboard(_postgresModel.info.name), 'ArcPgDashboard');
}
@@ -35,34 +28,22 @@ export class PostgresDashboard extends Dashboard {
protected async registerTabs(modelView: azdata.ModelView): Promise<(azdata.DashboardTab | azdata.DashboardTabGroup)[]> {
const overviewPage = new PostgresOverviewPage(modelView, this.dashboard, this._controllerModel, this._postgresModel);
const extensionsPage = new PostgresExtensionsPage(modelView, this.dashboard, this._postgresModel);
const connectionStringsPage = new PostgresConnectionStringsPage(modelView, this.dashboard, this._postgresModel);
const computeAndStoragePage = new PostgresComputeAndStoragePage(modelView, this.dashboard, this._postgresModel);
const propertiesPage = new PostgresPropertiesPage(modelView, this.dashboard, this._controllerModel, this._postgresModel);
const coordinatorNodeParametersPage = new PostgresCoordinatorNodeParametersPage(modelView, this.dashboard, this._postgresModel);
const workerNodeParametersPage = new PostgresWorkerNodeParametersPage(modelView, this.dashboard, this._postgresModel);
const diagnoseAndSolveProblemsPage = new PostgresDiagnoseAndSolveProblemsPage(modelView, this.dashboard, this._context, this._controllerModel, this._postgresModel);
const supportRequestPage = new PostgresSupportRequestPage(modelView, this.dashboard, this._controllerModel, this._postgresModel);
const resourceHealthPage = new PostgresResourceHealthPage(modelView, this.dashboard, this._postgresModel);
return [
overviewPage.tab,
{
title: loc.settings,
tabs: [
propertiesPage.tab,
extensionsPage.tab,
connectionStringsPage.tab,
computeAndStoragePage.tab,
coordinatorNodeParametersPage.tab,
workerNodeParametersPage.tab
computeAndStoragePage.tab
]
},
{
title: loc.supportAndTroubleshooting,
tabs: [
resourceHealthPage.tab,
diagnoseAndSolveProblemsPage.tab,
supportRequestPage.tab
]
}

View File

@@ -129,7 +129,6 @@ export class PostgresExtensionsPage extends DashboardPage {
try {
this.addExtensionsButton.enabled = false;
this.dropExtensionsButton.enabled = false;
let extensionList = this.extensionNames.length ? this.extensionNames.join() + ',' + extArg : extArg;
await vscode.window.withProgress(
{
location: vscode.ProgressLocation.Notification,
@@ -138,11 +137,9 @@ export class PostgresExtensionsPage extends DashboardPage {
},
async (_progress, _token): Promise<void> => {
await this._azApi.az.postgres.arcserver.edit(
await this._azApi.az.postgres.serverarc.update(
this._postgresModel.info.name,
{
extensions: extensionList
},
{},
this._postgresModel.controllerModel.info.namespace,
this._postgresModel.controllerModel.azAdditionalEnvVars);
@@ -272,11 +269,9 @@ export class PostgresExtensionsPage extends DashboardPage {
cancellable: false
},
async (_progress, _token): Promise<void> => {
await this._azApi.az.postgres.arcserver.edit(
await this._azApi.az.postgres.serverarc.update(
this._postgresModel.info.name,
{
extensions: this.extensionNames.join()
},
{},
this._postgresModel.controllerModel.info.namespace,
this._postgresModel.controllerModel.azAdditionalEnvVars
);

View File

@@ -7,16 +7,15 @@ import * as vscode from 'vscode';
import * as azdata from 'azdata';
import * as azExt from 'az-ext';
import * as loc from '../../../localizedConstants';
import { IconPathHelper, cssStyles, iconSize } from '../../../constants';
import { IconPathHelper, cssStyles } from '../../../constants';
import { DashboardPage } from '../../components/dashboardPage';
import { ControllerModel } from '../../../models/controllerModel';
import { PostgresModel } from '../../../models/postgresModel';
import { promptAndConfirmPassword, promptForInstanceDeletion } from '../../../common/utils';
import { promptForInstanceDeletion } from '../../../common/utils';
import { ResourceType } from 'arc';
export type PodStatusModel = {
podName: azdata.Component,
type: string,
status: string
};
@@ -32,9 +31,6 @@ export class PostgresOverviewPage extends DashboardPage {
private grafanaLink!: azdata.HyperlinkComponent;
private deleteButton!: azdata.ButtonComponent;
private podStatusTable!: azdata.DeclarativeTableComponent;
private podStatusData: PodStatusModel[] = [];
private readonly _azApi: azExt.IExtension;
constructor(modelView: azdata.ModelView, dashboard: azdata.window.ModelViewDashboard, private _controllerModel: ControllerModel, private _postgresModel: PostgresModel) {
@@ -147,99 +143,11 @@ export class PostgresOverviewPage extends DashboardPage {
}).component();
content.addItem(endpointsTable);
// Server Group Nodes
content.addItem(this.modelView.modelBuilder.text().withProps({
value: loc.serverGroupNodes,
CSSStyles: titleCSS,
headingLevel: 1
}).component());
this.podStatusTable = this.modelView.modelBuilder.declarativeTable().withProps({
width: '100%',
ariaLabel: loc.serverGroupNodes,
columns: [
{
displayName: loc.name,
valueType: azdata.DeclarativeDataType.component,
isReadOnly: true,
width: '35%',
headerCssStyles: cssStyles.tableHeader,
rowCssStyles: {
...cssStyles.tableRow,
'overflow': 'hidden',
'text-overflow': 'ellipsis',
'white-space': 'nowrap',
'max-width': '0'
}
},
{
displayName: loc.type,
valueType: azdata.DeclarativeDataType.string,
isReadOnly: true,
width: '35%',
headerCssStyles: cssStyles.tableHeader,
rowCssStyles: cssStyles.tableRow
},
{
displayName: loc.status,
valueType: azdata.DeclarativeDataType.string,
isReadOnly: true,
width: '30%',
headerCssStyles: cssStyles.tableHeader,
rowCssStyles: cssStyles.tableRow
}
],
dataValues: this.createPodStatusDataValues()
}).component();
this.serverGroupNodesLoading = this.modelView.modelBuilder.loadingComponent()
.withItem(this.podStatusTable)
.withProps({
loading: !this._postgresModel.configLastUpdated
}).component();
this.refreshServerNodes();
content.addItem(this.serverGroupNodesLoading, { CSSStyles: cssStyles.text });
this.initialized = true;
return root;
}
protected get toolbarContainer(): azdata.ToolbarContainer {
// Reset password
const resetPasswordButton = this.modelView.modelBuilder.button().withProps({
label: loc.resetPassword,
iconPath: IconPathHelper.edit
}).component();
this.disposables.push(
resetPasswordButton.onDidClick(async () => {
resetPasswordButton.enabled = false;
try {
const password = await promptAndConfirmPassword(input => !input ? loc.enterANonEmptyPassword : '');
if (password) {
await this._azApi.az.postgres.arcserver.edit(
this._postgresModel.info.name,
{
adminPassword: true,
noWait: true
},
this._postgresModel.controllerModel.info.namespace,
Object.assign({ 'AZDATA_PASSWORD': password }, this._controllerModel.azAdditionalEnvVars));
vscode.window.showInformationMessage(loc.passwordReset);
}
} catch (error) {
vscode.window.showErrorMessage(loc.passwordResetFailed(error));
} finally {
resetPasswordButton.enabled = true;
}
}));
// Delete service
this.deleteButton = this.modelView.modelBuilder.button().withProps({
label: loc.deleteText,
@@ -258,7 +166,7 @@ export class PostgresOverviewPage extends DashboardPage {
cancellable: false
},
async (_progress, _token) => {
return await this._azApi.az.postgres.arcserver.delete(this._postgresModel.info.name, this._postgresModel.controllerModel.info.namespace, this._controllerModel.azAdditionalEnvVars);
return await this._azApi.az.postgres.serverarc.delete(this._postgresModel.info.name, this._postgresModel.controllerModel.info.namespace, this._controllerModel.azAdditionalEnvVars);
}
);
await this._controllerModel.refreshTreeNode();
@@ -323,7 +231,6 @@ export class PostgresOverviewPage extends DashboardPage {
}));
return this.modelView.modelBuilder.toolbarContainer().withToolbarItems([
{ component: resetPasswordButton },
{ component: this.deleteButton },
{ component: refreshButton, toolbarSeparatorAfter: true },
{ component: openInAzurePortalButton }
@@ -341,70 +248,10 @@ export class PostgresOverviewPage extends DashboardPage {
{ displayName: loc.namespace, value: this._postgresModel.config?.metadata.namespace || '-' },
{ displayName: loc.subscriptionId, value: azure?.subscription || '-' },
{ displayName: loc.externalEndpoint, value: this._postgresModel.config?.status.primaryEndpoint || '-' },
{ displayName: loc.status, value: status ? `${status.state} (${status.readyPods} ${loc.podsReady})` : '-' },
{ displayName: loc.postgresAdminUsername, value: 'postgres' },
{ displayName: loc.postgresVersion, value: this._postgresModel.engineVersion ?? '-' },
{ displayName: loc.nodeConfiguration, value: this._postgresModel.scaleConfiguration || '-' }
{ displayName: loc.status, value: status ? `${status.state} (${status.readyPods} ${loc.podsReady})` : '-' }
];
}
private getPodStatus(): PodStatusModel[] {
let podModels: PodStatusModel[] = [];
const podStatus = this._postgresModel.config?.status.podsStatus;
podStatus?.forEach((p: { conditions: any[]; name: any; role: string; }) => {
// If a condition of the pod has a status of False, pod is not Ready
const status = p.conditions.find(c => c.status === 'False') ? loc.notReady : loc.ready;
const podLabelContainer = this.modelView.modelBuilder.flexContainer().withProps({
CSSStyles: { 'alignItems': 'center', 'height': '15px' }
}).component();
const imageComponent = this.modelView.modelBuilder.image().withProps({
iconPath: IconPathHelper.postgres,
width: iconSize,
height: iconSize,
iconHeight: '15px',
iconWidth: '15px'
}).component();
let podLabel = this.modelView.modelBuilder.text().withProps({
value: p.name,
}).component();
if (p.role.toUpperCase() === loc.worker.toUpperCase()) {
podLabelContainer.addItem(imageComponent, { CSSStyles: { 'margin-left': '15px', 'margin-right': '0px' } });
podLabelContainer.addItem(podLabel);
let pod: PodStatusModel = {
podName: podLabelContainer,
type: loc.worker,
status: status
};
podModels.push(pod);
} else {
podLabelContainer.addItem(imageComponent, { CSSStyles: { 'margin-right': '0px' } });
podLabelContainer.addItem(podLabel);
let pod: PodStatusModel = {
podName: podLabelContainer,
type: loc.coordinator,
status: status
};
podModels.unshift(pod);
}
});
return podModels;
}
private createPodStatusDataValues(): azdata.DeclarativeTableCellValue[][] {
let podDataValue: (string | azdata.Component)[][] = this.podStatusData.map(p => [p.podName, p.type, p.status]);
return podDataValue.map(p => {
return p.map((value): azdata.DeclarativeTableCellValue => {
return { value: value };
});
});
}
private refreshDashboardLinks(): void {
if (this._postgresModel.config) {
const kibanaUrl = this._postgresModel.config.status.logSearchDashboard ?? '';
@@ -419,14 +266,6 @@ export class PostgresOverviewPage extends DashboardPage {
}
}
private refreshServerNodes(): void {
if (this._postgresModel.config) {
this.podStatusData = this.getPodStatus();
this.podStatusTable.setDataValues(this.createPodStatusDataValues());
this.serverGroupNodesLoading.loading = false;
}
}
private handleRegistrationsUpdated() {
this.properties!.propertyItems = this.getProperties();
this.propertiesLoading!.loading = false;
@@ -436,6 +275,5 @@ export class PostgresOverviewPage extends DashboardPage {
this.properties!.propertyItems = this.getProperties();
this.propertiesLoading!.loading = false;
this.refreshDashboardLinks();
this.refreshServerNodes();
}
}

View File

@@ -151,7 +151,6 @@ export abstract class PostgresParametersPage extends DashboardPage {
this.parameterUpdates.forEach((value, key) => {
engineSettings.push(`${key}="${value}"`);
});
await this.saveParameterEdits(engineSettings.toString());
} catch (err) {
// If an error occurs while editing the instance then re-enable the save button since
// the edit wasn't successfully applied
@@ -224,7 +223,6 @@ export abstract class PostgresParametersPage extends DashboardPage {
},
async (_progress, _token): Promise<void> => {
try {
await this.resetAllParameters();
} catch (err) {
// If an error occurs while resetting the instance then re-enable the reset button since
// the edit wasn't successfully applied
@@ -425,7 +423,6 @@ export abstract class PostgresParametersPage extends DashboardPage {
cancellable: false
},
async (_progress, _token): Promise<void> => {
await this.resetParameter(engineSetting.parameterName!);
try {
await this.callGetEngineSettings();
} catch (error) {
@@ -649,10 +646,4 @@ export abstract class PostgresParametersPage extends DashboardPage {
await this.callGetEngineSettings();
}
}
protected abstract saveParameterEdits(engineSettings: string): Promise<void>;
protected abstract resetAllParameters(): Promise<void>;
protected abstract resetParameter(parameterName: string): Promise<void>;
}

View File

@@ -103,9 +103,7 @@ export class PostgresPropertiesPage extends DashboardPage {
new InputKeyValue(this.modelView.modelBuilder, loc.subscriptionId, this._controllerModel.controllerConfig?.spec.settings.azure.subscription ?? ''),
new TextKeyValue(this.modelView.modelBuilder, loc.resourceGroup, this._controllerModel.controllerConfig?.spec.settings.azure.resourceGroup ?? ''),
new LinkKeyValue(this.modelView.modelBuilder, loc.dataController, this._controllerModel.controllerConfig?.metadata.name ?? '', () => controllerDashboard.showDashboard()),
new TextKeyValue(this.modelView.modelBuilder, loc.nodeConfiguration, this._postgresModel.scaleConfiguration ?? ''),
new TextKeyValue(this.modelView.modelBuilder, loc.status, status ? `${status.state} (${status.readyPods} ${loc.podsReady})` : loc.unknown),
new TextKeyValue(this.modelView.modelBuilder, loc.postgresVersion, this._postgresModel.engineVersion ?? ''),
new TextKeyValue(this.modelView.modelBuilder, loc.status, status ? `${status.state} (${status.readyPods} ${loc.podsReady})` : loc.unknown)
];
}

View File

@@ -36,27 +36,4 @@ export class PostgresWorkerNodeParametersPage extends PostgresParametersPage {
return this._postgresModel.workerNodesEngineSettings;
}
protected async saveParameterEdits(engineSettings: string): Promise<void> {
await this._azApi.az.postgres.arcserver.edit(
this._postgresModel.info.name,
{ workerEngineSettings: engineSettings },
this._postgresModel.controllerModel.info.namespace,
this._postgresModel.controllerModel.azAdditionalEnvVars);
}
protected async resetAllParameters(): Promise<void> {
await this._azApi.az.postgres.arcserver.edit(
this._postgresModel.info.name,
{ workerEngineSettings: `''`, replaceEngineSettings: true },
this._postgresModel.controllerModel.info.namespace,
this._postgresModel.controllerModel.azAdditionalEnvVars);
}
protected async resetParameter(parameterName: string): Promise<void> {
await this._azApi.az.postgres.arcserver.edit(
this._postgresModel.info.name,
{ workerEngineSettings: parameterName + '=' },
this._postgresModel.controllerModel.info.namespace,
this._postgresModel.controllerModel.azAdditionalEnvVars);
}
}

View File

@@ -54,7 +54,7 @@ export class AzureArcTreeDataProvider implements vscode.TreeDataProvider<TreeNod
if (controllerNode) {
controllerNode.model.info = model.info;
} else {
this._controllerNodes.push(new ControllerTreeNode(model, this._context, this));
this._controllerNodes.push(new ControllerTreeNode(model, this));
}
if (refreshTree) {
this._onDidChangeTreeData.fire(undefined);
@@ -85,7 +85,7 @@ export class AzureArcTreeDataProvider implements vscode.TreeDataProvider<TreeNod
const controllerMementos: ControllerInfo[] = this._context.globalState.get(mementoToken) || [];
this._controllerNodes = controllerMementos.map(memento => {
const controllerModel = new ControllerModel(this, memento);
return new ControllerTreeNode(controllerModel, this._context, this);
return new ControllerTreeNode(controllerModel, this);
});
} finally {
this._loading = false;

View File

@@ -27,7 +27,7 @@ export class ControllerTreeNode extends TreeNode {
private _children: ResourceTreeNode<ResourceModel>[] = [];
constructor(public model: ControllerModel, private _context: vscode.ExtensionContext, private _treeDataProvider: AzureArcTreeDataProvider) {
constructor(public model: ControllerModel, private _treeDataProvider: AzureArcTreeDataProvider) {
super(model.label, vscode.TreeItemCollapsibleState.Collapsed, ResourceType.dataControllers);
model.onInfoUpdated(_ => {
this.label = model.label;
@@ -107,7 +107,7 @@ export class ControllerTreeNode extends TreeNode {
info.name === resourceInfo.name &&
info.resourceType === resourceInfo.resourceType) as PGResourceInfo)?.userName;
const postgresModel = new PostgresModel(this.model, resourceInfo, registration, this._treeDataProvider);
node = new PostgresTreeNode(postgresModel, this.model, this._context);
node = new PostgresTreeNode(postgresModel, this.model);
break;
case ResourceType.sqlManagedInstances:
// Fill in the username too if we already have it

View File

@@ -15,12 +15,12 @@ import { ResourceTreeNode } from './resourceTreeNode';
*/
export class PostgresTreeNode extends ResourceTreeNode<PostgresModel> {
constructor(model: PostgresModel, private _controllerModel: ControllerModel, private _context: vscode.ExtensionContext) {
constructor(model: PostgresModel, private _controllerModel: ControllerModel) {
super(model.info.name, vscode.TreeItemCollapsibleState.None, ResourceType.postgresInstances, model);
}
public override async openDashboard(): Promise<void> {
const postgresDashboard = new PostgresDashboard(this._context, this._controllerModel, this.model);
const postgresDashboard = new PostgresDashboard(this._controllerModel, this.model);
await postgresDashboard.showDashboard();
}
}