mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-08 09:38:26 -05:00
Arc Postgres - Remove new database and styling
This commit is contained in:
@@ -7,7 +7,7 @@ import * as vscode from 'vscode';
|
||||
import * as azdata from 'azdata';
|
||||
import * as loc from '../../../localizedConstants';
|
||||
import { IconPathHelper, cssStyles, ResourceType } from '../../../constants';
|
||||
import { DuskyObjectModelsDatabase, V1Pod, DuskyObjectModelsDatabaseServiceArcPayload } from '../../../controller/generated/dusky/api';
|
||||
import { V1Pod, DuskyObjectModelsDatabaseServiceArcPayload } from '../../../controller/generated/dusky/api';
|
||||
import { DashboardPage } from '../../components/dashboardPage';
|
||||
import { ControllerModel } from '../../../models/controllerModel';
|
||||
import { PostgresModel, PodRole } from '../../../models/postgresModel';
|
||||
@@ -194,30 +194,6 @@ export class PostgresOverviewPage extends DashboardPage {
|
||||
}
|
||||
|
||||
protected get toolbarContainer(): azdata.ToolbarContainer {
|
||||
// New database
|
||||
const newDatabaseButton = this.modelView.modelBuilder.button().withProperties<azdata.ButtonProperties>({
|
||||
label: loc.newDatabase,
|
||||
iconPath: IconPathHelper.add
|
||||
}).component();
|
||||
|
||||
this.disposables.push(
|
||||
newDatabaseButton.onDidClick(async () => {
|
||||
newDatabaseButton.enabled = false;
|
||||
let name;
|
||||
try {
|
||||
name = await vscode.window.showInputBox({ prompt: loc.databaseName });
|
||||
if (name) {
|
||||
const db: DuskyObjectModelsDatabase = { name: name }; // TODO support other options (sharded, owner)
|
||||
await this._postgresModel.createDatabase(db);
|
||||
vscode.window.showInformationMessage(loc.databaseCreated(db.name ?? ''));
|
||||
}
|
||||
} catch (error) {
|
||||
vscode.window.showErrorMessage(loc.databaseCreationFailed(name ?? '', error));
|
||||
} finally {
|
||||
newDatabaseButton.enabled = true;
|
||||
}
|
||||
}));
|
||||
|
||||
// Reset password
|
||||
const resetPasswordButton = this.modelView.modelBuilder.button().withProperties<azdata.ButtonProperties>({
|
||||
label: loc.resetPassword,
|
||||
@@ -309,7 +285,6 @@ export class PostgresOverviewPage extends DashboardPage {
|
||||
}));
|
||||
|
||||
return this.modelView.modelBuilder.toolbarContainer().withToolbarItems([
|
||||
{ component: newDatabaseButton },
|
||||
{ component: resetPasswordButton },
|
||||
{ component: deleteButton },
|
||||
{ component: refreshButton, toolbarSeparatorAfter: true },
|
||||
|
||||
@@ -57,14 +57,14 @@ export class PostgresResourceHealthPage extends DashboardPage {
|
||||
CSSStyles: { ...cssStyles.title, 'margin-bottom': '30px' }
|
||||
}).component());
|
||||
|
||||
const titleCSS = { ...cssStyles.title, 'margin-block-start': '2em', 'margin-block-end': '0' };
|
||||
content.addItem(this.modelView.modelBuilder.text().withProperties<azdata.TextComponentProperties>({
|
||||
value: loc.podOverview,
|
||||
CSSStyles: titleCSS
|
||||
CSSStyles: { ...cssStyles.title, 'margin-block-end': '0' }
|
||||
}).component());
|
||||
|
||||
this.podsUpdated = this.modelView.modelBuilder.text().withProperties<azdata.TextComponentProperties>({
|
||||
value: this.getPodsLastUpdated()
|
||||
value: this.getPodsLastUpdated(),
|
||||
CSSStyles: { ...cssStyles.text, 'font-size': '12px', 'margin-block-start': '0' }
|
||||
}).component();
|
||||
|
||||
content.addItem(this.podsUpdated);
|
||||
@@ -75,18 +75,18 @@ export class PostgresResourceHealthPage extends DashboardPage {
|
||||
{
|
||||
displayName: '',
|
||||
valueType: azdata.DeclarativeDataType.string,
|
||||
width: '50%',
|
||||
width: '35%',
|
||||
isReadOnly: true,
|
||||
headerCssStyles: cssStyles.tableHeader,
|
||||
rowCssStyles: { ...cssStyles.tableRow, 'font-size': '20px', 'font-weight': 'bold' }
|
||||
rowCssStyles: { ...cssStyles.tableRow, 'font-size': '20px', 'font-weight': 'bold', 'padding': '7px' }
|
||||
},
|
||||
{
|
||||
displayName: '',
|
||||
valueType: azdata.DeclarativeDataType.string,
|
||||
width: '50%',
|
||||
width: '65%',
|
||||
isReadOnly: true,
|
||||
headerCssStyles: cssStyles.tableHeader,
|
||||
rowCssStyles: cssStyles.tableRow
|
||||
rowCssStyles: { ...cssStyles.tableRow, 'padding': '7px' }
|
||||
}
|
||||
],
|
||||
data: this.getPodsTable()
|
||||
|
||||
Reference in New Issue
Block a user