MainLayout.razor 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. @inherits LayoutComponentBase
  2. @using Console = HyperCube.Utils.AdvConsole;
  3. <div class="page">
  4. <div class="sidebar">
  5. <NavMenu />
  6. </div>
  7. <div class="main">
  8. <div class="top-row px-4 auth">
  9. @if (connected)
  10. {
  11. <span class="dot-green"></span>
  12. }
  13. else
  14. {
  15. <span class="dot-red"></span>
  16. }
  17. <EditForm Model="Networks">
  18. <InputSelect @bind-Value="Networks" class="custom-select">
  19. @foreach (var value in Networks)
  20. {
  21. <option>@value</option>
  22. }
  23. </InputSelect>
  24. </EditForm>
  25. <a class="navbar-brand" href="">Правовая информация</a>
  26. <a class="navbar-brand" href="">Контакты</a>
  27. <LoginDisplay />
  28. </div>
  29. <div class="content px-4">
  30. @Body
  31. </div>
  32. </div>
  33. </div>
  34. @using HyperCube.Models;
  35. @code {
  36. List<string> Networks = new();
  37. bool connected = false;
  38. protected override async Task OnInitializedAsync()
  39. {
  40. try
  41. {
  42. await Blockchain.GetInstance().Initialize();
  43. if (Blockchain.Connected != "" && Blockchain.Connected != "none")
  44. {
  45. connected = true;
  46. Networks.Add(Blockchain.Connected);
  47. }
  48. else
  49. {
  50. connected = false;
  51. Networks.Add("Blockchain not connected");
  52. }
  53. }
  54. catch (Exception e)
  55. {
  56. Console.WriteLine(e.Message + ", stack trace:" + e.StackTrace);
  57. }
  58. }
  59. }