This commit is contained in:
@@ -376,15 +376,22 @@ namespace AyaNova.Biz
|
||||
{
|
||||
log.LogDebug($"Preparing page: adding base reporting scripts to page");
|
||||
|
||||
//Add Handlebars JS for compiling and presenting
|
||||
//Add Handlebars JS for compiling and presenting
|
||||
//https://handlebarsjs.com/
|
||||
await page.AddScriptTagAsync(new AddTagOptions() { Path = Path.Combine(ReportJSFolderPath, "ay-hb.js") });
|
||||
|
||||
//add Marked for markdown processing
|
||||
//https://github.com/markedjs/marked
|
||||
await page.AddScriptTagAsync(new AddTagOptions() { Path = Path.Combine(ReportJSFolderPath, "ay-md.js") });
|
||||
|
||||
//add DOM Purify for markdown template sanitization processing
|
||||
//https://github.com/cure53/DOMPurify
|
||||
await page.AddScriptTagAsync(new AddTagOptions() { Path = Path.Combine(ReportJSFolderPath, "ay-pf.js") });
|
||||
|
||||
//add Bar code library
|
||||
//https://github.com/metafloor/bwip-js
|
||||
await page.AddScriptTagAsync(new AddTagOptions() { Path = Path.Combine(ReportJSFolderPath, "ay-bc.js") });
|
||||
|
||||
//add stock helpers
|
||||
await page.AddScriptTagAsync(new AddTagOptions() { Path = Path.Combine(ReportJSFolderPath, "ay-report.js") });
|
||||
|
||||
@@ -395,13 +402,15 @@ namespace AyaNova.Biz
|
||||
|
||||
//add report pre-render, helpers and style
|
||||
//TODO: Add code to vet / evaluate these scripts and see if they are safe and contain valid methods expected
|
||||
if(string.IsNullOrWhiteSpace(report.JsPrerender)){
|
||||
report.JsPrerender="async function ayPrepareData(reportData){return reportData;}";
|
||||
if (string.IsNullOrWhiteSpace(report.JsPrerender))
|
||||
{
|
||||
report.JsPrerender = "async function ayPrepareData(reportData){return reportData;}";
|
||||
}
|
||||
await page.AddScriptTagAsync(new AddTagOptions() { Content = report.JsPrerender });
|
||||
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(report.JsHelpers))
|
||||
await page.AddScriptTagAsync(new AddTagOptions() { Content = report.JsHelpers });
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(report.Style))
|
||||
await page.AddStyleTagAsync(new AddTagOptions() { Content = report.Style });
|
||||
|
||||
|
||||
74
server/AyaNova/resource/rpt/ay-bc.js.txt
Normal file
74
server/AyaNova/resource/rpt/ay-bc.js.txt
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user