Example #1
0
        private TabSection BuildFrameworkDetails(EnvironmentFrameworkModel model)
        {
            var section = new TabSection(".NET Framework", "Debugging", "Server Culture", "Current Trust Level");

            section.AddRow().Column(model.DotnetFramework).Column(model.Debugging).Column(model.ServerCulture).Column(model.CurrentTrustLevel);
            return(section);
        }
Example #2
0
        public override TabSection Create()
        {
            var section = new TabSection("Item", "Value");

            var itemSection = CreateSection(DataKey.Item);

            if (itemSection != null)
            {
                section.AddRow().Column("Properties").Column(itemSection);
            }

            var itemTemplate = new ItemTemplateSection(RequestData).Create();

            if (itemTemplate != null)
            {
                section.AddRow().Column("Template").Column(itemTemplate);
            }

            var itemVisualization = new ItemVisualizationSection(RequestData).Create();

            if (itemVisualization != null)
            {
                section.AddRow().Column("Visualization").Column(itemVisualization);
            }

            return(section);
        }
Example #3
0
        private static TabSection BuildWebServerDetails(EnvironmentWebServerModel model)
        {
            var section = new TabSection("Type", "Integrated Pipeline");

            section.AddRow().Column(model.ServerType).Column(model.IntegratedPipeline);
            return(section);
        }
        public override object GetData(ITabContext context)
        {
            TabSection plugin = Plugin.Create("No", "Started", "Duration", "Method", "Index", "Document", "Endpoint", "Query");

            var requestContext       = context.GetRequestContext <HttpContextBase>();
            List <RequestItem> items = RequestHandler.GetLogList(requestContext);

            if (items == null || !items.Any())
            {
                return(null);
            }
            int count = 0;

            foreach (RequestItem item in items)
            {
                plugin.AddRow()
                .Column(count++)
                .Column(String.Format("{0:#,0}", item.Time.Subtract(requestContext.Timestamp).TotalMilliseconds))
                .Column(item.Duration.HasValue
                        ? String.Format("{0:#,0}", item.Duration.Value.TotalMilliseconds)
                        : null)
                .Column(item.Method)
                .Column(item.Index)
                .Column(item.Document)
                .Column(item.Endpoint)
                .Column(item.Query);
            }

            return(plugin);
        }
Example #5
0
        public override object Convert(List <SessionModel> obj)
        {
            var root = new TabSection("Key", "Value", "Type");

            foreach (var item in obj)
            {
                var row = root.AddRow().Column(item.Key);

                if (item.Type != null)
                {
                    if (item.Type.IsSerializable)
                    {
                        row.Column(item.Value);
                    }
                    else if (item.Type.GetMethod("ToString").DeclaringType == item.Type)
                    {
                        row.Column(item.Value.ToString());
                    }
                    else
                    {
                        row.Column("Non serializable type :(").Emphasis();
                    }
                }
                else
                {
                    row.Column(item.Value);
                }

                row.Column(item.Type);
            }

            return(root.Build());
        }
Example #6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        private static object getDynamicPublishedContent(object obj, string type)
        {
            var tabSection = new TabSection("Id", "Name", "NodeTypeAlias", "");

            if (obj == null)
            {
                return("** Empty **");
            }
            else
            {
                var    item = (DynamicPublishedContent)obj;
                string url  = "";
                if (type == "media")
                {
                    url = string.Format("<a href='{0}' >Details</a>", getMediaUrl(item.Id.ToString()));
                }
                else
                {
                    url = string.Format("<a href='{0}' >Details</a>", getContentUrl(item.Id.ToString()));
                }
                tabSection.AddRow()
                .Column(item.Id.ToString())
                .Column(item.Name)
                .Column(item.DocumentTypeAlias)
                .Column(url).Raw();

                return(tabSection);
            }
        }
        public override TabSection Create()
        {
            var users = (LoggedInUser[])RequestData[DataKey.UserList];

            if ((users == null) || (!users.Any()))
            {
                return(null);
            }

            var section = new TabSection("Username", "Session ID", "Admin", "Created", "Last Request");

            foreach (var user in users)
            {
                var row = section.AddRow()
                          .Column(user.Name)
                          .Column(user.SessionId)
                          .Column(user.IsAdmin ? "Yes" : "No")
                          .Column(user.Created)
                          .Column(user.LastRequest);

                if (user.IsInactive())
                {
                    row.ApplyRowStyle("warn");
                }
            }

            return(section);
        }
