-
Notifications
You must be signed in to change notification settings - Fork 2
Enhance home page with admin team overview #454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d01ea09
Enhance home page with admin team overview
jSylvestre 0822051
Extend home page team overview to all users
jSylvestre 6d8c33c
Refine home page branding and layout
jSylvestre 2e0c596
Upgrade CodeQL actions to v3
jSylvestre c4994e7
Merge remote-tracking branch 'origin/master' into JCS/AllTeams20260603
jSylvestre b73418c
Rename 'Failed Transactions' to 'Rejected Transactions'
jSylvestre File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| using System.Collections.Generic; | ||
|
|
||
| namespace Sloth.Web.Models.HomeViewModels | ||
| { | ||
| public class HomeIndexViewModel | ||
| { | ||
| public IReadOnlyList<HomeTeamSummaryViewModel> Teams { get; set; } = new List<HomeTeamSummaryViewModel>(); | ||
| } | ||
|
|
||
| public class HomeTeamSummaryViewModel | ||
| { | ||
| public string Name { get; set; } | ||
|
|
||
| public string Slug { get; set; } | ||
|
|
||
| public IReadOnlyList<string> SourceNames { get; set; } = new List<string>(); | ||
|
|
||
| public int FailedTransactionCount { get; set; } | ||
|
|
||
| public int StuckTransactionCount { get; set; } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,37 +1,63 @@ | ||
| @using Sloth.Core.Resources | ||
| @model IEnumerable<Sloth.Core.Models.Team> | ||
| @model Sloth.Web.Models.HomeViewModels.HomeIndexViewModel | ||
| @{ | ||
| ViewData["Title"] = "Home Page"; | ||
| } | ||
|
|
||
| <div class="container"> | ||
| <div class="row"> | ||
| <div class="col"> | ||
| <h1>SLOTH</h1> | ||
| <ul> | ||
| <li>Secure <span style="text-decoration: line-through">Scrubber</span></li> | ||
| <li>Ledger <span style="text-decoration: line-through">Loader</span></li> | ||
| <li>Online</li> | ||
| <li>Transaction</li> | ||
| <li>Hub</li> | ||
| </ul> | ||
| </div> | ||
| </div> | ||
|
|
||
| @if (User.IsInRole(Roles.SystemAdmin)) | ||
| { | ||
| <div class="container home-page"> | ||
| <div class="home-heading"> | ||
| <h1>S.L.O.T.H.</h1> | ||
| <p>Secure Ledger Online Transaction Hub</p> | ||
| </div> | ||
|
|
||
| <h2>All Teams:</h2> | ||
| <div class="home-teams"> | ||
| <h2>@(User.IsInRole(Roles.SystemAdmin) ? "All Teams" : "Your Teams")</h2> | ||
|
|
||
| <div class="row flex-column align-items-start justify-content-center"> | ||
| @foreach (var team in Model) | ||
| { | ||
| <div class="col-sm-12 col-md-5"> | ||
| <a asp-controller="Home" asp-action="TeamIndex" asp-route-team="@team.Slug"> | ||
| <span>@team.Name</span> | ||
| </a> | ||
| </div> | ||
| } | ||
| <div class="responsive-table"> | ||
| <table id="homeTeamsTable" class="table sloth-table active-table"> | ||
| <thead> | ||
| <tr> | ||
| <th>Name</th> | ||
| <th>Slug</th> | ||
| <th>Sources</th> | ||
| <th>Rejected Transactions</th> | ||
| <th>Stuck Transactions</th> | ||
| </tr> | ||
| </thead> | ||
| <tbody> | ||
| @foreach (var team in Model.Teams) | ||
| { | ||
| var teamUrl = Url.Action("TeamIndex", "Home", new { team = team.Slug }); | ||
| <tr data-href="@teamUrl"> | ||
| <td> | ||
| <a href="@teamUrl">@team.Name</a> | ||
| </td> | ||
| <td>@team.Slug</td> | ||
| <td>@(team.SourceNames.Any() ? string.Join(", ", team.SourceNames) : "None")</td> | ||
| <td>@team.FailedTransactionCount</td> | ||
| <td>@team.StuckTransactionCount</td> | ||
| </tr> | ||
| } | ||
| </tbody> | ||
| </table> | ||
| </div> | ||
| } | ||
| </div> | ||
| </div> | ||
|
|
||
| @section AdditionalScripts { | ||
| <script> | ||
| $('#homeTeamsTable').DataTable({ | ||
| order: [[0, 'asc']], | ||
| pageLength: -1, | ||
| lengthMenu: [[10, 25, 50, -1], [10, 25, 50, 'All']], | ||
| language: { | ||
| searchPlaceholder: "Search Table", | ||
| search: "", | ||
| }, | ||
| }); | ||
|
|
||
| $('#homeTeamsTable tbody').on('click', 'tr', function () { | ||
| window.location = $(this).data('href'); | ||
| }); | ||
| </script> | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.