Example #1
0
        public async Task <ActionResult> GetMiners()
        {
            var connections = await PoolReader.GetPoolConnections();

            return(PartialView("_Miners", new Cryptopia.Common.Mineshaft.MinersModel
            {
                Connections = connections
            }));
        }
Example #2
0
        public async Task <ActionResult> CreateWorker()
        {
            var connections = await PoolReader.GetPoolConnections();

            return(View("CreateWorkerModal", new PoolWorkerCreateModel
            {
                AlgoTypes = connections.Select(x => x.AlgoType).Distinct().ToList(),
                Connections = connections
            }));
        }
Example #3
0
        public async Task <ActionResult> CreateWorker(PoolWorkerCreateModel model)
        {
            if (!ModelState.IsValid)
            {
                var connections = await PoolReader.GetPoolConnections();

                model.AlgoTypes   = connections.Select(x => x.AlgoType).Distinct().ToList();
                model.Connections = connections;
                return(View("CreateWorkerModal", model));
            }

            model.FullName         = string.Format("{0}.{1}", User.Identity.Name, model.Name);
            model.TargetDifficulty = PoolExtensions.OptionToTargetDifficulty(model.DifficultyOption, model.TargetDifficulty);
            var result = await PoolWorkerWriter.CreateWorker(User.Identity.GetUserId(), model);

            if (!ModelState.IsWriterResultValid(result))
            {
                return(View("CreateWorkerModal", model));
            }

            return(CloseModal(result));
        }
 public async Task <ActionResult> GetConnections(DataTablesModel model)
 {
     return(DataTable(await PoolReader.GetPoolConnections(model)));
 }