1
0
mirror of https://git.teknik.io/Teknikode/Teknik.git synced 2023-08-02 14:16:22 +02:00

Changed Status to Stats

This commit is contained in:
Uncled1023 2018-05-10 20:12:33 -07:00
parent bf47978253
commit 0ea4d97db1
33 changed files with 124 additions and 122 deletions

View File

@ -8,7 +8,7 @@ using System.Net;
using System.Net.Mail;
using System.Reflection;
using System.Text;
using Teknik.Areas.Status.Models;
using Teknik.Areas.Stats.Models;
using Teknik.Areas.Upload.Models;
using Teknik.Areas.Users.Models;
using Teknik.Areas.Users.Utility;

View File

@ -16,7 +16,7 @@
Teknik was created to provide our users free services that they can trust. All of our services are treated with the utmost care to provide you with the best experience possible, and the best security with your data that we can give.
</p>
<p>
You can view our complete activity and statistics by visiting the <a href="@Url.SubRouteUrl("status", "Status.Index")">status</a> page.
You can view our complete activity and statistics by visiting the <a href="@Url.SubRouteUrl("stats", "Stats.Index")">statistics</a> page.
</p>
<br />
<hr>

View File

@ -9,10 +9,12 @@
<hr>
<h3 class="text-center">Important Links</h3>
<dl class="dl-horizontal">
<dt><a href="@Url.SubRouteUrl("status", "Status.Index")" target="_blank">System Status</a></dt>
<dd>The status page for all of Teknik's Services.</dd>
<dt><a href="@Url.SubRouteUrl("faq", "FAQ.Index")" target="_blank">FAQ</a></dt>
<dd>Some of the more commonly asked questions and some answers regarding them.</dd>
<dt><a href="@Url.SubRouteUrl("status", "Status.Index")" target="_blank">Site Statistics</a></dt>
<dd>Current status of the server, and all the site's statistics, transactions, and data effecting actions.</dd>
<dt><a href="@Url.SubRouteUrl("stats", "Stats.Index")" target="_blank">Site Statistics</a></dt>
<dd>Current resource usage of the server, and all the site's statistics, transactions, and data effecting actions.</dd>
<dt><a href="@Url.SubRouteUrl("privacy", "Privacy.Index")" target="_blank">Privacy Policy</a></dt>
<dd>Everything about how we handle your privacy.</dd>
<dt><a href="@Url.SubRouteUrl("tos", "TOS.Index")" target="_blank">Terms of Service</a></dt>

View File

