Move Windows versions chart to ChartJS.

This commit is contained in:
2019-11-03 03:46:19 +00:00
parent d524aa9ffd
commit 994c683564
2 changed files with 19 additions and 1 deletions

View File

@@ -521,5 +521,16 @@ namespace DiscImageChef.Server.Controllers
ctx.OperatingSystems.Where(o => o.Name == PlatformID.MacOSX.ToString()).OrderByDescending(o => o.Count).
Take(10).Select(x => x.Count.ToString()).ToArray()
});
public IActionResult GetWindowsData() => Json(new[]
{
ctx.OperatingSystems.Where(o => o.Name == PlatformID.Win32NT.ToString()).OrderByDescending(o => o.Count).
Take(10).
Select(x =>
$"{DetectOS.GetPlatformName(PlatformID.Win32NT, x.Version)}{(string.IsNullOrEmpty(x.Version) ? "" : " ")}{x.Version}").
ToArray(),
ctx.OperatingSystems.Where(o => o.Name == PlatformID.Win32NT.ToString()).OrderByDescending(o => o.Count).
Take(10).Select(x => x.Count.ToString()).ToArray()
});
}
}