mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -05:00
Add loading indicator when an XEL File is opened (#24274)
* Add loading indicator when an XEL File is opened * Remove custom loading message
This commit is contained in:
@@ -41,6 +41,8 @@ export class ProfilerInput extends EditorInput implements IProfilerSession {
|
||||
private _onColumnsChanged = new Emitter<Slick.Column<Slick.SlickData>[]>();
|
||||
public onColumnsChanged: Event<Slick.Column<Slick.SlickData>[]> = this._onColumnsChanged.event;
|
||||
|
||||
private _initializerSetup: boolean = true;
|
||||
|
||||
private _filter: ProfilerFilter = { clauses: [] };
|
||||
|
||||
constructor(
|
||||
@@ -162,6 +164,14 @@ export class ProfilerInput extends EditorInput implements IProfilerSession {
|
||||
return !!this.fileURI;
|
||||
}
|
||||
|
||||
public get isSetupPhase(): boolean {
|
||||
return this._initializerSetup;
|
||||
}
|
||||
|
||||
public setInitializerPhase(isSetupPhase: boolean) {
|
||||
this._initializerSetup = isSetupPhase;
|
||||
}
|
||||
|
||||
public setConnectionState(isConnected: boolean): void {
|
||||
this.state.change({
|
||||
isConnected: isConnected
|
||||
|
||||
@@ -501,6 +501,11 @@ export class ProfilerEditor extends EditorPane {
|
||||
if (savedViewState) {
|
||||
this._profilerTableEditor.restoreViewState(savedViewState);
|
||||
}
|
||||
|
||||
if (this.input.isFileSession && this.input.isSetupPhase) { // Add loading indicator when opening a new file session
|
||||
this._profilerTableEditor.loadingSpinner.loading = true;
|
||||
this.input.setInitializerPhase(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -546,7 +551,7 @@ export class ProfilerEditor extends EditorPane {
|
||||
if (this.input.state.isConnected) {
|
||||
this._updateToolbar();
|
||||
|
||||
// Launch the create session dialog if openning a new window.
|
||||
// Launch the create session dialog if opening a new window.
|
||||
let uiState = this._profilerService.getSessionViewState(this.input.id);
|
||||
let previousSessionName = uiState && uiState.previousSessionName;
|
||||
if (!this.input.sessionName && !previousSessionName && !this.input.isFileSession) {
|
||||
@@ -583,6 +588,8 @@ export class ProfilerEditor extends EditorPane {
|
||||
this._updateToolbar();
|
||||
if (!this.input.isFileSession) { // skip updating session selector for File sessions to block starting another session from a non-connected file session
|
||||
this._updateSessionSelector();
|
||||
} else {
|
||||
this._profilerTableEditor.loadingSpinner.loading = false; // Remove the loading indicator when the complete file is read
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ import { IAccessibilityService } from 'vs/platform/accessibility/common/accessib
|
||||
import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';
|
||||
import { IComponentContextService } from 'sql/workbench/services/componentContext/browser/componentContextService';
|
||||
import { defaultTableStyles } from 'sql/platform/theme/browser/defaultStyles';
|
||||
import { LoadingSpinner } from 'sql/base/browser/ui/loadingSpinner/loadingSpinner';
|
||||
|
||||
export interface ProfilerTableViewState {
|
||||
scrollTop: number;
|
||||
@@ -57,6 +58,7 @@ export class ProfilerTableEditor extends EditorPane implements IProfilerControll
|
||||
private _actionMap: { [x: string]: IEditorAction } = {};
|
||||
private _statusbarItem: IDisposable;
|
||||
private _showStatusBarItem: boolean;
|
||||
public loadingSpinner: LoadingSpinner;
|
||||
|
||||
private _onDidChangeConfiguration = new Emitter<IConfigurationChangedEvent>();
|
||||
public onDidChangeConfiguration: Event<IConfigurationChangedEvent> = this._onDidChangeConfiguration.event;
|
||||
@@ -88,6 +90,7 @@ export class ProfilerTableEditor extends EditorPane implements IProfilerControll
|
||||
this._overlay.className = 'overlayWidgets';
|
||||
this._overlay.style.width = '100%';
|
||||
this._overlay.style.zIndex = '4';
|
||||
this._overlay.style.paddingTop = '50px';
|
||||
parent.appendChild(this._overlay);
|
||||
|
||||
this._profilerTable = new Table(parent, this._accessibilityService, this._quickInputService, defaultTableStyles, {
|
||||
@@ -129,6 +132,8 @@ export class ProfilerTableEditor extends EditorPane implements IProfilerControll
|
||||
this._contextKeyService,
|
||||
this._themeService
|
||||
);
|
||||
|
||||
this.loadingSpinner = new LoadingSpinner(this._overlay, { showText: true, fullSize: false });
|
||||
}
|
||||
|
||||
public override setInput(input: ProfilerInput): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user