protected override void WriteResponse(DashboardResponse response)
 {
     foreach (var resourceName in _resourceNames)
     {
         WriteResource(
             response,
             _assembly,
             $"{_baseNamespace}.{resourceName}");
     }
 }
 protected override void WriteResponse(DashboardResponse response)
 {
     foreach (var resourceName in _resourceNames)
     {
         WriteResource(
             response,
             _assembly,
             $"{_baseNamespace}.{resourceName}");
     }
 }
 protected override async Task WriteResponse(DashboardResponse response)
 {
     foreach (var resourceName in _resourceNames)
     {
         await WriteResource(
             response,
             _assembly,
             $"{_baseNamespace}.{resourceName}").ConfigureAwait(false);
     }
 }
Exemple #4
0
 /// <exclude />
 public void Assign(RazorPage parentPage)
 {
     Request              = parentPage.Request;
     Response             = parentPage.Response;
     Storage              = parentPage.Storage;
     AppPath              = parentPage.AppPath;
     StatsPollingInterval = parentPage.StatsPollingInterval;
     Url             = parentPage.Url;
     Url.ApiPath     = parentPage.Url.ApiPath;
     GenerationTime  = parentPage.GenerationTime;
     _statisticsLazy = parentPage._statisticsLazy;
 }
Exemple #5
0
        protected void WriteResource(DashboardResponse response, Assembly assembly, string resourceName)
        {
            using (var inputStream = assembly.GetManifestResourceStream(resourceName))
            {
                if (inputStream == null)
                {
                    throw new ArgumentException($@"Resource with name {resourceName} not found in assembly {assembly}.");
                }

                inputStream.CopyTo(response.Body);
            }
        }
Exemple #6
0
        /// <exclude />
        public void Assign(RazorPage parentPage)
        {
            Request = parentPage.Request;
            Response = parentPage.Response;
            Storage = parentPage.Storage;
            AppPath = parentPage.AppPath;
            StatsPollingInterval = parentPage.StatsPollingInterval;
            Url = parentPage.Url;

            GenerationTime = parentPage.GenerationTime;
            _statisticsLazy = parentPage._statisticsLazy;
        }
        protected async Task WriteResource(DashboardResponse response, Assembly assembly, string resourceName)
        {
            using (var inputStream = assembly.GetManifestResourceStream(resourceName))
            {
                if (inputStream == null)
                {
                    throw new ArgumentException($@"Resource with name {resourceName} not found in assembly {assembly}.");
                }

                await inputStream.CopyToAsync(response.Body).ConfigureAwait(false);
            }
        }
Exemple #8
0
        /// <exclude />
        public void Assign(RazorPage parentPage)
        {
            Request          = parentPage.Request;
            Response         = parentPage.Response;
            Storage          = parentPage.Storage;
            AppPath          = parentPage.AppPath;
            DashboardOptions = parentPage.DashboardOptions;
            Url = parentPage.Url;

            GenerationTime  = parentPage.GenerationTime;
            _statisticsLazy = parentPage._statisticsLazy;
        }
        protected void WriteResource(DashboardResponse response, Assembly assembly, string resourceName)
        {
            using (var inputStream = assembly.GetManifestResourceStream(resourceName))
            {
                if (inputStream == null)
                {
                    throw new ArgumentException($@"Resource with name {resourceName} not found in assembly {assembly}.");
                }

                inputStream.CopyTo(response.Body);
            }
        }
Exemple #10
0
        internal void Assign(DashboardContext context)
        {
            Request  = context.Request;
            Response = context.Response;

            Storage = context.Storage;
            AppPath = context.Options.AppPath;
            StatsPollingInterval = context.Options.StatsPollingInterval;
            Url             = new UrlHelper(context);
            Url.ApiPath     = context.Options.ApiPath;
            _statisticsLazy = new Lazy <StatisticsDto>(() =>
            {
                var monitoring = Storage.GetMonitoringApi();
                return(monitoring.GetStatistics());
            });
        }
Exemple #11
0
 protected virtual void WriteResponse(DashboardResponse response)
 {
     WriteResource(response, _assembly, _resourceName);
 }
Exemple #12
0
        internal void Assign(DashboardContext context)
        {
            Request = context.Request;
            Response = context.Response;

            Storage = context.Storage;
            AppPath = context.Options.AppPath;
            StatsPollingInterval = context.Options.StatsPollingInterval;
            Url = new UrlHelper(context);

            _statisticsLazy = new Lazy<StatisticsDto>(() =>
            {
                var monitoring = Storage.GetMonitoringApi();
                return monitoring.GetStatistics();
            });
        }
 protected virtual Task WriteResponse(DashboardResponse response)
 {
     return(WriteResource(response, _assembly, _resourceName));
 }
 protected virtual void WriteResponse(DashboardResponse response)
 {
     WriteResource(response, _assembly, _resourceName);
 }