mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Move query history into extension (#19794)
* initial * more * Remove connectionId * cleanup * cleanup * Remove core contributions, add to panel by default * Add enabled state * Update config * cleanup * Move * Remove newlines * update README
This commit is contained in:
22
extensions/query-history/src/queryHistoryNode.ts
Normal file
22
extensions/query-history/src/queryHistoryNode.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import { removeNewLines } from './utils';
|
||||
|
||||
export class QueryHistoryNode extends vscode.TreeItem {
|
||||
constructor(
|
||||
public readonly queryText: string,
|
||||
public readonly connectionProfile: azdata.connection.ConnectionProfile | undefined,
|
||||
timestamp: Date,
|
||||
isSuccess: boolean
|
||||
) {
|
||||
super(removeNewLines(queryText), vscode.TreeItemCollapsibleState.None);
|
||||
this.iconPath = isSuccess ? new vscode.ThemeIcon('check', new vscode.ThemeColor('testing.iconPassed')) : new vscode.ThemeIcon('error', new vscode.ThemeColor('testing.iconFailed'));
|
||||
this.tooltip = queryText;
|
||||
this.description = connectionProfile ? `${connectionProfile.serverName}|${connectionProfile.databaseName} ${timestamp.toLocaleString()}` : timestamp.toLocaleString();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user