Пример #1
0
        public ActionResult GetServerInformation()
        {
            var ramInfo = Service.GetRam();

            var model = new ServerInformationViewModel();

            model.InjectFromJson <ServerInformationViewModel>(ramInfo);
            model.CpuPercentage   = Service.GetCpuPercentage();
            model.AvailableMemory = Service.GetAvailableRam();
            model.Uptime          = Service.GetUpTime();

            return(PartialView("Partial/_ServerInformation", model));
        }
Пример #2
0
        public ActionResult VersionInformation()
        {
            var viewModel = new VersionViewModel(typeof(MvcApplication).Assembly);

            try
            {
                var amiServerInformation  = new ServerInformationViewModel(this.amiServerInformationService.GetServerInformation(), amiServerInformationService.Name);
                var imsiServerInformation = new ServerInformationViewModel(this.imsiServerInformationService.GetServerInformation(), imsiServerInformationService.Name);

                viewModel.ServerInformation.Add(amiServerInformation);
                viewModel.ServerInformation.Add(imsiServerInformation);

                viewModel.Assemblies.AddRange(AppDomain.CurrentDomain.GetAssemblies().Select(a => new AssemblyInfoViewModel(a)).Where(a => a.Title != null).OrderBy(a => a.Title));
            }
            catch (Exception e)
            {
                Trace.TraceError($"Unable to retrieve version information: {e}");
            }

            return(View(viewModel));
        }