Example #1
0
        public async Task <ActionResult> UpdateWorker(int id)
        {
            var pools = await PoolReader.GetPools();

            var worker = await PoolWorkerReader.AdminGetWorker(User.Identity.GetUserId(), id);

            var poolconnection = await PoolReader.GetPoolConnection(worker.AlgoType);

            return(View("UpdateWorkerModal", new AdminPoolWorkerUpdateModel
            {
                Id = id,
                Name = worker.Name,
                AlgoType = worker.AlgoType,
                IsAutoSwitch = worker.IsAutoSwitch,
                Password = worker.Password,
                TargetDifficulty = worker.TargetDifficulty,
                DefaultDiff = poolconnection.DefaultDiff,
                FixedDiffSummary = poolconnection.FixedDiffSummary,
                VarDiffHighSummary = poolconnection.VarDiffHighSummary,
                VarDiffLowSummary = poolconnection.VarDiffLowSummary,
                VarDiffMediumSummary = poolconnection.VarDiffMediumSummary,
                DifficultyOption = PoolExtensions.TargetDifficultyToOption(worker.TargetDifficulty),
                TargetPool = worker.TargetPool,
                Pools = pools.Where(x => x.AlgoType == worker.AlgoType).OrderBy(x => x.Symbol).ToList()
            }));
        }