Files
Aaru/DiscImageChef.Server/Views/Stats/Index.cshtml

414 lines
22 KiB
Plaintext

@using System.Collections
@using DiscImageChef.CommonTypes.Metadata
@using DiscImageChef.Server.Models
@using Highsoft.Web.Mvc.Charts
@using Chart = Highsoft.Web.Mvc.Charts.Chart
@using Filter = DiscImageChef.Server.Models.Filter
@{
ViewBag.Title = "DiscImageChef Statistics";
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta content="width=device-width, initial-scale=1.0"
name="viewport">
<title>@ViewBag.Title</title>
<link href="../../styles/dicserver.css"
rel="stylesheet"type="text/css" />
<link href="../../styles/dicserver_highcharts.css"
rel="stylesheet"type="text/css" />
<meta charset="utf-8" />
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async
src="https://www.googletagmanager.com/gtag/js?id=UA-111466173-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'UA-111466173-1');
</script>
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
</head>
<body>
<h1 align="center">
Welcome to
<i>
<a href="http://github.com/claunia/discimagechef"
target="_blank">
DiscImageChef
</a>
</i> Server version @ViewBag.Version
</h1>
<br />
<div>
@if(ViewBag.repOperatingSystems != null)
{
<div id="divOperatingSystems">
<div id="osChart"
style="background-color: transparent; width: 25%">
</div>
<div id="linuxChart"
style="background-color: transparent; width: 25%">
</div>
<div id="macosChart"
style="background-color: transparent; width: 25%">
</div>
<div id="windowsChart"
style="background-color: transparent; width: 25%">
</div>
<table>
@foreach(NameValueStats os in ViewBag.repOperatingSystems)
{
<tr>
<td>
DiscImageChef has run on <i>@os.name</i> @os.Value times.
</td>
</tr>
}
</table>
<br />
</div>
}
@if(ViewBag.repVersions != null)
{
<div id="divVersions">
<div id="versionsChart"
style="background-color: transparent; width: 25%">
</div>
<table>
@foreach(NameValueStats version in ViewBag.repVersions)
{
<tr>
<td>
DiscImageChef version <i>@version.name</i> has been used @version.Value times.
</td>
</tr>
}
</table>
<br />
</div>
}
<div id="divCommands">
<div id="commandsChart"
style="background-color: transparent; width: 25%">
</div>
<h4>Commands run:</h4>
<p>
<i>analyze</i> command has been run @ViewBag.lblAnalyze times<br />
<i>benchmark</i> command has been run @ViewBag.lblBenchmark times<br />
<i>checksum</i> command has been run @ViewBag.lblChecksum times<br />
<i>compare</i> command has been run @ViewBag.lblCompare times<br />
<i>convert-image</i> command has been run @ViewBag.lblConvertImage times<br />
<i>create-sidecar</i> command has been run @ViewBag.lblCreateSidecar times<br />
<i>decode</i> command has been run @ViewBag.lblDecode times<br />
<i>device-info</i> command has been run @ViewBag.lblDeviceInfo times<br />
<i>device-report</i> command has been run @ViewBag.lblDeviceReport times<br />
<i>dump-media</i> command has been run @ViewBag.lblDumpMedia times<br />
<i>entropy</i> command has been run @ViewBag.lblEntropy times<br />
<i>extract-files</i> command has been run @ViewBag.lblExtractFiles times<br />
<i>formats</i> command has been run @ViewBag.lblFormats times<br />
<i>image-info</i> command has been run @ViewBag.lblImageInfo times<br />
<i>list-devices</i> command has been run @ViewBag.lblListDevices times<br />
<i>list-encodings</i> command has been run @ViewBag.lblListEncodings times<br />
<i>ls</i> command has been run @ViewBag.lblLs times<br />
<i>media-info</i> command has been run @ViewBag.lblMediaInfo times<br />
<i>media-scan</i> command has been run @ViewBag.lblMediaScan times<br />
<i>printhex</i> command has been run @ViewBag.lblPrintHex times<br />
<i>verify</i> command has been run @ViewBag.lblVerify times
</p>
</div>
@if(ViewBag.repFilters != null)
{
<div id="divFilters">
<div id="filtersChart"
style="background-color: transparent; width: 25%">
</div>
<h3>Filters found:</h3>
<table align="center"
border="1">
<tr>
<th>Filter</th>
<th>Times</th>
</tr>
@foreach(Filter filter in ViewBag.repFilters)
{
<tr>
<td>
@filter.Name
</td>
<td>
@($"{filter.Count}")
</td>
</tr>
}
</table>
</div>
}
@if(ViewBag.repMediaImages != null)
{
<div id="divMediaImages">
<div id="formatsChart"
style="background-color: transparent; width: 25%">
</div>
<h3>Media image formats found:</h3>
<table align="center"
border="1">
<tr>
<th>Media image format</th>
<th>Times</th>
</tr>
@foreach(MediaFormat format in ViewBag.repMediaImages)
{
<tr>
<td>
@format.Name
</td>
<td>
@($"{format.Count}")
</td>
</tr>
}
</table>
</div>
}
@if(ViewBag.repPartitions != null)
{
<div id="divPartitions">
<div id="partitionsChart"
style="background-color: transparent; width: 25%">
</div>
<h3>Partition schemes found:</h3>
<table align="center"
border="1">
<tr>
<th>Partition scheme</th>
<th>Times</th>
</tr>
@foreach(Partition partition in ViewBag.repPartitions)
{
<tr>
<td>
@partition.Name
</td>
<td>
@($"{partition.Count}")
</td>
</tr>
}
</table>
</div>
}
@if(ViewBag.repFilesystems != null)
{
<div id="divFilesystems">
<div id="filesystemsChart"
style="background-color: transparent; width: 25%">
</div>
<h3>Filesystems found:</h3>
<table align="center"
border="1">
<tr>
<th>Filesystem name</th>
<th>Times</th>
</tr>
@foreach(Filesystem filesystem in ViewBag.repFilesystems)
{
<tr>
<td>
@filesystem.Name
</td>
<td>
@($"{filesystem.Count}")
</td>
</tr>
}
</table>
</div>
}
@if(ViewBag.repVirtualMedia != null)
{
<div id="divVirtualMedia">
<div id="virtualMediaChart"
style="background-color: transparent; width: 25%">
</div>
<h3>Media types found in images:</h3>
<table align="center"
border="1">
<tr>
<th>Physical type</th>
<th>Logical type</th>
<th>Times</th>
</tr>
@foreach(MediaItem media in ViewBag.repVirtualMedia)
{
<tr>
<td>
@media.Type
</td>
<td>
@media.SubType
</td>
<td>
@($"{media.Count}")
</td>
</tr>
}
</table>
</div>
}
@if(ViewBag.repRealMedia != null)
{
<div id="divRealMedia">
<div id="realMediaChart"
style="background-color: transparent; width: 25%">
</div>
<h3>Media types found in devices:</h3>
<table align="center"
border="1">
<tr>
<th>Physical type</th>
<th>Logical type</th>
<th>Times</th>
</tr>
@foreach(MediaItem media in ViewBag.repRealMedia)
{
<tr>
<td>
@media.Type
</td>
<td>
@media.SubType
</td>
<td>
@($"{media.Count}")
</td>
</tr>
}
</table>
</div>
}
@if(ViewBag.repDevices != null)
{
<div id="divDevices">
<div id="devicesBusChart"
style="background-color: transparent; width: 25%">
</div>
<div id="devicesManufacturerChart"
style="background-color: transparent; width: 25%">
</div>
<h3>Found devices:</h3>
<table align="center"
border="1">
<tr>
<th>Manufacturer</th>
<th>Model</th>
<th>Revision</th>
<th>Bus</th>
<th>Report</th>
</tr>
@foreach(DeviceItem device in ViewBag.repDevices)
{
<tr>
<td>
@device.Manufacturer
</td>
<td>
@device.Model
</td>
<td>
@device.Revision
</td>
<td>
@device.Bus
</td>
<td>
@if(device.ReportId != 0)
{
<text>@Html.ActionLink("Yes", "View", "Report", new {id = device.ReportId}, new {target = "_blank"})</text>
}
else
{ <text>No</text> }
</td>
</tr>
}
</table>
</div>
}
</div>
<hr />
<footer>
© 2011-2018
<a href="http://www.claunia.com"
target="_blank">
Claunia.com
</a><br />
Fonts are © 2015-2016
<a href="http://int10h.org"
target="_blank">
VileR
</a><br />
CSS © 2018
<a href="https://getbootstrap.com/"
target="_blank">
Bootstrap
</a> and
<a href="http://www.claunia.com"
target="_blank">
Claunia.com
</a>
</footer>
<script crossorigin="anonymous"
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script crossorigin="anonymous"
integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut"
src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js"></script>
<script crossorigin="anonymous"
integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k"
src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js"></script>
</body>
</html>
@{
string highChartsTitleColor = "#AAAAAA";
string highChartsDataLabelColor = "#FFFFFF";
Hashtable highChartsTitleStyle = new Hashtable {{"color", highChartsTitleColor}};
PlotOptionsPieDataLabelsStyle highChartsDataLabelStyle = new PlotOptionsPieDataLabelsStyle {Color = highChartsDataLabelColor, TextOutline = "0px"};
@(Html.Highsoft().GetHighcharts(new Highcharts {Chart = new Chart {PlotBackgroundColor = null, PlotBorderWidth = null, PlotShadow = new Shadow {Enabled = true}}, Title = new Title {Text = "Operating system usage", Style = highChartsTitleStyle}, Tooltip = new Tooltip {PointFormat = "{series.name}: <b>{point.percentage:.1f}%</b>"}, PlotOptions = new PlotOptions {Pie = new PlotOptionsPie {AllowPointSelect = true, Cursor = PlotOptionsPieCursor.Pointer, DataLabels = new PlotOptionsPieDataLabels {Style = highChartsDataLabelStyle, Enabled = true, Format = "<b>{point.name}</b>: {point.percentage:.1f} %"}}}, Series = new List<Series> {new PieSeries {Name = "Percentage:", Data = ViewData["osPieData"] as List<PieSeriesData>}}}, "osChart", false))
@(Html.Highsoft().GetHighcharts(new Highcharts {Chart = new Chart {PlotBackgroundColor = null, PlotBorderWidth = null, PlotShadow = new Shadow {Enabled = true}}, Title = new Title {Text = "Linux versions", Style = highChartsTitleStyle}, Tooltip = new Tooltip {PointFormat = "{series.name}: <b>{point.percentage:.1f}%</b>"}, PlotOptions = new PlotOptions {Pie = new PlotOptionsPie {AllowPointSelect = true, Cursor = PlotOptionsPieCursor.Pointer, DataLabels = new PlotOptionsPieDataLabels {Style = highChartsDataLabelStyle, Enabled = true, Format = "<b>{point.name}</b>: {point.percentage:.1f} %"}}}, Series = new List<Series> {new PieSeries {Name = "Percentage:", Data = ViewData["linuxPieData"] as List<PieSeriesData>}}}, "linuxChart", false))
@(Html.Highsoft().GetHighcharts(new Highcharts {Chart = new Chart {PlotBackgroundColor = null, PlotBorderWidth = null, PlotShadow = new Shadow {Enabled = true}}, Title = new Title {Text = "macOS versions", Style = highChartsTitleStyle}, Tooltip = new Tooltip {PointFormat = "{series.name}: <b>{point.percentage:.1f}%</b>"}, PlotOptions = new PlotOptions {Pie = new PlotOptionsPie {AllowPointSelect = true, Cursor = PlotOptionsPieCursor.Pointer, DataLabels = new PlotOptionsPieDataLabels {Style = highChartsDataLabelStyle, Enabled = true, Format = "<b>{point.name}</b>: {point.percentage:.1f} %"}}}, Series = new List<Series> {new PieSeries {Name = "Percentage:", Data = ViewData["macosPieData"] as List<PieSeriesData>}}}, "macosChart", false))
@(Html.Highsoft().GetHighcharts(new Highcharts {Chart = new Chart {PlotBackgroundColor = null, PlotBorderWidth = null, PlotShadow = new Shadow {Enabled = true}}, Title = new Title {Text = "Windows versions", Style = highChartsTitleStyle}, Tooltip = new Tooltip {PointFormat = "{series.name}: <b>{point.percentage:.1f}%</b>"}, PlotOptions = new PlotOptions {Pie = new PlotOptionsPie {AllowPointSelect = true, Cursor = PlotOptionsPieCursor.Pointer, DataLabels = new PlotOptionsPieDataLabels {Style = highChartsDataLabelStyle, Enabled = true, Format = "<b>{point.name}</b>: {point.percentage:.1f} %"}}}, Series = new List<Series> {new PieSeries {Name = "Percentage:", Data = ViewData["windowsPieData"] as List<PieSeriesData>}}}, "windowsChart", false))
@(Html.Highsoft().GetHighcharts(new Highcharts {Chart = new Chart {PlotBackgroundColor = null, PlotBorderWidth = null, PlotShadow = new Shadow {Enabled = true}}, Title = new Title {Text = "DiscImageChef versions", Style = highChartsTitleStyle}, Tooltip = new Tooltip {PointFormat = "{series.name}: <b>{point.percentage:.1f}%</b>"}, PlotOptions = new PlotOptions {Pie = new PlotOptionsPie {AllowPointSelect = true, Cursor = PlotOptionsPieCursor.Pointer, DataLabels = new PlotOptionsPieDataLabels {Style = highChartsDataLabelStyle, Enabled = true, Format = "<b>{point.name}</b>: {point.percentage:.1f} %"}}}, Series = new List<Series> {new PieSeries {Name = "Percentage:", Data = ViewData["versionsPieData"] as List<PieSeriesData>}}}, "versionsChart", false))
@(Html.Highsoft().GetHighcharts(new Highcharts {Chart = new Chart {PlotBackgroundColor = null, PlotBorderWidth = null, PlotShadow = new Shadow {Enabled = true}}, Title = new Title {Text = "Commands run", Style = highChartsTitleStyle}, Tooltip = new Tooltip {PointFormat = "{series.name}: <b>{point.percentage:.1f}%</b>"}, PlotOptions = new PlotOptions {Pie = new PlotOptionsPie {AllowPointSelect = true, Cursor = PlotOptionsPieCursor.Pointer, DataLabels = new PlotOptionsPieDataLabels {Style = highChartsDataLabelStyle, Enabled = true, Format = "<b>{point.name}</b>: {point.percentage:.1f} %"}}}, Series = new List<Series> {new PieSeries {Name = "Percentage:", Data = ViewData["commandsPieData"] as List<PieSeriesData>}}}, "commandsChart", false))
@(Html.Highsoft().GetHighcharts(new Highcharts {Chart = new Chart {PlotBackgroundColor = null, PlotBorderWidth = null, PlotShadow = new Shadow {Enabled = true}}, Title = new Title {Text = "Filters found", Style = highChartsTitleStyle}, Tooltip = new Tooltip {PointFormat = "{series.name}: <b>{point.percentage:.1f}%</b>"}, PlotOptions = new PlotOptions {Pie = new PlotOptionsPie {AllowPointSelect = true, Cursor = PlotOptionsPieCursor.Pointer, DataLabels = new PlotOptionsPieDataLabels {Style = highChartsDataLabelStyle, Enabled = true, Format = "<b>{point.name}</b>: {point.percentage:.1f} %"}}}, Series = new List<Series> {new PieSeries {Name = "Percentage:", Data = ViewData["filtersPieData"] as List<PieSeriesData>}}}, "filtersChart", false))
@(Html.Highsoft().GetHighcharts(new Highcharts {Chart = new Chart {PlotBackgroundColor = null, PlotBorderWidth = null, PlotShadow = new Shadow {Enabled = true}}, Title = new Title {Text = "Top 10 media image formats found", Style = highChartsTitleStyle}, Tooltip = new Tooltip {PointFormat = "{series.name}: <b>{point.percentage:.1f}%</b>"}, PlotOptions = new PlotOptions {Pie = new PlotOptionsPie {AllowPointSelect = true, Cursor = PlotOptionsPieCursor.Pointer, DataLabels = new PlotOptionsPieDataLabels {Style = highChartsDataLabelStyle, Enabled = true, Format = "<b>{point.name}</b>: {point.percentage:.1f} %"}}}, Series = new List<Series> {new PieSeries {Name = "Percentage:", Data = ViewData["formatsPieData"] as List<PieSeriesData>}}}, "formatsChart", false))
@(Html.Highsoft().GetHighcharts(new Highcharts {Chart = new Chart {PlotBackgroundColor = null, PlotBorderWidth = null, PlotShadow = new Shadow {Enabled = true}}, Title = new Title {Text = "Top 10 partitioning schemes found", Style = highChartsTitleStyle}, Tooltip = new Tooltip {PointFormat = "{series.name}: <b>{point.percentage:.1f}%</b>"}, PlotOptions = new PlotOptions {Pie = new PlotOptionsPie {AllowPointSelect = true, Cursor = PlotOptionsPieCursor.Pointer, DataLabels = new PlotOptionsPieDataLabels {Style = highChartsDataLabelStyle, Enabled = true, Format = "<b>{point.name}</b>: {point.percentage:.1f} %"}}}, Series = new List<Series> {new PieSeries {Name = "Percentage:", Data = ViewData["partitionsPieData"] as List<PieSeriesData>}}}, "partitionsChart", false))
@(Html.Highsoft().GetHighcharts(new Highcharts {Chart = new Chart {PlotBackgroundColor = null, PlotBorderWidth = null, PlotShadow = new Shadow {Enabled = true}}, Title = new Title {Text = "Top 10 filesystems found", Style = highChartsTitleStyle}, Tooltip = new Tooltip {PointFormat = "{series.name}: <b>{point.percentage:.1f}%</b>"}, PlotOptions = new PlotOptions {Pie = new PlotOptionsPie {AllowPointSelect = true, Cursor = PlotOptionsPieCursor.Pointer, DataLabels = new PlotOptionsPieDataLabels {Style = highChartsDataLabelStyle, Enabled = true, Format = "<b>{point.name}</b>: {point.percentage:.1f} %"}}}, Series = new List<Series> {new PieSeries {Name = "Percentage:", Data = ViewData["filesystemsPieData"] as List<PieSeriesData>}}}, "filesystemsChart", false))
@(Html.Highsoft().GetHighcharts(new Highcharts {Chart = new Chart {PlotBackgroundColor = null, PlotBorderWidth = null, PlotShadow = new Shadow {Enabled = true}}, Title = new Title {Text = "Top 10 media types found in images", Style = highChartsTitleStyle}, Tooltip = new Tooltip {PointFormat = "{series.name}: <b>{point.percentage:.1f}%</b>"}, PlotOptions = new PlotOptions {Pie = new PlotOptionsPie {AllowPointSelect = true, Cursor = PlotOptionsPieCursor.Pointer, DataLabels = new PlotOptionsPieDataLabels {Style = highChartsDataLabelStyle, Enabled = true, Format = "<b>{point.name}</b>: {point.percentage:.1f} %"}}}, Series = new List<Series> {new PieSeries {Name = "Percentage:", Data = ViewData["virtualMediaPieData"] as List<PieSeriesData>}}}, "virtualMediaChart", false))
@(Html.Highsoft().GetHighcharts(new Highcharts {Chart = new Chart {PlotBackgroundColor = null, PlotBorderWidth = null, PlotShadow = new Shadow {Enabled = true}}, Title = new Title {Text = "Top 10 media types found in real devices", Style = highChartsTitleStyle}, Tooltip = new Tooltip {PointFormat = "{series.name}: <b>{point.percentage:.1f}%</b>"}, PlotOptions = new PlotOptions {Pie = new PlotOptionsPie {AllowPointSelect = true, Cursor = PlotOptionsPieCursor.Pointer, DataLabels = new PlotOptionsPieDataLabels {Style = highChartsDataLabelStyle, Enabled = true, Format = "<b>{point.name}</b>: {point.percentage:.1f} %"}}}, Series = new List<Series> {new PieSeries {Name = "Percentage:", Data = ViewData["realMediaPieData"] as List<PieSeriesData>}}}, "realMediaChart", false))
@(Html.Highsoft().GetHighcharts(new Highcharts {Chart = new Chart {PlotBackgroundColor = null, PlotBorderWidth = null, PlotShadow = new Shadow {Enabled = true}}, Title = new Title {Text = "Devices found by bus", Style = highChartsTitleStyle}, Tooltip = new Tooltip {PointFormat = "{series.name}: <b>{point.percentage:.1f}%</b>"}, PlotOptions = new PlotOptions {Pie = new PlotOptionsPie {AllowPointSelect = true, Cursor = PlotOptionsPieCursor.Pointer, DataLabels = new PlotOptionsPieDataLabels {Style = highChartsDataLabelStyle, Enabled = true, Format = "<b>{point.name}</b>: {point.percentage:.1f} %"}}}, Series = new List<Series> {new PieSeries {Name = "Percentage:", Data = ViewData["devicesBusPieData"] as List<PieSeriesData>}}}, "devicesBusChart", false))
@(Html.Highsoft().GetHighcharts(new Highcharts {Chart = new Chart {PlotBackgroundColor = null, PlotBorderWidth = null, PlotShadow = new Shadow {Enabled = true}}, Title = new Title {Text = "Devices found by bus", Style = highChartsTitleStyle}, Tooltip = new Tooltip {PointFormat = "{series.name}: <b>{point.percentage:.1f}%</b>"}, PlotOptions = new PlotOptions {Pie = new PlotOptionsPie {AllowPointSelect = true, Cursor = PlotOptionsPieCursor.Pointer, DataLabels = new PlotOptionsPieDataLabels {Style = highChartsDataLabelStyle, Enabled = true, Format = "<b>{point.name}</b>: {point.percentage:.1f} %"}}}, Series = new List<Series> {new PieSeries {Name = "Percentage:", Data = ViewData["devicesManufacturerPieData"] as List<PieSeriesData>}}}, "devicesManufacturerChart", false))
}