File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3232 <div class =" dropdown-item px-4 py-2 text-sm text-gray-700 cursor-pointer hover:bg-gray-100 @(application.Identifier == Model.SelectedApplicationId ? " bg-gray-100 " : " " )"
3333 data-application-id =" @application.Identifier"
3434 data-application-name =" @application.Name"
35- hx-on:click =" selectApplication(this)" >
35+ onclick =" selectApplication(this)" >
3636 @application.Name
3737 </div >
3838 }
Original file line number Diff line number Diff line change 11using Microsoft . AspNetCore . Mvc ;
22using Minigun . Models ;
33using Minigun . Services ;
4+ using System . Text . Json ;
45
56namespace Minigun . ViewComponents ;
67
@@ -18,7 +19,10 @@ public async Task<IViewComponentResult> InvokeAsync()
1819 var pathParts = Request . Path . ToString ( ) . Split ( "/" , StringSplitOptions . RemoveEmptyEntries ) ;
1920 var selectedId = pathParts . Length > 1 ? pathParts [ 1 ] : null ;
2021
21- var applications = await _raygunApiService . ListApplicationsAsync ( 100 ) ;
22+ var applications = await GetAllApplicationsAsync ( ) ;
23+
24+ // Sort applications alphabetically
25+ applications = applications . OrderBy ( a => a . Name ) . ToList ( ) ;
2226
2327 // Find selected application and move it to first position if found
2428 var selectedApp = applications . FirstOrDefault ( a => a . Identifier == selectedId ) ;
@@ -38,4 +42,24 @@ public async Task<IViewComponentResult> InvokeAsync()
3842
3943 return View ( "/Areas/Shared/_ApplicationsPartial.cshtml" , model ) ;
4044 }
45+
46+ private async Task < List < Application > > GetAllApplicationsAsync ( )
47+ {
48+ var allApplications = new List < Application > ( ) ;
49+ var offset = 0 ;
50+ const int pageSize = 100 ;
51+ bool hasMoreData ;
52+
53+ do
54+ {
55+ var batch = await _raygunApiService . ListApplicationsAsync ( pageSize , offset ) ;
56+ allApplications . AddRange ( batch ) ;
57+
58+ hasMoreData = batch . Count == pageSize ;
59+ offset += pageSize ;
60+ }
61+ while ( hasMoreData ) ;
62+
63+ return allApplications ;
64+ }
4165}
You can’t perform that action at this time.
0 commit comments