mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -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 azdata from 'azdata';
|
||||||
import * as loc from '../../../localizedConstants';
|
import * as loc from '../../../localizedConstants';
|
||||||
import { IconPathHelper, cssStyles, ResourceType } from '../../../constants';
|
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 { DashboardPage } from '../../components/dashboardPage';
|
||||||
import { ControllerModel } from '../../../models/controllerModel';
|
import { ControllerModel } from '../../../models/controllerModel';
|
||||||
import { PostgresModel, PodRole } from '../../../models/postgresModel';
|
import { PostgresModel, PodRole } from '../../../models/postgresModel';
|
||||||
@@ -194,30 +194,6 @@ export class PostgresOverviewPage extends DashboardPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected get toolbarContainer(): azdata.ToolbarContainer {
|
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
|
// Reset password
|
||||||
const resetPasswordButton = this.modelView.modelBuilder.button().withProperties<azdata.ButtonProperties>({
|
const resetPasswordButton = this.modelView.modelBuilder.button().withProperties<azdata.ButtonProperties>({
|
||||||
label: loc.resetPassword,
|
label: loc.resetPassword,
|
||||||
@@ -309,7 +285,6 @@ export class PostgresOverviewPage extends DashboardPage {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
return this.modelView.modelBuilder.toolbarContainer().withToolbarItems([
|
return this.modelView.modelBuilder.toolbarContainer().withToolbarItems([
|
||||||
{ component: newDatabaseButton },
|
|
||||||
{ component: resetPasswordButton },
|
{ component: resetPasswordButton },
|
||||||
{ component: deleteButton },
|
{ component: deleteButton },
|
||||||
{ component: refreshButton, toolbarSeparatorAfter: true },
|
{ component: refreshButton, toolbarSeparatorAfter: true },
|
||||||
|
|||||||
@@ -57,14 +57,14 @@ export class PostgresResourceHealthPage extends DashboardPage {
|
|||||||
CSSStyles: { ...cssStyles.title, 'margin-bottom': '30px' }
|
CSSStyles: { ...cssStyles.title, 'margin-bottom': '30px' }
|
||||||
}).component());
|
}).component());
|
||||||
|
|
||||||
const titleCSS = { ...cssStyles.title, 'margin-block-start': '2em', 'margin-block-end': '0' };
|
|
||||||
content.addItem(this.modelView.modelBuilder.text().withProperties<azdata.TextComponentProperties>({
|
content.addItem(this.modelView.modelBuilder.text().withProperties<azdata.TextComponentProperties>({
|
||||||
value: loc.podOverview,
|
value: loc.podOverview,
|
||||||
CSSStyles: titleCSS
|
CSSStyles: { ...cssStyles.title, 'margin-block-end': '0' }
|
||||||
}).component());
|
}).component());
|
||||||
|
|
||||||
this.podsUpdated = this.modelView.modelBuilder.text().withProperties<azdata.TextComponentProperties>({
|
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();
|
}).component();
|
||||||
|
|
||||||
content.addItem(this.podsUpdated);
|
content.addItem(this.podsUpdated);
|
||||||
@@ -75,18 +75,18 @@ export class PostgresResourceHealthPage extends DashboardPage {
|
|||||||
{
|
{
|
||||||
displayName: '',
|
displayName: '',
|
||||||
valueType: azdata.DeclarativeDataType.string,
|
valueType: azdata.DeclarativeDataType.string,
|
||||||
width: '50%',
|
width: '35%',
|
||||||
isReadOnly: true,
|
isReadOnly: true,
|
||||||
headerCssStyles: cssStyles.tableHeader,
|
headerCssStyles: cssStyles.tableHeader,
|
||||||
rowCssStyles: { ...cssStyles.tableRow, 'font-size': '20px', 'font-weight': 'bold' }
|
rowCssStyles: { ...cssStyles.tableRow, 'font-size': '20px', 'font-weight': 'bold', 'padding': '7px' }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: '',
|
displayName: '',
|
||||||
valueType: azdata.DeclarativeDataType.string,
|
valueType: azdata.DeclarativeDataType.string,
|
||||||
width: '50%',
|
width: '65%',
|
||||||
isReadOnly: true,
|
isReadOnly: true,
|
||||||
headerCssStyles: cssStyles.tableHeader,
|
headerCssStyles: cssStyles.tableHeader,
|
||||||
rowCssStyles: cssStyles.tableRow
|
rowCssStyles: { ...cssStyles.tableRow, 'padding': '7px' }
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
data: this.getPodsTable()
|
data: this.getPodsTable()
|
||||||
|
|||||||
Reference in New Issue
Block a user