Example #8
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="collection"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        private static object getDynamicPublishedContentList(object collection, string type)
        {
            var  tabSection = new TabSection("Id", "Name", "DocumentTypeAlias", "");
            bool isEmpty    = true;

            foreach (var item in (DynamicPublishedContentList)collection)
            {
                isEmpty = false;
                string url = "";
                if (type == "media")
                {
                    url = string.Format("<a href='{0}' >Details</a>", getMediaUrl(item.Id.ToString()));
                }
                else
                {
                    url = string.Format("<a href='{0}' >Details</a>", getContentUrl(item.Id.ToString()));
                }
                tabSection.AddRow()
                .Column(item.Id.ToString())
                .Column(item.Name)
                .Column(item.DocumentTypeAlias).
                Column(url).Raw();
            }
            if (isEmpty == true)
            {
                return("** Empty **");
            }
            return(tabSection);
        }
Example #9
0
        public override object Convert(IEnumerable <GlimpseMessage <AuthorizerMessage> > messages)
        {
            var root = new TabSection("Permission Name", "User is Authorized", "Content Id", "Content Name", "Content Type", "Evaluation Time");

            foreach (var message in messages.Unwrap().OrderByDescending(m => m.Duration))
            {
                root.AddRow()
                .Column(message.PermissionName)
                .Column(message.UserIsAuthorized ? "Yes" : "No")
                .Column((message.ContentId == 0 ? null : message.ContentId.ToString()))
                .Column(message.ContentName)
                .Column(message.ContentType)
                .Column(message.Duration.ToTimingString())
                .QuietIf(!message.UserIsAuthorized);
            }

            root.AddRow()
            .Column("")
            .Column("")
            .Column("")
            .Column("")
            .Column("Total time:")
            .Column(messages.Unwrap().Sum(m => m.Duration.TotalMilliseconds).ToTimingString())
            .Selected();

            return(root.Build());
        }
Example #10
0
 protected static void DisplayFields(KeyValuePair <string, object>[] fields, TabSection section)
 {
     foreach (var field in fields)
     {
         section.AddRow().Column(field.Key).Column(field.Value);
     }
 }
Example #11
0
        private TabSection BuildMachineDetails(EnvironmentMachineModel model)
        {
            var section = new TabSection("Name", "Operating System", "Start Time");

            section.AddRow().Column(model.Name).Column(model.OperatingSystem).Column(model.StartTime);
            return(section);
        }
Example #12
0
        private TabSection BuildTimeZoneDetails(EnvironmentTimeZoneModel model)
        {
            var section = new TabSection("Current", "Is Daylight Saving", "UtcOffset", "UtcOffset w/DLS");

            section.AddRow().Column(model.Name).Column(model.IsDaylightSavingTime).Column(model.UtcOffset).Column(model.UtcOffsetWithDls);
            return(section);
        }
Example #13
0
        public override object Convert(IEnumerable <GlimpseMessage <ElementMessage> > messages)
        {
            var root = new TabSection("Category", "Element Type", "Index", "Rule", "HTML Class", "HTML Style", "HTML ID", "Is Container?", "Number Of Child Elements", "Duration");

            foreach (var message in messages.Unwrap().OrderBy(m => m.Offset))
            {
                root.AddRow()
                .Column(message.Category)
                .Column(message.DisplayText)
                .Column(message.Index)
                .Column(message.Rule)
                .Column(message.HtmlClass)
                .Column(message.HtmlStyle)
                .Column(message.HtmlId)
                .Column(message.IsContainer ? "Yes" : "No")
                .Column(message.IsContainer ? message.NumberOfChildElements.ToString() : null)
                .Column(message.IsContainer ? null : message.Duration.ToTimingString());
            }

            root.AddRow()
            .Column("")
            .Column("")
            .Column("")
            .Column("")
            .Column("")
            .Column("")
            .Column("")
            .Column("")
            .Column("Total time:")
            .Column(messages.Unwrap().Max(m => m.Duration.TotalMilliseconds).ToTimingString())
            .Selected();

            return(root.Build());
        }
 private TabSection CreateSectionWithHandlers(TabSection section)
 {
     section.OnAfterExpanded += section_OnAfterExpanded;
     section.OnTabCreation   += (sender, tab) => CreateNewTab(tab);
     section.OnCreateNewTab  += (sender, vmType, parms) => CreateNewTab(vmType, parms);
     return(section);
 }
