Ejemplo n.º 1
0
        public ActionResult Index()
        {
            var role       = GetCurrentUserRole();
            var data       = new ServerIndexViewModel();
            var customer   = GetCurrentUserName();
            var listStatus = StatusBLO.Current.GetStatusByObject(Constants.Object.OBJECT_SERVER).OrderBy(x => x.Priority).ToList();

            listStatus.RemoveAt(0);
            data.ServerStatus = listStatus
                                .Select(x => new SelectListItem {
                Value = x.StatusCode, Text = x.StatusName
            })
                                .ToList();
            if (role == Constants.Role.CUSTOMER)
            {
                var servers = ServerBLO.Current.GetServerOfCustomer(customer);
                data.Servers = servers;
            }
            else
            {
                //get all servers
                var servers = ServerBLO.Current.GetAllServer();
                foreach (var item in servers)
                {
                    item.Requests = RequestBLO.Current.GetWaitingRequestOfServer(item.ServerCode);
                }
                data.Servers = servers;
            }
            return(View(data));
        }
Ejemplo n.º 2
0
        public IActionResult Index()
        {
            var viewmodel = new ServerIndexViewModel();

            viewmodel.ServerProperties   = _serverPropertiesReader.Read();
            viewmodel.WhitelistedPlayers = _whitelistReader.Read();
            viewmodel.Operators          = _opsReader.Read();
            return(View(viewmodel));
        }
Ejemplo n.º 3
0
        // GET: Server
        public async Task <IActionResult> Index()
        {
            ServerIndexViewModel model = new ServerIndexViewModel()
            {
                Servers     = await _context.Servers.Include(server => server.Channels).ToListAsync(),
                RunningBots = _runningBots
            };

            return(View(model));
        }