Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            setNotification("");

            (Page.Master.FindControl("linkMainMenuDetails") as HyperLink).CssClass  = "nav-text btn active";
            (Page.Master.FindControl("linkMainMenuOverview") as HyperLink).CssClass = "nav-text btn";
            (Page.Master.FindControl("linkMainMenuReports") as HyperLink).CssClass  = "nav-text btn";

            if (Session["MySession"] == null)
            {
                Session["MySession"] = new CachedDashboardObjects();
            }

            _cache = (CachedDashboardObjects)Session["MySession"];

            try
            {
                TaggedExtractorConfigArrays tecas     = _cache.getConfigs();
                ExtractorConfigurationTO[]  active    = getConfigByKey("Active", tecas);
                ExtractorConfigurationTO[]  queued    = getConfigByKey("Queued", tecas);
                ExtractorConfigurationTO[]  completed = getConfigByKey("Completed", tecas);
                ExtractorConfigurationTO[]  errored   = getConfigByKey("Errored", tecas);

                Dictionary <String, EtlDownstreamStageTO> stageBySite = _cache.getEtlStages();

                labelRunningCount.Text = active.Length.ToString();
                labelFailureCount.Text = errored.Length.ToString();

                bindRepeater(getBindableTable(tecas, stageBySite));
            }
            catch (Exception exc)
            {
                ((Label)Page.Master.FindControl("labelNotifications")).Text = exc.Message;
            }
        }
Пример #2
0
        private void downloadLog(string siteId, string vistaFile, string batchId)
        {
            try
            {
                ReportTO report = new CachedDashboardObjects().getReport(siteId, vistaFile, batchId);

                Response.ContentType = "text/html";
                Response.AddHeader("Content-Disposition", "attachment; filename=\"log.txt\"");
                Response.AddHeader("Content-Length", report.text.Length.ToString());
                Response.Write(report.text);
                Response.Flush();
                Response.Close();
                Response.End();
            }
            catch (Exception exc)
            {
                setNotification(exc.Message);
            }
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            setNotification("");

            (Page.Master.FindControl("linkMainMenuOverview") as HyperLink).CssClass = "nav-text btn active";
            (Page.Master.FindControl("linkMainMenuDetails") as HyperLink).CssClass  = "nav-text btn";
            (Page.Master.FindControl("linkMainMenuReports") as HyperLink).CssClass  = "nav-text btn";

            if (Request.QueryString != null && Request.QueryString.Count > 0)
            {
                if (Request.QueryString.ToString().Contains("getLog"))
                {
                    if (!String.IsNullOrEmpty(Request.QueryString["site"]) &&
                        !String.IsNullOrEmpty(Request.QueryString["vistaFile"]) &&
                        !String.IsNullOrEmpty(Request.QueryString["batchId"]))
                    {
                        downloadLog(Request.QueryString["site"], Request.QueryString["vistaFile"], Request.QueryString["batchId"]);
                        return;
                    }
                }
            }

            if (Session["MySession"] == null)
            {
                Session["MySession"] = new CachedDashboardObjects();
            }

            _cache = (CachedDashboardObjects)Session["MySession"];

            try
            {
                labelNextRunTime.Text      = _cache.getTimeToNextRun();
                labelLastRunCompleted.Text = _cache.getLastRunCompletedTime();

                TaggedExtractorConfigArrays tecas     = _cache.getConfigs();
                ExtractorConfigurationTO[]  active    = getConfigByKey("Active", tecas);
                ExtractorConfigurationTO[]  queued    = getConfigByKey("Queued", tecas);
                ExtractorConfigurationTO[]  completed = getConfigByKey("Completed", tecas);
                ExtractorConfigurationTO[]  errored   = getConfigByKey("Errored", tecas);

                if (active.Length == 0 && queued.Length == 0 && completed.Length == 0 && errored.Length == 0)
                {
                    setNotification("Downstream is between runs. Please see the next/last run time for information regarding upcoming extraction schedules");
                    return;
                }

                Dictionary <String, EtlDownstreamStageTO> stages = _cache.getEtlStages();

                labelActiveExtractionsCount.Text    = active.Length.ToString();
                labelQueuedExtractionsCount.Text    = queued.Length.ToString();
                labelCompletedExtractionsCount.Text = completed.Length.ToString();
                labelFailedExtractionsCount.Text    = errored.Length.ToString();

                labelActiveEtlCount.Text    = getEtlCount(stages, "Active");
                labelCompletedEtlCount.Text = getEtlCount(stages, "Completed");
                labelFailedEtlCount.Text    = getEtlCount(stages, "Errored");

                bindFailedExtractionsDataGrid(errored.ToList());
                bindCompletedExtractionsDataGrid(completed.ToList());
                bindInProgressExtractionsDataGrid(active.ToList());
                bindPrioritizedRepeater();
            }
            catch (Exception exc)
            {
                setNotification(exc.Message);
            }
        }