Skip to content

Commit 763dbb1

Browse files
committed
Add CombinedTags column
1 parent c4108b0 commit 763dbb1

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

AzTagger/AzTagger.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<OutputType>WinExe</OutputType>
55
<TargetFramework>net9.0-windows7.0</TargetFramework>
66
<UseWindowsForms>true</UseWindowsForms>
7-
<Version>1.0.14.0</Version>
7+
<Version>1.0.15.0</Version>
88
<Authors>Thomas Gossler</Authors>
99
<Description>
1010
A Windows Desktop GUI application for fast and flexible querying of Azure resources
@@ -18,8 +18,8 @@
1818
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1919
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
2020
<ApplicationIcon>images\icon.ico</ApplicationIcon>
21-
<AssemblyVersion>1.0.14.0</AssemblyVersion>
22-
<FileVersion>1.0.14.0</FileVersion>
21+
<AssemblyVersion>1.0.15.0</AssemblyVersion>
22+
<FileVersion>1.0.15.0</FileVersion>
2323
</PropertyGroup>
2424

2525

AzTagger/MainForm.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ public partial class MainForm : Form
132132
SubscriptionTags,
133133
ResourceGroupTags = ResourceGroupTags_dynamic,
134134
ResourceTags = ResourceTags_dynamic
135+
| extend CombinedTags = bag_merge(ResourceTags, ResourceGroupTags, SubscriptionTags)
135136
| order by EntityType desc, (tolower(SubscriptionName)) asc, (tolower(ResourceGroup)) asc, (tolower(ResourceName)) asc
136137
";
137138

@@ -808,7 +809,7 @@ private async void MenuItem_RefreshTags_Click(object sender, EventArgs e)
808809
.ToList();
809810

810811
var resourceIds = string.Join(", ", selectedResources.Select(r => $"'{r.Id}'"));
811-
var query = _baseQuery + $@"| where Id in ({resourceIds}) | project Id, SubscriptionTags, ResourceGroupTags, ResourceTags";
812+
var query = _baseQuery + $@"| where Id in ({resourceIds}) | project Id, SubscriptionTags, ResourceGroupTags, ResourceTags, CombinedTags";
812813

813814
var updatedResources = await _azureService.QueryResourcesAsync(query);
814815

@@ -820,6 +821,7 @@ private async void MenuItem_RefreshTags_Click(object sender, EventArgs e)
820821
localResource.SubscriptionTags = updatedResource.SubscriptionTags;
821822
localResource.ResourceGroupTags = updatedResource.ResourceGroupTags;
822823
localResource.ResourceTags = updatedResource.ResourceTags;
824+
localResource.CombinedTags = updatedResource.CombinedTags;
823825
}
824826
}
825827

@@ -996,7 +998,8 @@ private void DataGridView_Results_CellMouseEnter(object sender, DataGridViewCell
996998
if (column != null &&
997999
column.DataPropertyName == "ResourceTags" ||
9981000
column.DataPropertyName == "ResourceGroupTags" ||
999-
column.DataPropertyName == "SubscriptionTags")
1001+
column.DataPropertyName == "SubscriptionTags" ||
1002+
column.DataPropertyName == "CombinedTags")
10001003
{
10011004
_currentCellEventArgs = e;
10021005
_tooltipTimer.Start();
@@ -1039,7 +1042,8 @@ private void ToolTipTimer_Tick(object sender, EventArgs e)
10391042
var column = _gvwResults.Columns[cellEventArgs.ColumnIndex];
10401043
if (column.DataPropertyName == "ResourceTags" ||
10411044
column.DataPropertyName == "ResourceGroupTags" ||
1042-
column.DataPropertyName == "SubscriptionTags")
1045+
column.DataPropertyName == "SubscriptionTags" ||
1046+
column.DataPropertyName == "CombinedTags")
10431047
{
10441048
var tags = cell.Value as IDictionary<string, string>;
10451049
if (tags != null && tags.Count > 0)
@@ -1108,7 +1112,8 @@ private void DataGridView_Results_ColumnHeaderMouseDoubleClick(object sender, Da
11081112
{
11091113
if (columnName == "ResourceTags" ||
11101114
columnName == "ResourceGroupTags" ||
1111-
columnName == "SubscriptionTags")
1115+
columnName == "SubscriptionTags" ||
1116+
columnName == "CombinedTags")
11121117
{
11131118
var queryText = $"| where {columnName}[''] =~ ''";
11141119
_txtSearchQuery.Text = queryText;

AzTagger/Models/Resource.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ public class Resource
1717
public IDictionary<string, string> SubscriptionTags { get; set; }
1818
public IDictionary<string, string> ResourceGroupTags { get; set; }
1919
public IDictionary<string, string> ResourceTags { get; set; }
20+
public IDictionary<string, string> CombinedTags { get; set; }
2021
}

0 commit comments

Comments
 (0)