2020using Umbraco . Core . Models ;
2121using Umbraco . Web . Services ;
2222using System . Web . Http ;
23+ using Umbraco . Core . Telemetry ;
2324
2425namespace Umbraco . Web . Editors
2526{
@@ -34,18 +35,28 @@ public class DashboardController : UmbracoApiController
3435 {
3536 private readonly IDashboardService _dashboardService ;
3637 private readonly IContentDashboardSettings _dashboardSettings ;
38+ private readonly ISiteIdentifierService _siteIdentifierService ;
3739
3840 /// <summary>
3941 /// Initializes a new instance of the <see cref="DashboardController"/> with all its dependencies.
4042 /// </summary>
41- public DashboardController ( IGlobalSettings globalSettings , IUmbracoContextAccessor umbracoContextAccessor ,
42- ISqlContext sqlContext , ServiceContext services , AppCaches appCaches , IProfilingLogger logger ,
43- IRuntimeState runtimeState , IDashboardService dashboardService , UmbracoHelper umbracoHelper ,
44- IContentDashboardSettings dashboardSettings )
43+ public DashboardController (
44+ IGlobalSettings globalSettings ,
45+ IUmbracoContextAccessor umbracoContextAccessor ,
46+ ISqlContext sqlContext ,
47+ ServiceContext services ,
48+ AppCaches appCaches ,
49+ IProfilingLogger logger ,
50+ IRuntimeState runtimeState ,
51+ IDashboardService dashboardService ,
52+ UmbracoHelper umbracoHelper ,
53+ IContentDashboardSettings dashboardSettings ,
54+ ISiteIdentifierService siteIdentifierService )
4555 : base ( globalSettings , umbracoContextAccessor , sqlContext , services , appCaches , logger , runtimeState , umbracoHelper )
4656 {
4757 _dashboardService = dashboardService ;
4858 _dashboardSettings = dashboardSettings ;
59+ _siteIdentifierService = siteIdentifierService ;
4960 }
5061
5162 //we have just one instance of HttpClient shared for the entire application
@@ -60,17 +71,19 @@ public async Task<JObject> GetRemoteDashboardContent(string section, string base
6071 var language = user . Language ;
6172 var version = UmbracoVersion . SemanticVersion . ToSemanticString ( ) ;
6273 var isAdmin = user . IsAdmin ( ) ;
74+ _siteIdentifierService . TryGetOrCreateSiteIdentifier ( out var siteIdentifier ) ;
6375
6476 VerifyDashboardSource ( baseUrl ) ;
6577
66- var url = string . Format ( "{0}{1}?section={2}&allowed={3}&lang={4}&version={5}&admin={6}" ,
78+ var url = string . Format ( "{0}{1}?section={2}&allowed={3}&lang={4}&version={5}&admin={6}&siteid={7} " ,
6779 baseUrl ,
6880 _dashboardSettings . ContentDashboardPath ,
6981 section ,
7082 allowedSections ,
7183 language ,
7284 version ,
73- isAdmin ) ;
85+ isAdmin ,
86+ siteIdentifier . ToString ( ) ) ;
7487 var key = "umbraco-dynamic-dashboard-" + language + allowedSections . Replace ( "," , "-" ) + section ;
7588
7689 var content = AppCaches . RuntimeCache . GetCacheItem < JObject > ( key ) ;
0 commit comments