This commit is contained in:
@@ -249,7 +249,7 @@ namespace AyaNova.Biz
|
||||
{
|
||||
//Let postgres sort the names so that they appear with the emoji symbols last in the list which we use for sample reports to
|
||||
//not pollute the regular reports
|
||||
var rpts = await ct.Report.AsNoTracking().Where(z => z.AType == aType && z.Active == true).Select(z => new { id = z.Id, name = z.Name, roles = z.Roles }).OrderBy(z=>z.name).ToListAsync();
|
||||
var rpts = await ct.Report.AsNoTracking().Where(z => z.AType == aType && z.Active == true).Select(z => new { id = z.Id, name = z.Name, roles = z.Roles }).OrderBy(z => z.name).ToListAsync();
|
||||
var ret = new List<NameIdItem>();
|
||||
foreach (var item in rpts)
|
||||
{
|
||||
@@ -258,7 +258,7 @@ namespace AyaNova.Biz
|
||||
ret.Add(new NameIdItem() { Name = item.name, Id = item.id });
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -444,36 +444,25 @@ namespace AyaNova.Biz
|
||||
}
|
||||
|
||||
//initialization
|
||||
log.LogDebug("Initializing report system");
|
||||
log.LogDebug("Initializing report rendering system");
|
||||
bool AutoDownloadChromium = true;
|
||||
if (string.IsNullOrWhiteSpace(ServerBootConfig.AYANOVA_REPORT_RENDER_BROWSER_PATH))
|
||||
{
|
||||
log.LogDebug($"Using default Chromium browser (downloaded)");
|
||||
}
|
||||
else
|
||||
{
|
||||
log.LogDebug($"Using user specified Chromium browser at {ServerBootConfig.AYANOVA_REPORT_RENDER_BROWSER_PATH}");
|
||||
AutoDownloadChromium = false;
|
||||
}
|
||||
|
||||
var ReportJSFolderPath = Path.Combine(ServerBootConfig.AYANOVA_CONTENT_ROOT_PATH, "resource", "rpt");
|
||||
|
||||
// //===================
|
||||
// //TRY TO FORCE LANGUAGE
|
||||
// //language - mirror client's language so that pdf footer header stuff like date prints in their desired format, otherwise those items take the server's settings automatically
|
||||
// var ClientLanguage = reportRequest.ClientMeta["LanguageName"].Value<string>();
|
||||
// string LaunchParamLanguage = string.Empty;
|
||||
// if (!string.IsNullOrWhiteSpace(ClientLanguage))
|
||||
// {
|
||||
// LaunchParamLanguage = $"--lang={ClientLanguage}";
|
||||
// }
|
||||
// //======================
|
||||
|
||||
|
||||
var lo = new LaunchOptions { Headless = true };
|
||||
|
||||
|
||||
//TODO: this needs to be changed to a config variable to trigger automatically downloading chromium and in docker distro set it to false
|
||||
//so maybe what is needed is to specify chromium executable path and if not set then it attempts a download automatically
|
||||
//that would cover many scenarios beyond docker / linux desktop
|
||||
|
||||
|
||||
bool isWindows = System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows);
|
||||
if (!isWindows)
|
||||
if (!AutoDownloadChromium)
|
||||
{
|
||||
//LINUX / MAC / NOT WINDOWS
|
||||
log.LogDebug($"Not Windows: setting executable path for chrome to expected '/usr/bin/chromium-browser'");
|
||||
lo.ExecutablePath = "/usr/bin/chromium-browser";//this is the default path for docker based alpine dist, but maybe not others, need to make a config setting likely
|
||||
// lo.Args = new string[] { "--no-sandbox" };
|
||||
lo.ExecutablePath = ServerBootConfig.AYANOVA_REPORT_RENDER_BROWSER_PATH;//"/usr/bin/chromium-browser";//this is the default path for docker based alpine dist, but maybe not others, need to make a config setting likely
|
||||
// lo.Args = new string[] { "--no-sandbox" };
|
||||
/*
|
||||
troubleshooting links:
|
||||
https://developers.google.com/web/tools/puppeteer/troubleshooting
|
||||
|
||||
Reference in New Issue
Block a user