@ -1,12 +1,12 @@
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Web;
using System.Web.Mvc;
using Teknik.Areas.Status.Models;
using Teknik.Areas.Status.ViewModels;
using Teknik.Areas.Stats.Models;
using Teknik.Areas.Stats.ViewModels;
using Teknik.Attributes;
using Teknik.Controllers;
using Teknik.Filters;
@ -14,19 +14,19 @@ using Teknik.Models;
using Teknik.Piwik;
using Teknik.Utilities;
namespace Teknik.Areas.Status.Controllers
namespace Teknik.Areas.Stats.Controllers
{
[TeknikAuthorize]
public class StatusController : DefaultController
public class StatsController : DefaultController
{
[TrackPageView]
[AllowAnonymous]
public ActionResult Index()
{
ViewBag.Title = "System Status - " + Config.Title;
ViewBag.Description = "Current status information for the server and resources.";
ViewBag.Title = "System Statistics - " + Config.Title;
ViewBag.Description = "Current statistics for the services.";
StatusViewModel model = new StatusViewModel();
StatsViewModel model = new StatsViewModel();
using (TeknikEntities db = new TeknikEntities())
{

View File

@ -1,10 +1,10 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Teknik.Areas.Status.Models
namespace Teknik.Areas.Stats.Models
{
public class Bill : Transaction
{

View File

@ -1,10 +1,10 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Teknik.Areas.Status.Models
namespace Teknik.Areas.Stats.Models
{
public class Donation : Transaction
{

View File

@ -1,10 +1,10 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Teknik.Areas.Status.Models
namespace Teknik.Areas.Stats.Models
{
public class OneTime : Transaction
{

View File

@ -1,10 +1,10 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Teknik.Areas.Status.Models
namespace Teknik.Areas.Stats.Models
{
public class Takedown
{

View File

@ -1,11 +1,11 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Teknik.Utilities;
namespace Teknik.Areas.Status.Models
namespace Teknik.Areas.Stats.Models
{
public class Transaction
{

View File

@ -1,18 +1,18 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Web.Mvc;
using System.Web.Optimization;
using Teknik.Configuration;
using Teknik.Utilities;
namespace Teknik.Areas.Status
namespace Teknik.Areas.Stats
{
public class StatusAreaRegistration : AreaRegistration
public class StatsAreaRegistration : AreaRegistration
{
public override string AreaName
{
get
{
return "Status";
return "Stats";
}
}
@ -20,27 +20,27 @@ namespace Teknik.Areas.Status
{
Config config = Config.Load();
context.MapSubdomainRoute(
"Status.Index",
new List<string>() { "status" }, // Subdomains
"Stats.Index",
new List<string>() { "stats" }, // Subdomains
new List<string>() { config.Host }, // domains
"",
new { controller = "Status", action = "Index" },
new[] { typeof(Controllers.StatusController).Namespace }
new { controller = "Stats", action = "Index" },
new[] { typeof(Controllers.StatsController).Namespace }
);
context.MapSubdomainRoute(
"Status.Action",
new List<string>() { "status" }, // Subdomains
"Stats.Action",
new List<string>() { "stats" }, // Subdomains
new List<string>() { config.Host }, // domains
"Action/{controller}/{action}",
new { controller = "Status", action = "Index" },
new[] { typeof(Controllers.StatusController).Namespace }
new { controller = "Stats", action = "Index" },
new[] { typeof(Controllers.StatsController).Namespace }
);
// Register Script Bundle
BundleTable.Bundles.Add(new CdnScriptBundle("~/bundles/status", config.CdnHost).Include(
BundleTable.Bundles.Add(new CdnScriptBundle("~/bundles/stats", config.CdnHost).Include(
"~/Scripts/Highcharts/highcharts.js",
"~/Scripts/FileSize/filesize.min.js",
"~/Areas/Status/Scripts/Status.js"));
"~/Areas/Stats/Scripts/Stats.js"));
}
}
}

View File

@ -1,10 +1,10 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Teknik.ViewModels;
namespace Teknik.Areas.Status.ViewModels
namespace Teknik.Areas.Stats.ViewModels
{
public class BillViewModel : TransactionViewModel
{

View File

@ -1,10 +1,10 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Teknik.ViewModels;
namespace Teknik.Areas.Status.ViewModels
namespace Teknik.Areas.Stats.ViewModels
{
public class DonationViewModel : TransactionViewModel
{

View File

@ -1,10 +1,10 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Teknik.ViewModels;
namespace Teknik.Areas.Status.ViewModels
namespace Teknik.Areas.Stats.ViewModels
{
public class OneTimeViewModel : TransactionViewModel
{

View File

@ -1,14 +1,14 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Teknik.Areas.Status.Models;
using Teknik.Areas.Stats.Models;
using Teknik.Models;
using Teknik.ViewModels;
namespace Teknik.Areas.Status.ViewModels
namespace Teknik.Areas.Stats.ViewModels
{
public class StatusViewModel : ViewModelBase
public class StatsViewModel : ViewModelBase
{
public int UploadCount { get; set; }
@ -26,7 +26,7 @@ namespace Teknik.Areas.Status.ViewModels
public List<TakedownViewModel> Takedowns { get; set; }
public StatusViewModel()
public StatsViewModel()
{
UploadCount = 0;
UploadSize = 0;

View File

@ -1,10 +1,10 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Teknik.ViewModels;
namespace Teknik.Areas.Status.ViewModels
namespace Teknik.Areas.Stats.ViewModels
{
public class TakedownViewModel : ViewModelBase
{

View File

@ -1,12 +1,12 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Teknik.Areas.Status.Models;
using Teknik.Areas.Stats.Models;
using Teknik.Utilities;
using Teknik.ViewModels;
namespace Teknik.Areas.Status.ViewModels
namespace Teknik.Areas.Stats.ViewModels
{
public class TransactionViewModel : ViewModelBase
{

View File

@ -1,10 +1,10 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Teknik.ViewModels;
namespace Teknik.Areas.Status.ViewModels
namespace Teknik.Areas.Stats.ViewModels
{
public class TransactionsViewModel : ViewModelBase
{

View File

@ -1,6 +1,6 @@
@model List<Teknik.Areas.Status.ViewModels.BillViewModel>
@model List<Teknik.Areas.Stats.ViewModels.BillViewModel>
@using Teknik.Areas.Status.ViewModels
@using Teknik.Areas.Stats.ViewModels
@if (Model != null && Model.Any())
{

View File

@ -1,6 +1,6 @@
@model List<Teknik.Areas.Status.ViewModels.DonationViewModel>
@model List<Teknik.Areas.Stats.ViewModels.DonationViewModel>
@using Teknik.Areas.Status.ViewModels
@using Teknik.Areas.Stats.ViewModels
@if (Model != null && Model.Any())
{

View File

@ -1,19 +1,19 @@
@model Teknik.Areas.Status.ViewModels.StatusViewModel
@model Teknik.Areas.Stats.ViewModels.StatsViewModel
@using Teknik.Utilities
@using Teknik.Areas.Status.Models
@using Teknik.Areas.Stats.Models
@Scripts.Render("~/bundles/signalr")
@Scripts.Render("~/signalr/hubs")
@Scripts.Render("~/bundles/status")
@Scripts.Render("~/bundles/stats")
<script nonce="@Context.Items[Constants.NONCE_KEY]">
var getVisitorDataURL = '@Url.SubRouteUrl("status", "Status.Action", new { action = "GetVisitorData" })';
var showWebCPU = @Model.Config.StatusConfig.ShowWebStatus.ToString().ToLower();
var showDatabaseCPU = @Model.Config.StatusConfig.ShowDatabaseStatus.ToString().ToLower();
var showNetworkUsage = @Model.Config.StatusConfig.ShowNetworkStatus.ToString().ToLower();
var getVisitorDataURL = '@Url.SubRouteUrl("stats", "Stats.Action", new { action = "GetVisitorData" })';
var showWebCPU = @Model.Config.StatsConfig.ShowWebStatus.ToString().ToLower();
var showDatabaseCPU = @Model.Config.StatsConfig.ShowDatabaseStatus.ToString().ToLower();
var showNetworkUsage = @Model.Config.StatsConfig.ShowNetworkStatus.ToString().ToLower();
var showVisitorStats = @Model.Config.PiwikConfig.Enabled.ToString().ToLower();
var totalMemory = @Model.Config.StatusConfig.TotalMemory;
var totalMemory = @Model.Config.StatsConfig.TotalMemory;
var tickInterval = totalMemory / 5;
</script>
@ -86,10 +86,10 @@
</div>
<div role="tabpanel" class="tab-pane" id="transactions">
@Html.Partial("~/Areas/Status/Views/Status/Transactions.cshtml", Model.Transactions)
@Html.Partial("~/Areas/Stats/Views/Stats/Transactions.cshtml", Model.Transactions)
</div>
<div role="tabpanel" class="tab-pane" id="takedowns">
@Html.Partial("~/Areas/Status/Views/Status/Takedowns.cshtml", Model.Takedowns)
@Html.Partial("~/Areas/Stats/Views/Stats/Takedowns.cshtml", Model.Takedowns)
</div>
</div>
}
@ -97,7 +97,7 @@
{
<div class="row">
<div class="col-sm-8 col-sm-offset-2 text-center">
<h3>Status Information has been disabled</h3>
<h3>Stats Information has been disabled</h3>
</div>
</div>
}

View File

@ -1,6 +1,6 @@
@model List<Teknik.Areas.Status.ViewModels.OneTimeViewModel>
@model List<Teknik.Areas.Stats.ViewModels.OneTimeViewModel>
@using Teknik.Areas.Status.ViewModels
@using Teknik.Areas.Stats.ViewModels
@if (Model != null && Model.Any())
{

View File

@ -1,6 +1,6 @@
@model List<Teknik.Areas.Status.ViewModels.TakedownViewModel>
@model List<Teknik.Areas.Stats.ViewModels.TakedownViewModel>
@using Teknik.Areas.Status.ViewModels
@using Teknik.Areas.Stats.ViewModels
@if (Model != null && Model.Any())
{

View File

@ -1,6 +1,6 @@
@model Teknik.Areas.Status.ViewModels.TransactionsViewModel
@model Teknik.Areas.Stats.ViewModels.TransactionsViewModel
@using Teknik.Areas.Status.ViewModels
@using Teknik.Areas.Stats.ViewModels
@{
decimal totalBills = Model.CurrentMonthBills;
@ -55,6 +55,6 @@
</div>
</div>
@Html.Partial("~/Areas/Status/Views/Status/Bills.cshtml", Model.Bills)
@Html.Partial("~/Areas/Status/Views/Status/OneTimes.cshtml", Model.OneTimes)
@Html.Partial("~/Areas/Status/Views/Status/Donations.cshtml", Model.Donations)
@Html.Partial("~/Areas/Stats/Views/Stats/Bills.cshtml", Model.Bills)
@Html.Partial("~/Areas/Stats/Views/Stats/OneTimes.cshtml", Model.OneTimes)
@Html.Partial("~/Areas/Stats/Views/Stats/Donations.cshtml", Model.Donations)

View File

@ -8,7 +8,7 @@ using Teknik.Migrations;
using Teknik.Areas.Upload.Models;
using Teknik.Areas.Paste.Models;
using Teknik.Areas.Podcast.Models;
using Teknik.Areas.Status.Models;
using Teknik.Areas.Stats.Models;
using Teknik.Areas.Shortener.Models;
using Teknik.Attributes;
using System.Data.Entity.ModelConfiguration.Conventions;

Binary file not shown.

View File

@ -273,20 +273,20 @@
<Compile Include="Areas\Privacy\Controllers\PrivacyController.cs" />
<Compile Include="Areas\Privacy\PrivacyAreaRegistration.cs" />
<Compile Include="Areas\Privacy\ViewModels\PrivacyViewModel.cs" />
<Compile Include="Areas\Status\Controllers\StatusController.cs" />
<Compile Include="Areas\Status\Models\Bill.cs" />
<Compile Include="Areas\Status\Models\Donation.cs" />
<Compile Include="Areas\Status\Models\OneTime.cs" />
<Compile Include="Areas\Status\Models\Takedown.cs" />
<Compile Include="Areas\Status\Models\Transaction.cs" />
<Compile Include="Areas\Status\StatusAreaRegistration.cs" />
<Compile Include="Areas\Status\ViewModels\OneTimeViewModel.cs" />
<Compile Include="Areas\Status\ViewModels\DonationViewModel.cs" />
<Compile Include="Areas\Status\ViewModels\StatusViewModel.cs" />
<Compile Include="Areas\Status\ViewModels\TakedownViewModel.cs" />
<Compile Include="Areas\Status\ViewModels\TransactionsViewModel.cs" />
<Compile Include="Areas\Status\ViewModels\BillViewModel.cs" />
<Compile Include="Areas\Status\ViewModels\TransactionViewModel.cs" />
<Compile Include="Areas\Stats\Controllers\StatsController.cs" />
<Compile Include="Areas\Stats\Models\Bill.cs" />
<Compile Include="Areas\Stats\Models\Donation.cs" />
<Compile Include="Areas\Stats\Models\OneTime.cs" />
<Compile Include="Areas\Stats\Models\Takedown.cs" />
<Compile Include="Areas\Stats\Models\Transaction.cs" />
<Compile Include="Areas\Stats\StatsAreaRegistration.cs" />
<Compile Include="Areas\Stats\ViewModels\OneTimeViewModel.cs" />
<Compile Include="Areas\Stats\ViewModels\DonationViewModel.cs" />
<Compile Include="Areas\Stats\ViewModels\StatsViewModel.cs" />
<Compile Include="Areas\Stats\ViewModels\TakedownViewModel.cs" />
<Compile Include="Areas\Stats\ViewModels\TransactionsViewModel.cs" />
<Compile Include="Areas\Stats\ViewModels\BillViewModel.cs" />
<Compile Include="Areas\Stats\ViewModels\TransactionViewModel.cs" />
<Compile Include="Areas\User\Controllers\UserController.cs" />
<Compile Include="Areas\User\Models\BlogSettings.cs" />
<Compile Include="Areas\User\Models\InviteCode.cs" />
@ -416,7 +416,7 @@
<Content Include="Areas\Paste\Scripts\Paste.js" />
<Content Include="Areas\Podcast\Content\Podcast.css" />
<Content Include="Areas\Podcast\Scripts\Podcast.js" />
<Content Include="Areas\Status\Scripts\Status.js" />
<Content Include="Areas\Stats\Scripts\Stats.js" />
<Content Include="Areas\Upload\Content\Upload.css" />
<Content Include="Areas\User\Scripts\CheckAuthCode.js" />
<Content Include="Areas\User\Scripts\Profile.js" />
@ -676,14 +676,14 @@
<Content Include="Areas\Vault\Views\Vault\ModifyVaultItem.cshtml" />
<Content Include="Areas\Vault\Views\Vault\PasteItem.cshtml" />
<Content Include="Areas\Vault\Views\Vault\UploadItem.cshtml" />
<Content Include="Areas\Status\Views\web.config" />
<Content Include="Areas\Status\Views\_ViewStart.cshtml" />
<Content Include="Areas\Status\Views\Status\Index.cshtml" />
<Content Include="Areas\Status\Views\Status\Transactions.cshtml" />
<Content Include="Areas\Status\Views\Status\Bills.cshtml" />
<Content Include="Areas\Status\Views\Status\OneTimes.cshtml" />
<Content Include="Areas\Status\Views\Status\Donations.cshtml" />
<Content Include="Areas\Status\Views\Status\Takedowns.cshtml" />
<Content Include="Areas\Stats\Views\web.config" />
<Content Include="Areas\Stats\Views\_ViewStart.cshtml" />
<Content Include="Areas\Stats\Views\Stats\Index.cshtml" />
<Content Include="Areas\Stats\Views\Stats\Transactions.cshtml" />
<Content Include="Areas\Stats\Views\Stats\Bills.cshtml" />
<Content Include="Areas\Stats\Views\Stats\OneTimes.cshtml" />
<Content Include="Areas\Stats\Views\Stats\Donations.cshtml" />
<Content Include="Areas\Stats\Views\Stats\Takedowns.cshtml" />
<Content Include="Areas\FAQ\Views\web.config" />
<Content Include="Areas\FAQ\Views\_ViewStart.cshtml" />
<Content Include="Areas\FAQ\Views\FAQ\Index.cshtml" />
@ -808,7 +808,7 @@
<Folder Include="Areas\Privacy\Models\" />
<Folder Include="Areas\Privacy\Views\Shared\" />
<Folder Include="Areas\Shortener\Views\Shared\" />
<Folder Include="Areas\Status\Views\Shared\" />
<Folder Include="Areas\Stats\Views\Shared\" />
<Folder Include="Areas\Stream\Views\Shared\" />
<Folder Include="Areas\TOS\Models\" />
<Folder Include="Areas\TOS\Views\Shared\" />

View File

@ -51,7 +51,7 @@
}
<div class="row">
<div class="col-sm-5 col-sm-offset-1 text-left text-muted">
&copy; Teknik 2013-2018 | <a href="@Url.SubRouteUrl("faq", "FAQ.Index")">FAQ</a> | <a href="@Url.SubRouteUrl("privacy", "Privacy.Index")">Privacy</a> | <a href="@Url.SubRouteUrl("tos", "TOS.Index")">TOS</a> | <a href="@Url.SubRouteUrl("abuse", "Abuse.Index")">Abuse</a> | <a href="@Url.SubRouteUrl("status", "Status.Index")">Status</a>
&copy; Teknik 2013-2018 | <a href="@Url.SubRouteUrl("faq", "FAQ.Index")">FAQ</a> | <a href="@Url.SubRouteUrl("privacy", "Privacy.Index")">Privacy</a> | <a href="@Url.SubRouteUrl("tos", "TOS.Index")">TOS</a> | <a href="@Url.SubRouteUrl("abuse", "Abuse.Index")">Abuse</a> | <a href="@Url.SubRouteUrl("stats", "Stats.Index")">Statistics</a>
</div>
<div class="col-sm-5 text-right text-muted">
<div id="pagetime" style="display:none;">

View File

@ -44,7 +44,7 @@ namespace Teknik.Configuration
private StreamConfig _StreamConfig;
private ShortenerConfig _ShortenerConfig;
private VaultConfig _VaultConfig;
private StatusConfig _StatusConfig;
private StatsConfig _StatusConfig;
private LoggingConfig _LoggingConfig;
private PiwikConfig _PiwikConfig;
private IRCConfig _IRCConfig;
@ -104,7 +104,7 @@ namespace Teknik.Configuration
public VaultConfig VaultConfig { get { return _VaultConfig; } set { _VaultConfig = value; } }
// Status Configuration
public StatusConfig StatusConfig { get { return _StatusConfig; } set { _StatusConfig = value; } }
public StatsConfig StatusConfig { get { return _StatusConfig; } set { _StatusConfig = value; } }
// Logging Configuration
public LoggingConfig LoggingConfig { get { return _LoggingConfig; } set { _LoggingConfig = value; } }
@ -152,7 +152,7 @@ namespace Teknik.Configuration
StreamConfig = new StreamConfig();
ShortenerConfig = new ShortenerConfig();
VaultConfig = new VaultConfig();
StatusConfig = new StatusConfig();
StatusConfig = new StatsConfig();
LoggingConfig = new LoggingConfig();
PiwikConfig = new PiwikConfig();
IRCConfig = new IRCConfig();

View File

@ -60,7 +60,7 @@
<Compile Include="PiwikConfig.cs" />
<Compile Include="PodcastConfig.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="StatusConfig.cs" />
<Compile Include="StatsConfig.cs" />
<Compile Include="VaultConfig.cs" />
<Compile Include="ShortenerConfig.cs" />
<Compile Include="StreamConfig.cs" />

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace Teknik.Configuration
{
public class StatusConfig
public class StatsConfig
{
public bool Enabled { get; set; }
@ -22,7 +22,7 @@ namespace Teknik.Configuration
public long TotalMemory { get; set; }
public StatusConfig()
public StatsConfig()
{
Enabled = false;
ShowWebStatus = false;