mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-18 09:35:39 -05:00
* dashboard improvement - WIP (#8836) * wip * wip * tabgroup * tab group * agent views * clean up * formats * feedback * fix error * contribute top level server/db dashboard tab (#8868) * tabbedPanel component (#8861) * tabbed panel * tabbed panel * fix errors * revert main.ts changes * use margin * address comments * remove orientation property * content tab group (#8878) * add databases tab * use more extensible approach * remove unnecessary code * add when expression * objects tab for database dashboard (#8892) * fix build errors * fix build error * Dashboard toolbar (#9118) * remove old toolbar with only edit and refresh * remove tasks widgets from server and databases dashboards * adding toolbar to dashboardpage and clicking new query works * restore and new notebook now do something * add backup to toolbar for database dashboards * new notebook connects to db * only show backup and restore for non-azure * new backup and restore svgs * clean up * got toolbar actions to show up from contribution * some cleanup and add database dashboard toolbar contributions * don't show all tasks when there should be no tasks * fix toolbar showing multiple times when switching opening another dashboard from OE * only show toolbar for home page * update to new icons - same icons for light and dark theme * don't show separator if there aren't any actions * read toolbar actions from tasks-widget * remove tasks widget from home dashboard page * show extension's actions in toolbar * clean up * more cleaning up * fix extension actions not always loading the first time * add configure dashboard * remove old edit icon css * change tasks back to original order * make sure tasks widget is the one being removed * collapsible tab panel (#9221) * collapsible vertical tab panel * fix lint error * comments batch 1 * pr comments * update new query icon (#9351) * Update toolbar actions (#9313) * remove edit and configure dashboard and add refresh to toolbar for other dashboard pages too * Add refresh for tabs that have container type with refresh implemented * change refresh to only refresh the current tab * remove map for tab to actions * add back configure dashboard to home toolbar * check if index is -1 before trying to remove tasks widget from widgets * Move objects widget back to database home tab (#9432) * move objects widget back to database home tab and reorder toolbar * change order of actions back to previous order * Allow extensions to add actions to home toolbar (#9269) * add support for extensions to add actions to home toolbar * fix spacing * use menu contribution point * undo previous changes that added dashboardToolbarHomeAction contribution * remove home from name * add context key for tab name * allow actions to also be added to the toolbar of other tabs * add extension contributed actions even if no tasks-widget * fix refresh being added twice after merging * hide the tab list when collapsed (#9529) * update the order of css selectors (#9606) * Update dashboard style to be closer to mockups (#9570) * update style to be closer to mockups * tab panel styling * change back tab styling for tabs in a tab contributed by an extension * change color of borders when theme changes * set dark theme active tab background to same as OE for now * update border colors * move colors to theme file * fix a few issues (#9690) * couple fixes * comments * small dashboard toolbar fixes (#9695) * fix backup icon in toolbar * fix database page toolbar border color * add back center center in common-icons.css (#9703) * change padding so bottom border shows again (#9710) * tab panel fixes (#9724) * tab panel fixes * fix package.nls.json * feedbacks (#9761) * feedbacks * remove comments Co-authored-by: Kim Santiago <31145923+kisantia@users.noreply.github.com>
292 lines
7.1 KiB
TypeScript
292 lines
7.1 KiB
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
// This is the place for API experiments and proposal.
|
|
|
|
import * as vscode from 'vscode';
|
|
|
|
declare module 'azdata' {
|
|
/**
|
|
* Namespace for connection management
|
|
*/
|
|
export namespace connection {
|
|
export type ConnectionEventType =
|
|
| 'onConnect'
|
|
| 'onDisconnect'
|
|
| 'onConnectionChanged';
|
|
|
|
export interface ConnectionEventListener {
|
|
onConnectionEvent(type: ConnectionEventType, ownerUri: string, args: IConnectionProfile): void;
|
|
}
|
|
|
|
/**
|
|
* Register a connection event listener
|
|
*/
|
|
export function registerConnectionEventListener(listener: connection.ConnectionEventListener): void;
|
|
|
|
export function getConnection(uri: string): Thenable<ConnectionProfile>;
|
|
}
|
|
|
|
export namespace nb {
|
|
export interface NotebookDocument {
|
|
/**
|
|
* Sets the trust mode for the notebook document.
|
|
*/
|
|
setTrusted(state: boolean);
|
|
}
|
|
}
|
|
|
|
export type SqlDbType = 'BigInt' | 'Binary' | 'Bit' | 'Char' | 'DateTime' | 'Decimal'
|
|
| 'Float' | 'Image' | 'Int' | 'Money' | 'NChar' | 'NText' | 'NVarChar' | 'Real'
|
|
| 'UniqueIdentifier' | 'SmallDateTime' | 'SmallInt' | 'SmallMoney' | 'Text' | 'Timestamp'
|
|
| 'TinyInt' | 'VarBinary' | 'VarChar' | 'Variant' | 'Xml' | 'Udt' | 'Structured' | 'Date'
|
|
| 'Time' | 'DateTime2' | 'DateTimeOffset';
|
|
|
|
export interface SimpleColumnInfo {
|
|
name: string;
|
|
/**
|
|
* This is expected to match the SqlDbTypes for serialization purposes
|
|
*/
|
|
dataTypeName: SqlDbType;
|
|
}
|
|
export interface SerializeDataStartRequestParams {
|
|
/**
|
|
* 'csv', 'json', 'excel', 'xml'
|
|
*/
|
|
saveFormat: string;
|
|
filePath: string;
|
|
isLastBatch: boolean;
|
|
rows: DbCellValue[][];
|
|
columns: SimpleColumnInfo[];
|
|
includeHeaders?: boolean;
|
|
delimiter?: string;
|
|
lineSeperator?: string;
|
|
textIdentifier?: string;
|
|
encoding?: string;
|
|
formatted?: boolean;
|
|
}
|
|
|
|
export interface SerializeDataContinueRequestParams {
|
|
filePath: string;
|
|
isLastBatch: boolean;
|
|
rows: DbCellValue[][];
|
|
}
|
|
|
|
export interface SerializeDataResult {
|
|
messages?: string;
|
|
succeeded: boolean;
|
|
}
|
|
|
|
export interface SerializationProvider extends DataProvider {
|
|
startSerialization(requestParams: SerializeDataStartRequestParams): Thenable<SerializeDataResult>;
|
|
continueSerialization(requestParams: SerializeDataContinueRequestParams): Thenable<SerializeDataResult>;
|
|
}
|
|
|
|
export namespace dataprotocol {
|
|
export function registerSerializationProvider(provider: SerializationProvider): vscode.Disposable;
|
|
}
|
|
|
|
export interface HyperlinkComponent {
|
|
/**
|
|
* An event called when the text is clicked
|
|
*/
|
|
onDidClick: vscode.Event<any>;
|
|
}
|
|
|
|
export interface DeclarativeTableColumn {
|
|
headerCssStyles?: { [key: string]: string };
|
|
rowCssStyles?: { [key: string]: string };
|
|
ariaLabel?: string;
|
|
}
|
|
|
|
export enum DeclarativeDataType {
|
|
component = 'component'
|
|
}
|
|
|
|
/*
|
|
* Add optional azureAccount for connectionWidget.
|
|
*/
|
|
export interface IConnectionProfile extends ConnectionInfo {
|
|
azureAccount?: string;
|
|
}
|
|
|
|
/*
|
|
* Add optional per-OS default value.
|
|
*/
|
|
export interface DefaultValueOsOverride {
|
|
os: string;
|
|
|
|
defaultValueOverride: string;
|
|
}
|
|
|
|
export interface ConnectionOption {
|
|
defaultValueOsOverrides?: DefaultValueOsOverride[];
|
|
}
|
|
|
|
export interface ModelBuilder {
|
|
radioCardGroup(): ComponentBuilder<RadioCardGroupComponent>;
|
|
tabbedPanel(): TabbedPanelComponentBuilder;
|
|
separator(): ComponentBuilder<SeparatorComponent>;
|
|
}
|
|
|
|
export interface RadioCard {
|
|
id: string;
|
|
label: string;
|
|
descriptions?: RadioCardDescription[];
|
|
icon?: string | vscode.Uri | { light: string | vscode.Uri; dark: string | vscode.Uri };
|
|
}
|
|
|
|
export interface RadioCardDescription {
|
|
ariaLabel: string;
|
|
labelHeader: string;
|
|
contents: RadioCardLabelValuePair[];
|
|
valueHeader?: string;
|
|
}
|
|
|
|
export interface RadioCardLabelValuePair {
|
|
label: string;
|
|
value?: string;
|
|
}
|
|
|
|
export interface RadioCardGroupComponentProperties extends ComponentProperties, TitledComponentProperties {
|
|
cards: RadioCard[];
|
|
cardWidth: string;
|
|
cardHeight: string;
|
|
iconWidth?: string;
|
|
iconHeight?: string;
|
|
selectedCardId?: string;
|
|
}
|
|
|
|
export interface RadioCardGroupComponent extends Component, RadioCardGroupComponentProperties {
|
|
onSelectionChanged: vscode.Event<any>;
|
|
}
|
|
|
|
export interface SeparatorComponent extends Component {
|
|
}
|
|
|
|
export interface DeclarativeTableProperties extends ComponentProperties {
|
|
}
|
|
|
|
export interface ComponentProperties {
|
|
ariaHidden?: boolean;
|
|
}
|
|
|
|
export interface ComponentWithIconProperties {
|
|
/**
|
|
* The path for the icon with optional dark-theme away alternative
|
|
*/
|
|
iconPath?: string | vscode.Uri | { light: string | vscode.Uri; dark: string | vscode.Uri };
|
|
/**
|
|
* The height of the icon
|
|
*/
|
|
iconHeight?: number | string;
|
|
/**
|
|
* The width of the icon
|
|
*/
|
|
iconWidth?: number | string;
|
|
/**
|
|
* The title for the icon. This title will show when hovered over
|
|
*/
|
|
title?: string;
|
|
}
|
|
|
|
export interface ComponentWithIcon extends ComponentWithIconProperties {
|
|
}
|
|
|
|
export interface ImageComponent extends ComponentWithIcon {
|
|
}
|
|
|
|
export interface ImageComponentProperties extends ComponentProperties, ComponentWithIconProperties {
|
|
}
|
|
|
|
/**
|
|
* Panel component with tabs
|
|
*/
|
|
export interface TabbedPanelComponent extends Container<TabbedPanelLayout, any> {
|
|
/**
|
|
* An event triggered when the selected tab is changed.
|
|
* The event argument is the id of the selected tab.
|
|
*/
|
|
onTabChanged: vscode.Event<string>;
|
|
}
|
|
|
|
/**
|
|
* Defines the tab orientation of TabbedPanelComponent
|
|
*/
|
|
export enum TabOrientation {
|
|
Vertical = 'vertical',
|
|
Horizontal = 'horizontal'
|
|
}
|
|
|
|
/**
|
|
* Layout of TabbedPanelComponent, can be used to initialize the component when using ModelBuilder
|
|
*/
|
|
export interface TabbedPanelLayout {
|
|
orientation: TabOrientation;
|
|
}
|
|
|
|
/**
|
|
* Represents the tab of TabbedPanelComponent
|
|
*/
|
|
export interface Tab {
|
|
/**
|
|
* Title of the tab
|
|
*/
|
|
title: string;
|
|
|
|
/**
|
|
* Content component of the tab
|
|
*/
|
|
content: Component;
|
|
|
|
/**
|
|
* Id of the tab
|
|
*/
|
|
id: string;
|
|
}
|
|
|
|
/**
|
|
* Represents the tab group of TabbedPanelComponent
|
|
*/
|
|
export interface TabGroup {
|
|
/**
|
|
* Title of the tab group
|
|
*/
|
|
title: string;
|
|
|
|
/**
|
|
* children of the tab group
|
|
*/
|
|
tabs: Tab[];
|
|
}
|
|
|
|
/**
|
|
* Builder for TabbedPannelComponent
|
|
*/
|
|
export interface TabbedPanelComponentBuilder extends ContainerBuilder<TabbedPanelComponent, any, any> {
|
|
/**
|
|
* Add the tabs to the component
|
|
* @param tabs tabs/tab groups to be added
|
|
*/
|
|
withTabs(tabs: (Tab | TabGroup)[]): ContainerBuilder<TabbedPanelComponent, any, any>;
|
|
}
|
|
|
|
export interface InputBoxProperties extends ComponentProperties {
|
|
validationErrorMessage?: string;
|
|
}
|
|
|
|
export interface CheckBoxProperties {
|
|
required?: boolean;
|
|
}
|
|
|
|
export namespace nb {
|
|
/**
|
|
* An event that is emitted when the active Notebook editor is changed.
|
|
*/
|
|
export const onDidChangeActiveNotebookEditor: vscode.Event<NotebookEditor>;
|
|
}
|
|
}
|
|
|