Example #15
0
        public override TabSection Create()
        {
            var isNewVisitor    = RequestData[DataKey.IsNewVisitor];
            var engagementValue = RequestData[DataKey.EngagementValue];
            var trafficType     = RequestData[DataKey.TrafficType];

            if ((isNewVisitor == null) || (engagementValue == null) || (trafficType == null))
            {
                return(null);
            }

            var section = new TabSection("Overview", "Value");

            section.AddRow().Column("New vs. Returning").Column(isNewVisitor);
            section.AddRow().Column("Engagement Value").Column(engagementValue);
            section.AddRow().Column("Traffic Type").Column(trafficType);

            var campaign = RequestData[DataKey.Campaign];

            if (campaign != null)
            {
                section.AddRow().Column("Campaign").Column(campaign);
            }

            return(section);
        }
Example #16
0
        public override object Convert(IEnumerable <GlimpseMessage <PartMessage> > messages)
        {
            var root = new TabSection("Content Item Name", "Content Item Type", "Content Item Stereotype", "Content Part", "Fields", "Duration");

            foreach (var message in messages.Unwrap().OrderByDescending(m => m.Duration))
            {
                root.AddRow()
                .Column(message.ContentItemName)
                .Column(message.ContentItemType)
                .Column(message.ContentItemStereotype)
                .Column(message.ContentPartType)
                .Column(message.Fields.Any() ? message.Fields as object : "None")
                .Column(message.Duration.ToTimingString());
            }

            root.AddRow()
            .Column("")
            .Column("")
            .Column("")
            .Column("")
            .Column("Total time:")
            .Column(messages.Unwrap().Sum(m => m.Duration.TotalMilliseconds).ToTimingString())
            .Selected();

            return(root.Build());
        }
Example #17
0
        public override object Convert(IEnumerable <WidgetMessage> messages)
        {
            var root = new TabSection("Widget Title", "Widget Type", "Layer", "Layer Rule", "Zone", "Position", "Technical Name", "Build Display Duration");

            foreach (var message in messages.OrderByDescending(m => m.Duration))
            {
                root.AddRow()
                .Column(message.Title)
                .Column(message.Type)
                .Column(message.Layer.Name)
                .Column(message.Layer.LayerRule)
                .Column(message.Zone)
                .Column(message.Position)
                .Column(message.TechnicalName)
                .Column(message.Duration.ToTimingString());
            }

            root.AddRow()
            .Column("")
            .Column("")
            .Column("")
            .Column("")
            .Column("")
            .Column("")
            .Column("Total time:")
            .Column(messages.Sum(m => m.Duration.TotalMilliseconds).ToTimingString())
            .Selected();

            return(root.Build());
        }
Example #18
0
        public override TabSection Create()
        {
            var services = (SitecoreService[])RequestData[DataKey.Services];

            if ((services == null) || (!services.Any()))
            {
                return(null);
            }

            var section = new TabSection("Controller", "Url", "ES", "Authorise", "CSRF Protection", "Definition", "Metadata");

            foreach (var service in services)
            {
                section.AddRow()
                .Column(service.Name)
                .Column(service.Url)
                .Column(service.IsEntityService ? "Yes" : "No")
                .Column(service.Authorise ? "Yes" : "No")
                .Column(service.CsrfProtection.ToString())
                .Column(service.Definition)
                .Column(service.Metadata)
                .WarnIf(service.CorsEnabled);
            }

            return(section);
        }
Example #19
0
        public override TabSection Create()
        {
            var section = new TabSection("", GetSectionHeader());

            var licenseSection = new LicenseSection(RequestData).Create();

            if (licenseSection != null)
            {
                section.AddRow().Column("License").Column(licenseSection);
            }

            var userListSection = new UserListSection(RequestData).Create();

            if (userListSection != null)
            {
                section.AddRow().Column("Current Users").Column(userListSection);
            }

            var servicesSection = new ServicesSection(RequestData).Create();

            if (servicesSection != null)
            {
                section.AddRow().Column("Sitecore Services").Column(servicesSection);
            }

            var controllersSection = new ControllersSection(RequestData).Create();

            if (controllersSection != null)
            {
                section.AddRow().Column("Controllers").Column(controllersSection);
            }

            return(section);
        }
Example #20
0
        private TabSection BuildProcessDetails(EnvironmentProcessModel model)
        {
            var section = new TabSection("Worker Process", "Process ID", "Start Time");

            section.AddRow().Column(model.WorkerProcess).Column(model.ProcessId).Column(model.StartTime);
            return(section);
        }
