Inheritance: System.Web.Services.Protocols.SoapHttpClientProtocol
コード例 #1
0
ファイル: BuildsController.cs プロジェクト: mono/mvcwrench
        // GET: /Builds/msvc/{buildrevisionid}
        public ActionResult BuildStatus(string buildrevisionid)
        {
            // Build the build step list model
            BuildStepList list = new BuildStepList ();

            MonkeyWrench.Public.Public ws2 = new MvcWrench.MonkeyWrench.Public.Public ();
            var steps = ws2.GetCompletedSteps (long.Parse (buildrevisionid));

            foreach (CompletedBuildStep step in steps) {
                BuildStepListItem item = new BuildStepListItem (step.Id, TimeSpan.Zero, step.ExitCode, step.CompletionStatus, step.StepName);
                item.LogUrl = string.Format ("~/builds/msvc/{0}/{1}", buildrevisionid, step.Id);

                list.Items.Add (item);
            }

            //// Build the bread crumb bar model
            //BreadCrumb bc = new BreadCrumb ();

            //bc.Crumbs.Add (new Crumb ("Projects", UrlBuilder.Builds));
            //bc.Crumbs.Add (new Crumb (p.Name, UrlBuilder.ProductBuild (p)));
            //bc.Crumbs.Add (new Crumb (string.Format ("Revision {0}", pr.Revision), UrlBuilder.RevisionDetails (pr)));
            //bc.Crumbs.Add (new Crumb (plat.Name));

            //ViewData["Platform"] = platform;
            //ViewData["BreadCrumb"] = bc;
            ViewData["BuildStepList"] = list;
            //ViewData["Installer"] = installer;
            ViewData["PageTitle"] = "MonkeyWrench - Msvc Build Overview";

            return View ("BuildStatus");
        }
コード例 #2
0
ファイル: BuildsController.cs プロジェクト: mono/mvcwrench
        // GET: /Builds/{product}/{revision}/{platform}/log/{id}
        public ActionResult BuildStatusLog(string buildrevisionid, string completedstepid)
        {
            MonkeyWrench.Public.Public ws2 = new MvcWrench.MonkeyWrench.Public.Public ();
            string log = ws2.GetBuildLog (int.Parse (completedstepid));

            ViewData["PageTitle"] = "MonkeyWrench - View Log";
            ViewData["Log"] = log;
            return View ("BuildStatusLog");//, log);
        }
コード例 #3
0
ファイル: HomeController.cs プロジェクト: mono/mvcwrench
        public ActionResult Index()
        {
            List<BugzillaEntry> bugs;

            try {
                bugs = (List<BugzillaEntry>)Cache.Instance.Get ("buglist");

                if (bugs == null) {
                    bugs = BugzillaInterface.GetLatestBugs ();
                    //bugs = new List<BugzillaEntry> ();
                    Cache.Instance.Add ("buglist", bugs, 3 * 60);
                }
            } catch (Exception ex) {
                bugs = new List<BugzillaEntry> ();
                //throw;
            }

            Revision[] recent_revisions = (Revision[])Cache.Instance.Get ("recent_revisions");

            if (recent_revisions == null) {
                try {
                    MonkeyWrench.Public.Public ws = new MvcWrench.MonkeyWrench.Public.Public ();
                    recent_revisions = ws.GetProductLatestRevisions (1, 20);
                    Cache.Instance.Add ("recent_revisions", recent_revisions, 5 * 60);
                } catch (Exception) {
                    recent_revisions = new Revision[0];
                }
            }

            string bugcounts = (string)Cache.Instance.Get ("bugcounts");

            if (bugcounts == null) {
                try {
                    MonkeyWrench.Public.Public ws = new MvcWrench.MonkeyWrench.Public.Public ();
                    string[] counts = ws.GetLatestBugCounts (60);

                    StringBuilder sb = new StringBuilder ();

                    foreach (string item in counts)
                        sb.AppendFormat ("{0},", (int)(int.Parse (item.Split (',')[0]) / 25f));

                    sb.Remove (sb.Length - 1, 1);
                    sb.Append ("|");

                    foreach (string item in counts)
                        sb.AppendFormat ("{0},", (int)(int.Parse(item.Split (',')[1]) / 25f));

                    sb.Remove (sb.Length - 1, 1);

                    bugcounts = sb.ToString ();

                    Cache.Instance.Add ("bugcounts", bugcounts, 60 * 60);
                } catch (Exception) {
                    bugcounts = null;
                }
            }

            ViewData["Revisions"] = recent_revisions;
            ViewData["BugCounts"] = bugcounts;

            return View ("Home", bugs);
        }
コード例 #4
0
ファイル: BuildsController.cs プロジェクト: mono/mvcwrench
        public ActionResult RevisionDiff(string project, string revision)
        {
            MonkeyWrench.Public.Public ws2 = new Public ();
            Revision r = ws2.GetRevisionByRevision (int.Parse (revision));

            ViewData["PageTitle"] = string.Format ("MonkeyWrench - Revision {0}", revision);

            if (r == null || string.IsNullOrEmpty (r.FileDiff))
                ViewData["Diff"] = "Diff not available";
            else {
                try {
                    ViewData["Diff"] = new DiffViewer (r.FileDiff);
                } catch {
                    ViewData["Diff"] = r.FileDiff;
                }
            }

            return View ("RevisionDiff", r);

            //int revision_id;

            //WebServices ws = new WebServices ();
            //WebServiceLogin login = new WebServiceLogin ();

            //var rev = ws.FindRevision (login, null, revision);
            //revision_id = rev.Revision.id;

            //string log;
            //string diff;

            //// Download the commit log to add
            //string url = string.Format ("http://build.mono-project.com/GetRevisionLog.aspx?id={0}", revision_id);

            //WebClient wc = new WebClient ();
            //string content = wc.DownloadString (url);

            //Regex reg = new Regex (@"\<pre\ id\=\""ctl00_content_log\""\>(?<data>(?:.|\n)*?)\<\/pre\>", RegexOptions.Multiline);
            //Match m = reg.Match (content);
            //log = m.Groups["data"].Value.Trim ();

            //reg = new Regex (@"\<pre\ id\=\""ctl00_content_diff\""\>(?<data>(?:.|\n)*?)\<\/pre\>", RegexOptions.Multiline);
            //m = reg.Match (content);
            //diff = m.Groups["data"].Value.Trim ();

            //Revision r = new Revision ();

            //r.Author = rev.Revision.author;
            //r.SvnLog = System.Web.HttpUtility.HtmlDecode (log);
            //r.RevisionNumber = int.Parse (revision);
            //r.Time = rev.Revision.date;

            //ViewData["PageTitle"] = string.Format ("MonkeyWrench - Revision {0}", r.RevisionNumber);

            //if (string.IsNullOrEmpty (diff))
            //        ViewData["Diff"] = "Diff not available";
            //else {
            //        try {
            //                ViewData["Diff"] = new DiffViewer (System.Web.HttpUtility.HtmlDecode (diff));
            //        } catch {
            //                ViewData["Diff"] = System.Web.HttpUtility.HtmlDecode (diff);
            //        }
            //}

            //return View ("RevisionDiff", r);
        }