示例#1
0
        public IActionResult Index(string monitoredPathName, string branchName, int days, DateTime startDateTime, DateTime endDateTime, string sha)
        {
            this.ViewData["MPName"] = monitoredPathName;
            this.localMonitoredPathConfig.Value.Search = null;
            if (!string.IsNullOrEmpty(sha))
            {
                GitSearch search = new GitSearch();
                if (!string.IsNullOrEmpty(sha))
                {
                    search.Sha     = sha;
                    search.Commits = this.localRepository.SearchForCommit(this.localMonitoredPathConfig.Value, "*", sha);
                }

                MonitoredPathConfig mpc = this.localMonitoredPathConfig.Value;
                mpc.Search = search;
                return(this.View(mpc));
            }

            if (startDateTime == DateTime.MinValue)
            {
                this.ViewData["MPDays"] = days;
                var results = this.localRepository.Get(this.localMonitoredPathConfig.Value, monitoredPathName, branchName, days);
                return(this.View(results));
            }
            else
            {
                this.ViewData["StartDateTime"] = startDateTime.ToString("yyyy-MM-dd");
                this.ViewData["EndDateTime"]   = endDateTime.ToString("yyyy-MM-dd");

                var results = this.localRepository.Get(this.localMonitoredPathConfig.Value, monitoredPathName, branchName, startDateTime, endDateTime);
                return(this.View(results));
            }
        }
示例#2
0
        public JsonResult GetBranches(string repositoryName, string sha, string filter)
        {
            GitSearch search = new GitSearch
            {
                Sha      = sha,
                Branches = this.localRepository.SearchBranchesForCommit(this.localMonitoredPathConfig.Value, repositoryName, sha, filter)
            };

            return(this.Json(search));
        }
示例#3
0
        public JsonResult Get(string monitoredPathName, string sha)
        {
            GitSearch search = new GitSearch
            {
                Sha     = sha,
                Commits = this.localRepository.SearchForCommit(this.localMonitoredPathConfig.Value, monitoredPathName, sha)
            };

            return(this.Json(search));
        }
示例#4
0
        public JsonResult GetCommmit(string sha)
        {
            GitSearch search = new GitSearch();

            if (!string.IsNullOrEmpty(sha))
            {
                search.Sha     = sha;
                search.Commits = this.localRepository.SearchForCommit(this.localMonitoredPathConfig.Value, "*", sha);
            }

            // MonitoredPathConfig mpc = this.localMonitoredPathConfig.Value;
            // mpc.Search = search;
            return(this.Json(search));
        }