Example #21
0
        public void ThrowWhenSectionIsNull()
        {
            TabSection          section       = null;
            Action <TabSection> sectionAction = null;

            Assert.Throws <ArgumentNullException>(() => Plugin.Section("SectionName", section));
            Assert.Throws <ArgumentNullException>(() => Plugin.Section("SectionName", sectionAction));
        }
 public void Convert(TabSection section, OAEventLog eventLog)
 {
     section.AddRow()
     .Column(eventLog.DisplayName)
     .Column(this.GetMetricsValue(eventLog))
     .Column(BaseMetricsConverter.GetDurationMetricValue(eventLog))
     .Column(eventLog.Timestamp.ToString("HH:mm:ss.fff"));
 }
Example #23
0
        public void ThrowWhenSectionNameIsNullOrEmpty()
        {
            var validSection = new TabSection();
            Action <TabSection> validSectionAction = section => {};

            Assert.Throws <ArgumentException>(() => Plugin.Section(null, validSection));
            Assert.Throws <ArgumentException>(() => Plugin.Section("", validSection));

            Assert.Throws <ArgumentException>(() => Plugin.Section(null, validSectionAction));
            Assert.Throws <ArgumentException>(() => Plugin.Section("", validSectionAction));
        }
Example #24
0
        /// <summary>
        /// Converts the specified object.
        /// </summary>
        /// <param name="obj">The object to transform.</param>
        /// <returns>The new object representation.</returns>
        public override object Convert(IEnumerable <ITraceMessage> obj)
        {
            var root = new TabSection("Category", "Trace", "From Request Start", "From Last");

            foreach (var item in obj)
            {
                root.AddRow().Column(item.Category).Column(GenerateTabs(item)).Column(item.FromFirst).Column(item.FromLast).Style(item.Category);
            }

            return(root.Build());
        }
        public override object Convert(List <ConfigurationRoleManagerProviderSettingsModel> obj)
        {
            var root = new TabSection("Name", "Type", "Parameters");

            foreach (var item in obj)
            {
                root.AddRow().Column(item.Name).Column(item.Type).Column(item.Parameters);
            }

            return(root.Build());
        }
Example #26
0
        public override object Convert(List <RouteModel> routes)
        {
            var section = new TabSection("Area", "Name", "Url", "Data", "Constraints", "DataTokens", "Duration");

            foreach (var item in routes)
            {
                section.AddRow().Column(item.Area).Column(item.Name).Column(item.Url).Column(GetRouteData(item.RouteData)).Column(GetConstraintData(item.Constraints)).Column(GetDataTokens(item.DataTokens)).Column(item.Duration).SelectedIf(item.IsMatch);
            }

            return(section.Build());
        }
Example #27
0
        public override object Convert(List <SessionModel> obj)
        {
            var root = new TabSection("Key", "Value", "Type");

            foreach (var item in obj)
            {
                root.AddRow().Column(item.Key).Column(Serialization.GetValueSafe(item.Value)).Column(item.Type);
            }

            return(root.Build());
        }
Example #28
0
        private TabSection BuildAssemblyDetails(IEnumerable <EnvironmentAssemblyModel> model)
        {
            var modelList = new TabSection("Name", "Version", "Culture", "From GAC", "Full Trust");

            foreach (var assemblyModel in model)
            {
                modelList.AddRow().Column(assemblyModel.Name).Column(assemblyModel.Version).Column(assemblyModel.Culture).Column(assemblyModel.FromGac).Column(assemblyModel.FullTrust);
            }

            return(modelList);
        }
Example #29
0
        public override object Convert(List<ViewsModel> models)
        {
            var count = 0;

            var root = new TabSection("Ordinal", "Source Controller", "Requested View", "Master Override", "Partial", "View Engine", "Check Cache", "Found", "Details");
            foreach (var item in models)
            {
                root.AddRow().Column(count++).Column(item.SourceController).Column(item.ViewName).Column(item.MasterName).Column(item.IsPartial).Column(item.ViewEngineType).Column(item.UseCache).Column(item.IsFound).Column(GetDetails(item)).SelectedIf(item.IsFound);
            }
             
            return root.Build();
        }
        public override object GetData(ITabContext context)
        {
            TabSection result = Plugin.Create(Constants.MetricsKey, Constants.MetricsValue, Constants.MetricsDuration, Constants.MetricsTimestamp);

            foreach (OAEventLog eventLog in OAGlimpseTraceListener.GetList())
            {
                MetricsConverterFactory
                .GetConverter(eventLog.Type)
                .Convert(result, eventLog);
            }

            return(result);
        }