Wallet.razor 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. @page "/wallet"
  2. @using Microsoft.AspNetCore.Identity;
  3. @inject AuthenticationStateProvider AuthenticationStateProvider
  4. @inject UserManager<IdentityUser> UserManager;
  5. @attribute [Authorize]
  6. @code
  7. {
  8. bool adm = false;
  9. bool init = false;
  10. bool ver = false;
  11. bool req = false;
  12. bool admin { get { return adm; }
  13. set { adm = value;
  14. if (!account.roles.Contains(Models.Role.Admin))
  15. account.roles.Add(Models.Role.Admin);
  16. else
  17. account.roles.Remove(Models.Role.Admin);
  18. }
  19. }
  20. bool initiator { get { return init; } set { init = value;
  21. if (!account.roles.Contains(Models.Role.Initiator))
  22. account.roles.Add(Models.Role.Initiator);
  23. else
  24. account.roles.Remove(Models.Role.Initiator);
  25. } }
  26. bool verifier { get { return ver; } set { ver = value;
  27. if (!account.roles.Contains(Models.Role.Verifier))
  28. account.roles.Add(Models.Role.Verifier);
  29. else
  30. account.roles.Remove(Models.Role.Verifier);
  31. } }
  32. bool requester { get { return req; } set { req = value;
  33. if (!account.roles.Contains(Models.Role.Requester))
  34. account.roles.Add(Models.Role.Requester);
  35. else
  36. account.roles.Remove(Models.Role.Requester);
  37. } }
  38. }
  39. <div class="tabs__content">
  40. <div class="tabs__controls">
  41. <a href="DocEdit" class="tabs__btn">Загрузка материалов</a>
  42. <a href="Verifying" class="tabs__btn">Верификация</a>
  43. <a class="tabs__btn">Библиотеки</a>
  44. <a class="tabs__btn">Заказы</a>
  45. </div>
  46. <div class="upload">
  47. <h2 class="upload__title">Кошелек @account.roles.Count; @account.Name</h2>
  48. </div>
  49. <table class="table-bordered" cellspacing="5" cellpadding="5">
  50. <tbody>
  51. <tr>
  52. <td>UUID:</td>
  53. <td>@account.UUID</td>
  54. </tr>
  55. <tr>
  56. <td>Name:</td>
  57. <td>@account.Name</td>
  58. </tr>
  59. <tr>
  60. <td>Email:</td>
  61. <td>@account.Email</td>
  62. </tr>
  63. <tr>
  64. <td>ETH Address:</td>
  65. <td>@account.eth_address</td>
  66. </tr>
  67. <tr>
  68. <td>Balance:</td>
  69. <td>@myBalance WEI</td>
  70. </tr>
  71. <tr>
  72. <td>Администратор:</td>
  73. <td><input @bind="admin" type="checkbox" name="admin" /></td>
  74. </tr>
  75. <tr>
  76. <td>Инициатор:<input @bind="initiator" type="checkbox" name="init" /></td>
  77. </tr>
  78. <tr>
  79. <td>Заказчик:</td>
  80. <td><input @bind="verifier" type="checkbox" name="request" /></td>
  81. </tr>
  82. <tr>
  83. <td>Верификатор:<input @bind="requester" type="checkbox" name="vaerify" /></td>
  84. </tr>
  85. <p>
  86. @foreach (var role in account.roles)
  87. @role
  88. </p>
  89. </tbody>
  90. </table>
  91. </div>