* DiscImageChef.Server/Default.aspx.cs:

* DiscImageChef.Server/Controllers/UploadStatsController.cs:

	* DiscImageChef.Server/ViewReport.aspx.cs:
	  Show requested information before adapted for filesystem.
This commit is contained in:
2017-06-05 17:46:27 +01:00
parent af244b0055
commit d21e79a212
4 changed files with 18 additions and 4 deletions

View File

@@ -1,3 +1,11 @@
2017-06-05 Natalia Portillo <claunia@claunia.com>
* Default.aspx.cs:
* UploadStatsController.cs:
* ViewReport.aspx.cs: Show requested information before
adapted for filesystem.
2017-06-04 Natalia Portillo <claunia@claunia.com> 2017-06-04 Natalia Portillo <claunia@claunia.com>
* AssemblyInfo.cs: * AssemblyInfo.cs:

View File

@@ -37,6 +37,7 @@
// //$Id$ // //$Id$
using System; using System;
using System.IO; using System.IO;
using System.Linq;
using System.Net.Http; using System.Net.Http;
using System.Web; using System.Web;
using System.Web.Http; using System.Web.Http;
@@ -482,6 +483,9 @@ namespace DiscImageChef.Server.Controllers
} }
} }
if(oldStats.Devices != null)
oldStats.Devices = oldStats.Devices.OrderBy(device => device.Manufacturer).ThenBy(device => device.Model).ThenBy(device => device.Revision).ThenBy(device => device.Bus).ToList();
Random rng = new Random(); Random rng = new Random();
string filename = string.Format("BackupStats_{0:yyyyMMddHHmmssfff}_{1}.xml", DateTime.UtcNow, rng.Next()); string filename = string.Format("BackupStats_{0:yyyyMMddHHmmssfff}_{1}.xml", DateTime.UtcNow, rng.Next());
while(File.Exists(Path.Combine(System.Web.Hosting.HostingEnvironment.MapPath("~"), "Statistics", filename))) while(File.Exists(Path.Combine(System.Web.Hosting.HostingEnvironment.MapPath("~"), "Statistics", filename)))

View File

@@ -212,6 +212,8 @@ namespace DiscImageChef.Server
HttpUtility.UrlPathEncode(device.Model)); HttpUtility.UrlPathEncode(device.Model));
} }
xmlFile = xmlFile.Replace('/', '_').Replace('\\', '_').Replace('?', '_');
if(!File.Exists(Path.Combine(System.Web.Hosting.HostingEnvironment.MapPath("~"), "Reports", xmlFile))) if(!File.Exists(Path.Combine(System.Web.Hosting.HostingEnvironment.MapPath("~"), "Reports", xmlFile)))
{ {
url = null; url = null;

View File

@@ -34,10 +34,6 @@ namespace DiscImageChef.Server
if(revision != null) if(revision != null)
revision = Encoding.ASCII.GetString(Encoding.Convert(Encoding.UTF8, Encoding.ASCII, Encoding.UTF8.GetBytes(revision))).Replace('/', '_').Replace('\\', '_').Replace('?', '_'); revision = Encoding.ASCII.GetString(Encoding.Convert(Encoding.UTF8, Encoding.ASCII, Encoding.UTF8.GetBytes(revision))).Replace('/', '_').Replace('\\', '_').Replace('?', '_');
lblManufacturer.Text = manufacturer;
lblModel.Text = model;
lblRevision.Text = revision;
string xmlFile = null; string xmlFile = null;
if(!string.IsNullOrWhiteSpace(manufacturer) && !string.IsNullOrWhiteSpace(model) && !string.IsNullOrWhiteSpace(revision)) if(!string.IsNullOrWhiteSpace(manufacturer) && !string.IsNullOrWhiteSpace(model) && !string.IsNullOrWhiteSpace(revision))
xmlFile = manufacturer + "_" + model + "_" + revision + ".xml"; xmlFile = manufacturer + "_" + model + "_" + revision + ".xml";
@@ -54,6 +50,10 @@ namespace DiscImageChef.Server
return; return;
} }
lblManufacturer.Text = Request.QueryString["manufacturer"];
lblModel.Text = Request.QueryString["model"];
lblRevision.Text = Request.QueryString["revision"];
DeviceReport report = new DeviceReport(); DeviceReport report = new DeviceReport();
XmlSerializer xs = new XmlSerializer(report.GetType()); XmlSerializer xs = new XmlSerializer(report.GetType());
StreamReader sr = new StreamReader(Path.Combine(System.Web.Hosting.HostingEnvironment.MapPath("~"), "Reports", xmlFile)); StreamReader sr = new StreamReader(Path.Combine(System.Web.Hosting.HostingEnvironment.MapPath("~"), "Reports", xmlFile));