public HtmlString UpdateTree([FromBody] List <SensorData> sensors)
        {
            var user     = HttpContext.User as User;
            var oldModel = _treeManager.GetTreeViewModel(user);
            var model    = oldModel.Update(sensors);

            return(ViewHelper.CreateTree(model));
        }
        public IActionResult Index()
        {
            var user = HttpContext.User as User ?? _userManager.GetUserByUserName(HttpContext.User.Identity?.Name);
            var tree = _treeManager.GetTreeViewModel(user);

            if (tree == null)
            {
                var result = _sensorsInterface.GetSensorsTree(user);
                tree = new TreeViewModel(result);
                _treeManager.AddOrCreate(user, tree);
            }

            return(View(tree));
        }