Browse Source

Modified formatting of service stats

tags/2.0.6
Teknikode 3 years ago
parent
commit
87f4c45c75

+ 3
- 0
Teknik/Areas/Transparency/Controllers/TransparencyController.cs View File

@@ -42,6 +42,9 @@ namespace Teknik.Areas.Transparency.Controllers
Shortener.Models.ShortenedUrl url = db.ShortenedUrls.OrderByDescending(s => s.ShortenedUrlId).FirstOrDefault();
model.ShortenedUrlCount = (url != null) ? url.ShortenedUrlId : 0;

Vault.Models.Vault vault = db.Vaults.OrderByDescending(v => v.VaultId).FirstOrDefault();
model.VaultCount = (url != null) ? vault.VaultId : 0;

model.TotalNet = new Dictionary<string, double>();

var billSums = db.Transactions.OfType<Bill>().GroupBy(b => b.Currency).Select(b => new { currency = b.Key, total = b.Sum(c => c.Amount) }).ToList();

+ 2
- 0
Teknik/Areas/Transparency/ViewModels/TransparencyViewModel.cs View File

@@ -20,6 +20,8 @@ namespace Teknik.Areas.Transparency.ViewModels

public int ShortenedUrlCount { get; set; }

public int VaultCount { get; set; }

public string Canary { get; set; }

public Dictionary<string, double> TotalBills { get; set; }

+ 13
- 9
Teknik/Areas/Transparency/Views/Transparency/Index.cshtml View File

@@ -39,25 +39,29 @@
<br />
}
<div class="row">
<div class="col-sm-6">
<div class="col-sm-3 text-center">
<h3>Uploads</h3>
<p>Number of Uploads: @Model.UploadCount</p>
<p>Total Count: @Model.UploadCount</p>
<p>Total Size: @StringHelper.GetBytesReadable(Model.UploadSize)</p>
</div>
<div class="col-sm-6">
<div class="col-sm-3 text-center">
<h3>Pastes</h3>
<p>Number of Pastes: @Model.PasteCount</p>
<p>Total Count: @Model.PasteCount</p>
</div>
<div class="col-sm-3 text-center">
<h3>Shortened Urls</h3>
<p>Total Count: @Model.ShortenedUrlCount</p>
</div>
<div class="col-sm-3 text-center">
<h3>Vaults</h3>
<p>Total Count: @Model.ShortenedUrlCount</p>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="col-sm-12 text-center">
<h3>Users</h3>
<p>Number of Users: @Model.UserCount</p>
</div>
<div class="col-sm-6">
<h3>Shortened Urls</h3>
<p>Number of Shortened Urls: @Model.ShortenedUrlCount</p>
</div>
</div>
<br />
<h2 class="text-center"><b>Transactions</b></h2>

Loading…
Cancel
Save