public IActionResult Report(string bundleId, string dumpId) { ViewData["Message"] = "Get Report"; var bundleInfo = superDumpRepo.GetBundle(bundleId); if (bundleInfo == null) { return(View(null)); } var dumpInfo = superDumpRepo.GetDump(bundleId, dumpId); if (dumpInfo == null) { return(View(null)); } SDResult res = superDumpRepo.GetResult(bundleId, dumpId); return(base.View(new ReportViewModel(bundleId, dumpId) { BundleFileName = bundleInfo.BundleFileName, DumpFileName = dumpInfo.DumpFileName, Result = res, CustomProperties = Utility.Sanitize(bundleInfo.CustomProperties), HasAnalysisFailed = dumpInfo.Status == DumpStatus.Failed, TimeStamp = dumpInfo.Created, Files = dumpRepo.GetFileNames(bundleId, dumpId), AnalysisError = dumpInfo.ErrorMessage, ThreadTags = res != null ? res.GetThreadTags() : new HashSet <SDTag>(), PointerSize = res == null ? 8 : (res.SystemContext.ProcessArchitecture == "X86" ? 8 : 12), CustomTextResult = ReadCustomTextResult(dumpInfo) })); }
public async Task <IActionResult> Report(string bundleId, string dumpId) { ViewData["Message"] = "Get Report"; var bundleInfo = superDumpRepo.GetBundle(bundleId); if (bundleInfo == null) { logger.LogNotFound("Report: Bundle not found", HttpContext, "BundleId", bundleId); return(View(null)); } var dumpInfo = superDumpRepo.GetDump(bundleId, dumpId); if (dumpInfo == null) { logger.LogNotFound("Report: Dump not found", HttpContext, "DumpId", dumpId); return(View(null)); } SDResult res = await superDumpRepo.GetResult(bundleId, dumpId); logger.LogDumpAccess("Report", HttpContext, bundleInfo, dumpId); return(base.View(new ReportViewModel(bundleId, dumpId) { BundleFileName = bundleInfo.BundleFileName, DumpFileName = dumpInfo.DumpFileName, Result = res, CustomProperties = Utility.Sanitize(bundleInfo.CustomProperties), HasAnalysisFailed = dumpInfo.Status == DumpStatus.Failed, TimeStamp = dumpInfo.Created, Files = dumpRepo.GetFileNames(bundleId, dumpId), AnalysisError = dumpInfo.ErrorMessage, ThreadTags = res != null ? res.GetThreadTags() : new HashSet <SDTag>(), PointerSize = res == null ? 8 : (res.SystemContext?.ProcessArchitecture == "X86" ? 8 : 12), CustomTextResult = await ReadCustomTextResult(dumpInfo), SDResultReadError = string.Empty, DumpType = dumpInfo.DumpType, RepositoryUrl = settings.RepositoryUrl, InteractiveGdbHost = settings.InteractiveGdbHost, Similarities = (await relationshipRepo.GetRelationShips(new DumpIdentifier(bundleId, dumpId))) .Select(x => new KeyValuePair <DumpMetainfo, double>(dumpRepo.Get(x.Key), x.Value)), IsDumpAvailable = dumpRepo.IsPrimaryDumpAvailable(bundleId, dumpId) })); }
public async Task <IActionResult> Get(string bundleId) { // check if it is a bundle var bundleInfo = superDumpRepo.GetBundle(bundleId); if (bundleInfo == null) { return(NotFound("Resource not found")); } var resultList = new List <SDResult>(); foreach (var dumpInfo in dumpRepo.Get(bundleId)) { resultList.Add(await superDumpRepo.GetResult(bundleId, dumpInfo.DumpId)); } return(Content(JsonConvert.SerializeObject(resultList, Formatting.Indented, new JsonSerializerSettings { ReferenceLoopHandling = ReferenceLoopHandling.Ignore }), "application/json")); }