mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Sorting top by cost initially (#19998)
This commit is contained in:
@@ -28,6 +28,9 @@ import { Action } from 'vs/base/common/actions';
|
|||||||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||||
import { ITableKeyboardEvent } from 'sql/base/browser/ui/table/interfaces';
|
import { ITableKeyboardEvent } from 'sql/base/browser/ui/table/interfaces';
|
||||||
import { Disposable } from 'vs/base/common/lifecycle';
|
import { Disposable } from 'vs/base/common/lifecycle';
|
||||||
|
|
||||||
|
const TABLE_SORT_COLUMN_KEY = 'tableCostColumnForSorting';
|
||||||
|
|
||||||
export class TopOperationsTab extends Disposable implements IPanelTab {
|
export class TopOperationsTab extends Disposable implements IPanelTab {
|
||||||
public readonly title = localize('topOperationsTabTitle', "Top Operations (Preview)");
|
public readonly title = localize('topOperationsTabTitle', "Top Operations (Preview)");
|
||||||
public readonly identifier: string = 'TopOperationsTab';
|
public readonly identifier: string = 'TopOperationsTab';
|
||||||
@@ -128,9 +131,14 @@ export class TopOperationsTabView extends Disposable implements IPanelView {
|
|||||||
if (node.children) {
|
if (node.children) {
|
||||||
node.children.forEach(c => stack.push(c));
|
node.children.forEach(c => stack.push(c));
|
||||||
}
|
}
|
||||||
|
row[TABLE_SORT_COLUMN_KEY] = node.cost;
|
||||||
dataMap.push(row);
|
dataMap.push(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dataMap.sort((a, b) => {
|
||||||
|
return b[TABLE_SORT_COLUMN_KEY] - a[TABLE_SORT_COLUMN_KEY];
|
||||||
|
});
|
||||||
|
|
||||||
const columns = columnValues.map((c, i) => {
|
const columns = columnValues.map((c, i) => {
|
||||||
return <Slick.Column<Slick.SlickData>>{
|
return <Slick.Column<Slick.SlickData>>{
|
||||||
id: c.toString(),
|
id: c.toString(),
|
||||||
@@ -252,6 +260,7 @@ export class TopOperationsTabView extends Disposable implements IPanelView {
|
|||||||
this._queryResultsView.focusOnNode(planId, nodeId);
|
this._queryResultsView.focusOnNode(planId, nodeId);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
this._tables.push(table);
|
this._tables.push(table);
|
||||||
const contextMenuAction = [
|
const contextMenuAction = [
|
||||||
this._instantiationService.createInstance(CopyTableData),
|
this._instantiationService.createInstance(CopyTableData),
|
||||||
|
|||||||
Reference in New Issue
Block a user