From 7dec51550e5fb7fa1be3e7bfb977a3002c17d08e Mon Sep 17 00:00:00 2001 From: Konstantin Lepeshenkov Date: Sun, 28 Feb 2021 16:15:54 +0100 Subject: [PATCH] #59 --- .../resources/storageAccount.svg | 26 +-- .../resources/storageAccountAttached.svg | 171 ++++++++++-------- .../src/BackendProcess.ts | 3 +- .../src/MonitorViewList.ts | 2 +- .../src/StorageAccountTreeItem.ts | 8 +- .../src/StorageAccountTreeItems.ts | 3 +- 6 files changed, 120 insertions(+), 93 deletions(-) diff --git a/durablefunctionsmonitor-vscodeext/resources/storageAccount.svg b/durablefunctionsmonitor-vscodeext/resources/storageAccount.svg index 8fffb01..81c839c 100644 --- a/durablefunctionsmonitor-vscodeext/resources/storageAccount.svg +++ b/durablefunctionsmonitor-vscodeext/resources/storageAccount.svg @@ -1,13 +1,15 @@ - - - - - - - - - - + + + + + + + + + Icon-storage-86 + + + + + diff --git a/durablefunctionsmonitor-vscodeext/resources/storageAccountAttached.svg b/durablefunctionsmonitor-vscodeext/resources/storageAccountAttached.svg index b90a7af..13ef3d9 100644 --- a/durablefunctionsmonitor-vscodeext/resources/storageAccountAttached.svg +++ b/durablefunctionsmonitor-vscodeext/resources/storageAccountAttached.svg @@ -7,82 +7,99 @@ xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + id="f2f04349-8aee-4413-84c9-a9053611b319" + width="18" + height="18" + viewBox="0 0 18 18" version="1.1" - id="Layer_1" - x="0px" - y="0px" - width="50px" - height="50px" - viewBox="0 0 50 50" - enable-background="new 0 0 50 50" - xml:space="preserve" sodipodi:docname="storageAccountAttached.svg" - inkscape:version="1.0 (4035a4fb49, 2020-05-01)">image/svg+xml - - - - - - -Sheet.20 + inkscape:version="1.0.2 (e86c870879, 2021-01-15, custom)"> + + + + image/svg+xml + + + + + + + + + + + + + Icon-storage-86 + + + + + + + Sheet.20 + + + diff --git a/durablefunctionsmonitor-vscodeext/src/BackendProcess.ts b/durablefunctionsmonitor-vscodeext/src/BackendProcess.ts index e1f88b8..9cbc1d6 100644 --- a/durablefunctionsmonitor-vscodeext/src/BackendProcess.ts +++ b/durablefunctionsmonitor-vscodeext/src/BackendProcess.ts @@ -223,8 +223,9 @@ export class StorageConnectionSettings { get hubName(): string { return this._hubName; }; get connStringHashKey(): string { return this._connStringHashKey; } get hashKey(): string { return this._hashKey; } + get isFromLocalSettingsJson(): boolean { return this._fromLocalSettingsJson; } - constructor(private _connString: string, private _hubName: string) { + constructor(private _connString: string, private _hubName: string, private _fromLocalSettingsJson: boolean = false) { this._connStringHashKey = StorageConnectionSettings.GetConnStringHashKey(this._connString); this._hashKey = this._connStringHashKey + this._hubName.toLowerCase(); diff --git a/durablefunctionsmonitor-vscodeext/src/MonitorViewList.ts b/durablefunctionsmonitor-vscodeext/src/MonitorViewList.ts index 8518184..4e04e44 100644 --- a/durablefunctionsmonitor-vscodeext/src/MonitorViewList.ts +++ b/durablefunctionsmonitor-vscodeext/src/MonitorViewList.ts @@ -79,7 +79,7 @@ export class MonitorViewList { return null; } - return new StorageConnectionSettings(ConnStringUtils.ExpandEmulatorShortcutIfNeeded(storageConnString), hubName); + return new StorageConnectionSettings(ConnStringUtils.ExpandEmulatorShortcutIfNeeded(storageConnString), hubName, true); } // Stops all backend processes and closes all views diff --git a/durablefunctionsmonitor-vscodeext/src/StorageAccountTreeItem.ts b/durablefunctionsmonitor-vscodeext/src/StorageAccountTreeItem.ts index 78af6ae..191a808 100644 --- a/durablefunctionsmonitor-vscodeext/src/StorageAccountTreeItem.ts +++ b/durablefunctionsmonitor-vscodeext/src/StorageAccountTreeItem.ts @@ -11,7 +11,8 @@ export class StorageAccountTreeItem extends vscode.TreeItem { accountName: string, private _resourcesFolderPath: string, private _getBackendUrl: () => string, - private _isTaskHubAttached: (hubName: string) => boolean) { + private _isTaskHubAttached: (hubName: string) => boolean, + private _fromLocalSettingsJson: boolean = false) { super(accountName, vscode.TreeItemCollapsibleState.Expanded); } @@ -37,6 +38,11 @@ export class StorageAccountTreeItem extends vscode.TreeItem { } get tooltip(): string { + + if (this._fromLocalSettingsJson) { + return `from local.settings.json`; + } + return StorageConnectionSettings.MaskStorageConnString(this._connString); } diff --git a/durablefunctionsmonitor-vscodeext/src/StorageAccountTreeItems.ts b/durablefunctionsmonitor-vscodeext/src/StorageAccountTreeItems.ts index bd8f8b3..68d8f64 100644 --- a/durablefunctionsmonitor-vscodeext/src/StorageAccountTreeItems.ts +++ b/durablefunctionsmonitor-vscodeext/src/StorageAccountTreeItems.ts @@ -63,7 +63,8 @@ export class StorageAccountTreeItems { storageAccountName, this._resourcesFolderPath, () => this._monitorViewList.getBackendUrl(storageConnString), - (h) => this._monitorViewList.isMonitorViewVisible(new StorageConnectionSettings(storageConnString, h)) + (h) => this._monitorViewList.isMonitorViewVisible(new StorageConnectionSettings(storageConnString, h)), + connSettings.isFromLocalSettingsJson ); this._storageAccountItems.push(node);