public async Task <IActionResult> Index()
        {
            var boardDto = await _boardService.GetBoardAsync();

            var boardViewModel = _mapper.Map <BoardViewModel>(boardDto);
            var categoriesModeratorsDtoList = await _categoryToModeratorService.ListCategoriesModeratorsAsync();

            var categoriesModeratorsViewModelList = new List <CategoryModeratorsViewModel>();

            foreach (var dtoPair in categoriesModeratorsDtoList)
            {
                categoriesModeratorsViewModelList.Add(new CategoryModeratorsViewModel
                {
                    Category   = _mapper.Map <CategoryDetailsViewModel>(dtoPair.Key),
                    Moderators = _mapper.Map <List <ApplicationUserViewModel> >(dtoPair.Value),
                });
            }
            var systemInfo          = _systemInfoService.GetSystemInfo();
            var systemInfoViewModel = _mapper.Map <SystemInfoViewModel>(systemInfo);
            var dashboardViewModel  = new DashboardViewModel
            {
                Board = boardViewModel,
                CategoriesModerators = categoriesModeratorsViewModelList,
                SystemInfo           = systemInfoViewModel,
            };

            return(View(dashboardViewModel));
        }
Example #2
0
        private void btnConnect_Click(object sender, EventArgs e)
        {
            try
            {
                if (String.IsNullOrWhiteSpace(this.txtCompName.Text))
                {
                    MessageBox.Show("Please enter a computer name or IP.", "No system!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    this.Cursor = Cursors.WaitCursor;

                    ClearAllTabControls();
                    InitializeConnection();

                    _sysInfo = new SystemInfoService(_sysConnector.Scope, _sysConnector.Options);
                    var sysInfo = _sysInfo.GetSystemInfo().FirstOrDefault();

                    SetGenericSystemInfo(sysInfo);
                    SetMemoryInfo(sysInfo);
                    SetDiskInfo(sysInfo);
                    SetComputerSystemInfo(sysInfo);

                    this.Cursor = Cursors.Default;
                }
            }
            catch (Exception ex)
            {
                var message = new MessageWindow("Error", ex);
                message.ShowDialog();
                this.Cursor = Cursors.Default;
            }
        }
Example #3
0
        public static IEnumerable <SystemInfoViewModel> GetSystemInfo()
        {
            IEnumerable <SystemInfoViewModel> systemInfo = null;
            ISystemInfoService _sysInfoService           = DependencyResolver.Current.GetService <ISystemInfoService>();

            //var user = GetCurrentUserAsync();
            systemInfo = _sysInfoService.GetSystemInfo(userId: "", showAll: 1);
            return(systemInfo);
        }
        protected override async Task InitializeAsync()
        {
            await base.InitializeAsync();

            IsBusy = true;

            var systemInfo = await TaskHelper.Run(() => _systemInfoService.GetSystemInfo(), true);

            var systemInfoLines = systemInfo.Select(x => string.Format("{0} {1}", x.Name, x.Value));

            SystemInfo = string.Join("\n", systemInfoLines);

            IsBusy = false;
        }
Example #5
0
        protected override async Task InitializeAsync()
        {
            await base.InitializeAsync();

            var items = new List <KeyValuePair <string, string> >();

            var systemInfo = await TaskHelper.Run(() => _systemInfoService.GetSystemInfo(), true);

            foreach (var item in systemInfo)
            {
                items.Add(new KeyValuePair <string, string>(item.Name, item.Value));
            }

            SystemInfo = items;
            IsSystemInformationLoaded = true;
        }
        public List <DataTable> GetSystemInfo()
        {
            List <DataTable> dtList = new List <DataTable>();
            DataTable        dtTemp = new DataTable();

            _sysInfo = new SystemInfoService(_scope, _options);
            var sysInfo = _sysInfo.GetSystemInfo().FirstOrDefault();

            dtList.Add(ExtensionMethods.ConvertToDataTable(sysInfo, "System Info"));
            dtList[0].Columns.Remove("Disks");
            dtList[0].Columns.Remove("Drives");
            dtList[0].Columns.Remove("CompSystem");
            dtList.Add(CreateExcelFile.ListToDataTable(sysInfo.Disks, "Disks"));
            dtList.Add(CreateExcelFile.ListToDataTable(sysInfo.CompSystem, "Computer System"));

            return(dtList);
        }
        protected override async Task InitializeAsync()
        {
            await base.InitializeAsync();

            IsBusy = true;

            try
            {
                var systemInfo = await TaskHelper.Run(() => _systemInfoService.GetSystemInfo(), true);

                var systemInfoLines = systemInfo.Select(x => string.Format("{0} {1}", x.Name, x.Value));
                SystemInfo = string.Join("\n", systemInfoLines);
            }
            catch (Exception ex)
            {
                Log.Error(ex, "Failed to get system info");
            }

            IsBusy = false;
        }
Example #8
0
 private void btnGetDisks_Click(object sender, EventArgs e)
 {
     try
     {
         if (_sysConnector == null)
         {
             ShowConnectionErrorMessage();
         }
         else
         {
             var sysInfo = _sysInfo.GetSystemInfo().FirstOrDefault();
             listDrives.DataSource    = new BindingList <DriveInfo>(sysInfo.Drives);
             listDrives.DisplayMember = "Model";
             listDrives.ValueMember   = "DeviceId";
         }
     }
     catch (Exception ex)
     {
         var message = new MessageWindow("Error", ex);
         message.ShowDialog();
     }
 }
Example #9
0
        public ActionResult Index()
        {
            dynamic info = JsonConvert.DeserializeObject <object>(_service.GetSystemInfo().Result);

            return(View(model: info));
        }
        public DataTable GetDrivesInfo()
        {
            var sysInfo = _sysInfo.GetSystemInfo().FirstOrDefault();

            return(CreateExcelFile.ListToDataTable(sysInfo.Drives, "Drives"));
        }