diff --git a/src/sql/workbench/browser/editor/profiler/profilerInput.ts b/src/sql/workbench/browser/editor/profiler/profilerInput.ts index b40277252fa2..a0547d6f6028 100644 --- a/src/sql/workbench/browser/editor/profiler/profilerInput.ts +++ b/src/sql/workbench/browser/editor/profiler/profilerInput.ts @@ -41,6 +41,8 @@ export class ProfilerInput extends EditorInput implements IProfilerSession { private _onColumnsChanged = new Emitter[]>(); public onColumnsChanged: Event[]> = 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 diff --git a/src/sql/workbench/contrib/profiler/browser/profilerEditor.ts b/src/sql/workbench/contrib/profiler/browser/profilerEditor.ts index 4bdca522cc86..d447732fa1b3 100644 --- a/src/sql/workbench/contrib/profiler/browser/profilerEditor.ts +++ b/src/sql/workbench/contrib/profiler/browser/profilerEditor.ts @@ -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 } } } diff --git a/src/sql/workbench/contrib/profiler/browser/profilerTableEditor.ts b/src/sql/workbench/contrib/profiler/browser/profilerTableEditor.ts index 1d8e4a8ec48a..eacdd7d2d32f 100644 --- a/src/sql/workbench/contrib/profiler/browser/profilerTableEditor.ts +++ b/src/sql/workbench/contrib/profiler/browser/profilerTableEditor.ts @@ -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(); public onDidChangeConfiguration: Event = 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 {