Пример #1
0
        public IHttpActionResult Get()
        {
            var items = _taskRepository.List();

            var tasks = new List <TaskApiModel>();

            foreach (var task in items)
            {
                var queued = _queueRepository.List().Where(x => x.Task.Id == task.Id).Count();

                tasks.Add(new TaskApiModel()
                {
                    Id             = task.Id,
                    Title          = task.Title,
                    Enabled        = task.Enabled,
                    LastRunTime    = task.LastRunTime,
                    LastRunResult  = task.LastRunResult,
                    LastRunDetails = task.LastRunDetails,
                    Active         = task.Active,
                    Queued         = queued
                });
            }

            return(Ok(tasks));
        }
Пример #2
0
        // GET: api/Queue
        public IHttpActionResult Get()
        {
            var items = queueRepository.List();

            List <QueueViewModel> queueItems = new List <QueueViewModel>();

            foreach (var item in items)
            {
                queueItems.Add(new QueueViewModel()
                {
                    Id         = item.Id,
                    Key        = item.Key,
                    Title      = item.Task.Title,
                    SysCreated = item.SysCreated,
                    TryCount   = item.TryCount
                });
            }

            return(Ok(queueItems));
        }
Пример #3
0
        // GET: Queue
        public ActionResult Index()
        {
            var items = queueRepository.List();

            return(View(items));
        }