Detail.cshtml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. @page "{id:int}"
  2. @using Domain.Entities.Developers.ValueObject
  3. @model Admin.Pages.Developers.Apps.DetailModel
  4. @{
  5. ViewData["Title"] = "개발자 앱 상세";
  6. }
  7. <div class="container">
  8. <h3>@ViewData["Title"]</h3>
  9. <hr />
  10. <partial name="_StatusMessage" />
  11. @if (Model.App == null)
  12. {
  13. <div class="alert alert-warning">앱이 존재하지 않습니다.</div>
  14. return;
  15. }
  16. <div class="row">
  17. <div class="col-12 col-md-8">
  18. <table class="table table-bordered">
  19. <tr><th style="width:160px">ID</th><td class="text-start">@Model.App.ID</td></tr>
  20. <tr><th>이름</th><td class="text-start">@Model.App.Name</td></tr>
  21. <tr><th>설명</th><td class="text-start">@(Model.App.Description ?? "-")</td></tr>
  22. <tr><th>홈페이지</th><td class="text-start"><a href="@Model.App.HomepageUrl" target="_blank">@(Model.App.HomepageUrl ?? "-")</a></td></tr>
  23. <tr><th>소유자</th><td class="text-start">@Model.App.Owner?.Email (@(Model.App.Owner?.Name ?? "-"))</td></tr>
  24. <tr><th>상태</th><td class="text-start"><span class="badge bg-secondary">@Model.App.Status</span></td></tr>
  25. <tr><th>요청 Scope</th><td class="text-start">@string.Join(", ", Model.Scopes)</td></tr>
  26. <tr><th>생성일</th><td class="text-start">@Model.App.CreatedAt.ToString("yyyy-MM-dd HH:mm")</td></tr>
  27. <tr><th>승인일</th><td class="text-start">@(Model.App.ApprovedAt?.ToString("yyyy-MM-dd HH:mm") ?? "-")</td></tr>
  28. <tr><th>정지일</th><td class="text-start">@(Model.App.SuspendedAt?.ToString("yyyy-MM-dd HH:mm") ?? "-")</td></tr>
  29. </table>
  30. </div>
  31. <div class="col-12 col-md-4">
  32. <form method="post" class="mb-3">
  33. @if (Model.App.Status != ApplicationStatus.Active)
  34. {
  35. <button type="submit" asp-page-handler="Approve" class="btn btn-success w-100 mb-2">승인</button>
  36. }
  37. @if (Model.App.Status != ApplicationStatus.Suspended)
  38. {
  39. <button type="submit" asp-page-handler="Suspend" class="btn btn-warning w-100 mb-2">정지</button>
  40. }
  41. </form>
  42. <h5>속도 제한</h5>
  43. <form method="post">
  44. <div class="input-group">
  45. <input type="number" name="LimitPerMinute" value="@Model.LimitPerMinute" min="1" max="100000" class="form-control" />
  46. <span class="input-group-text">/분</span>
  47. <button type="submit" asp-page-handler="OverrideRateLimit" class="btn btn-primary">적용</button>
  48. </div>
  49. <small class="text-muted">기본 60/분. 덮어쓰기 값만 저장됩니다.</small>
  50. </form>
  51. </div>
  52. </div>
  53. <hr />
  54. <h4>인증 정보 <small>(Client ID / Secret)</small></h4>
  55. <table class="table table-bordered table-hover">
  56. <thead>
  57. <tr>
  58. <th>ClientID</th>
  59. <th>SecretHint</th>
  60. <th>상태</th>
  61. <th>생성</th>
  62. <th>최근 사용</th>
  63. </tr>
  64. </thead>
  65. <tbody>
  66. @foreach (var c in Model.Credentials)
  67. {
  68. <tr>
  69. <td><code>@c.ClientID</code></td>
  70. <td>****@c.SecretHint</td>
  71. <td>@c.Status</td>
  72. <td>@c.CreatedAt.ToString("yyyy-MM-dd HH:mm")</td>
  73. <td>@(c.LastUsedAt?.ToString("yyyy-MM-dd HH:mm") ?? "-")</td>
  74. </tr>
  75. }
  76. </tbody>
  77. </table>
  78. <hr/>
  79. <div class="d-flex justify-content-center">
  80. <a asp-page="/Developers/Apps/Index" class="btn btn-secondary">목록으로</a>
  81. </div>
  82. </div>