示例#1
0
        //
        // GET: /Status/
        public ActionResult Index()
        {
            var model = new StatusViewModel();

            if (Connections.Current.HasTASConnection)
            {
                model.AddDiskInfo(Connections.Current.TAS.GetAllRecordingDiskInformation());
                model.AddDiskInfo(Connections.Current.TAS.GetLocalDiskInformation());
                model.SetCardList(Connections.Current.TAS.GetCards(), Connections.Current.TAS.GetActiveCards());
            }

            if (Connections.Current.HasMASConnection)
            {
                model.AddDiskInfo(Connections.Current.MAS.GetLocalDiskInformation());
            }

            try
            {
                model.CpuUsage = (int)Math.Round(cpuCounter.NextValue());
                model.TotalMemoryMegaBytes = totalMemory;
                model.UsedMemoryMegaBytes = (int)Math.Round(totalMemory - memoryCounter.NextValue());
                model.HasSystemInformation = true;
            }
            catch (UnauthorizedAccessException)
            {
                Log.Info("Failed to read performance counters, got UnauthorizedAccessException");
                model.HasSystemInformation = false;
            }
            catch (Exception ex)
            {
                Log.Info("Failed to read performance counters", ex);
                model.HasSystemInformation = false;
            }

            return View(model);
        }
示例#2
0
        //
        // GET: /Status/
        public ActionResult Index()
        {
            var model = new StatusViewModel();

            if (Connections.Current.HasTASConnection)
            {
                model.AddDiskInfo(Connections.Current.TAS.GetAllRecordingDiskInformation());
                model.AddDiskInfo(Connections.Current.TAS.GetLocalDiskInformation());
                model.SetCardList(Connections.Current.TAS.GetCards(), Connections.Current.TAS.GetActiveCards());
            }

            if (Connections.Current.HasMASConnection)
            {
                model.AddDiskInfo(Connections.Current.MAS.GetLocalDiskInformation());
            }

            return View(model);
        }