public HtmlActionResult <TagMessagesCollection> MessageView(string host, string tag)
        {
            IStateQuery           syslogState   = base.GetSyslogState();
            TagMessagesCollection msgCollection = syslogState.GetTagMessages(host, tag);

            msgCollection.Messages.Sort((x, y) => y.Timestamp.CompareTo(x.Timestamp));
            return(new HtmlActionResult <TagMessagesCollection>(Path.Combine(base.GetViewDirectory(), "Messages.cshtml"), msgCollection));
        }
        public HtmlActionResult <SearchModel> Search([FromUri] SearchQuery search)
        {
            IStateQuery           syslogState   = base.GetSyslogState();
            TagMessagesCollection msgCollection = syslogState.GetTagMessages(search.Host, search.Tag);

            //msgCollection.Messages.Sort((x, y) => y.Timestamp.CompareTo(x.Timestamp));
            //TODO: This is stable sort but not in-place => possible memory pressure
            msgCollection.Messages = msgCollection.Messages.OrderByDescending(x => x.Timestamp).ToList();
            SearchModel searchModel = FilterUtility.ApplyFilters(search, msgCollection);

            return(new HtmlActionResult <SearchModel>(Path.Combine(base.GetViewDirectory(), "Search.cshtml"), searchModel));
        }
Example #3
0
        public TagMessagesCollection Messages(string host, string tag)
        {
            IStateQuery syslogState = base.GetSyslogState();

            return(syslogState.GetTagMessages(host, tag));
        }