src/Stratis.FederatedSidechains.AdminDashboard/Controllers/HomeController.cs
/// <summary>
/// This is the Index action that return the dashboard if the local cache is built otherwise the initialization page is displayed
/// </summary>
This is the Index action that return the dashboard if the local cache is built otherwise the initialization page is displayed
This is the Index action that return the dashboard if the local cache is built otherwise the initialization page is displayed
public IActionResult Index()
        {
            if (string.IsNullOrEmpty(this.distributedCache.GetString("DashboardData")))
            {
                var nodeUnavailable = !string.IsNullOrEmpty(this.distributedCache.GetString("NodeUnavailable"));
                this.ViewBag.NodeUnavailable = nodeUnavailable;
                this.ViewBag.Status = nodeUnavailable ? "API Unavailable" : "Initialization...";
                return View("Initialization");
            }
            var dashboardModel = JsonConvert.DeserializeObject<DashboardModel>(this.distributedCache.GetString("DashboardData"));
            this.ViewBag.DisplayLoader = true;
            this.ViewBag.History = new[] {
                dashboardModel.StratisNode.History,
                dashboardModel.SidechainNode.History
            };
            this.ViewBag.StratisTicker = dashboardModel.StratisNode.CoinTicker;
            this.ViewBag.SidechainTicker= dashboardModel.SidechainNode.CoinTicker;
            this.ViewBag.MainchainMultisigAddress = dashboardModel.MainchainWalletAddress;
            this.ViewBag.SidechainMultisigAddress = dashboardModel.SidechainWalletAddress;
            this.ViewBag.MiningPubKeys = dashboardModel.MiningPublicKeys;
            this.ViewBag.Status = "OK";
            return View("Dashboard", dashboardModel);
        }
public IActionResult Index ( ) { if ( string . IsNullOrEmpty ( this . distributedCache . GetString ( " " ) ) ) { var nodeUnavailable = ! string . IsNullOrEmpty ( this . distributedCache . GetString ( " " ) ) ; this . ViewBag . NodeUnavailable = nodeUnavailable ; this . ViewBag . Status = nodeUnavailable ? " " : " " ; return View ( " " ) ; } var dashboardModel = JsonConvert . DeserializeObject < DashboardModel > ( this . distributedCache . GetString ( " " ) ) ; this . ViewBag . DisplayLoader = true ; this . ViewBag . History = new [ ] { dashboardModel . StratisNode . History , dashboardModel . SidechainNode . History } ; this . ViewBag . StratisTicker = dashboardModel . StratisNode . CoinTicker ; this . ViewBag . SidechainTicker = dashboardModel . SidechainNode . CoinTicker ; this . ViewBag . MainchainMultisigAddress = dashboardModel . MainchainWalletAddress ; this . ViewBag . SidechainMultisigAddress = dashboardModel . SidechainWalletAddress ; this . ViewBag . MiningPubKeys = dashboardModel . MiningPublicKeys ; this . ViewBag . Status = " " ; return View ( " " , dashboardModel ) ; }
This is the Index action that return the dashboard if the local cache is built otherwise the initialization page is displayed
This is the Index action that return the dashboard if the local cache is built otherwise the initialization page is displayed