Added a basic live statistics system
This commit is contained in:
@@ -156,6 +156,32 @@ public static class Formatter
|
||||
return (i / (1024D * 1024D)).Round(2) + " GB";
|
||||
}
|
||||
}
|
||||
|
||||
public static double CalculateAverage(List<double> values)
|
||||
{
|
||||
if (values == null || values.Count == 0)
|
||||
{
|
||||
throw new ArgumentException("The list cannot be null or empty.");
|
||||
}
|
||||
|
||||
double sum = 0;
|
||||
foreach (double value in values)
|
||||
{
|
||||
sum += value;
|
||||
}
|
||||
|
||||
return sum / values.Count;
|
||||
}
|
||||
|
||||
public static double CalculatePercentage(double part, double total)
|
||||
{
|
||||
if (total == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return (part / total) * 100;
|
||||
}
|
||||
|
||||
public static RenderFragment FormatLineBreaks(string content)
|
||||
{
|
||||
|
||||
@@ -410,10 +410,17 @@ public static class Permissions
|
||||
|
||||
public static Permission AdminChangelog = new()
|
||||
{
|
||||
Index = 59,
|
||||
Index = 60,
|
||||
Name = "Admin changelog",
|
||||
Description = "View the changelog"
|
||||
};
|
||||
|
||||
public static Permission AdminStatisticsLive = new()
|
||||
{
|
||||
Index = 61,
|
||||
Name = "Admin statistics live",
|
||||
Description = "View the live statistics"
|
||||
};
|
||||
|
||||
public static Permission? FromString(string name)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user