* 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>
* AssemblyInfo.cs:

View File

@@ -37,6 +37,7 @@
// //$Id$
using System;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Web;
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();
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)))

View File

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

View File

@@ -34,10 +34,6 @@ namespace DiscImageChef.Server
if(revision != null)
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;
if(!string.IsNullOrWhiteSpace(manufacturer) && !string.IsNullOrWhiteSpace(model) && !string.IsNullOrWhiteSpace(revision))
xmlFile = manufacturer + "_" + model + "_" + revision + ".xml";
@@ -54,6 +50,10 @@ namespace DiscImageChef.Server
return;
}
lblManufacturer.Text = Request.QueryString["manufacturer"];
lblModel.Text = Request.QueryString["model"];
lblRevision.Text = Request.QueryString["revision"];
DeviceReport report = new DeviceReport();
XmlSerializer xs = new XmlSerializer(report.GetType());
StreamReader sr = new StreamReader(Path.Combine(System.Web.Hosting.HostingEnvironment.MapPath("~"), "Reports", xmlFile));