Browse Source

fix(tasks): 增加被忽略的文本模板定义

pull/473/head
cKey 4 years ago
parent
commit
c432343f5d
  1. 33
      aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.ExceptionHandling/LINGYUN/Abp/BackgroundTasks/ExceptionHandling/Templates/JobExceptionHandlingTemplateDefinitionProvider.cs
  2. 7
      aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.ExceptionHandling/LINGYUN/Abp/BackgroundTasks/ExceptionHandling/Templates/JobExceptionHandlingTemplates.cs
  3. 51
      aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.ExceptionHandling/LINGYUN/Abp/BackgroundTasks/ExceptionHandling/Templates/JobExceptionNotifier.tpl

33
aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.ExceptionHandling/LINGYUN/Abp/BackgroundTasks/ExceptionHandling/Templates/JobExceptionHandlingTemplateDefinitionProvider.cs

@ -0,0 +1,33 @@
using LINGYUN.Abp.BackgroundTasks.Localization;
using Volo.Abp.Localization;
using Volo.Abp.TextTemplating;
namespace LINGYUN.Abp.BackgroundTasks.ExceptionHandling.Templates
{
public class JobExceptionHandlingTemplateDefinitionProvider : TemplateDefinitionProvider
{
public override void Define(ITemplateDefinitionContext context)
{
context.Add(GetTemplateDefinitions());
}
private static TemplateDefinition[] GetTemplateDefinitions()
{
return new[]
{
new TemplateDefinition(
JobExceptionHandlingTemplates.JobExceptionNotifier,
displayName: L("TextTemplate:JobExceptionNotifier"),
localizationResource: typeof(BackgroundTasksResource)
).WithVirtualFilePath(
"/LINGYUN/Abp/BackgroundTasks/ExceptionHandling/Templates/JobExceptionNotifier.tpl",
isInlineLocalized: true)
};
}
private static ILocalizableString L(string name)
{
return LocalizableString.Create<BackgroundTasksResource>(name);
}
}
}

7
aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.ExceptionHandling/LINGYUN/Abp/BackgroundTasks/ExceptionHandling/Templates/JobExceptionHandlingTemplates.cs

@ -0,0 +1,7 @@
namespace LINGYUN.Abp.BackgroundTasks.ExceptionHandling.Templates
{
public class JobExceptionHandlingTemplates
{
public const string JobExceptionNotifier = "Abp.BackgroundTasks.JobExceptionNotifier";
}
}

51
aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.ExceptionHandling/LINGYUN/Abp/BackgroundTasks/ExceptionHandling/Templates/JobExceptionNotifier.tpl

@ -0,0 +1,51 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>{{ model.title }}</title>
</head>
<body leftmargin="8" marginwidth="0" topmargin="8" marginheight="4" offset="0">
<table width="95%" cellpadding="0" cellspacing="0" style="font-size: 11pt; font-family: Tahoma, Arial, Helvetica, sans-serif">
<tr>
<td>
<br />
<b><font color="#0B610B">{{ L "JobExecuteError" }}</font></b>
<hr size="2" width="100%" align="center" />
</td>
</tr>
<tr>
<td>
<ul>
{{ if model.tenantname }}
<li>{{ L "TenantName" }}&nbsp;:&nbsp;{{ model.tenantname }}</li>
{{ end }}
<li>{{ L "JobGroup" }}&nbsp;:&nbsp;{{ model.group }}</li>
<li>{{ L "JobName" }}&nbsp;:&nbsp;{{ model.name }}</li>
<li>{{ L "JobId" }}&nbsp;:&nbsp;{{ model.id }}</li>
<li>{{ L "JobType" }}&nbsp;:&nbsp;{{ model.type }}</li>
<li>{{ L "TriggerTime" }}&nbsp;:&nbsp;{{ model.triggertime }}</li>
</ul>
</td>
</tr>
<tr>
<td>
<b><font color="#0B610B">{{ L "ErrorMessage" }}</font></b>
<hr size="2" width="100%" align="center" />
</td>
</tr>
<tr>
<td>
<pre style="font-size: 11pt; font-family: Tahoma, Arial, Helvetica, sans-serif">{{ model.message }}</pre>
<br />
</td>
</tr>
<tr>
<td>
<br />
<b style="float: right"><font color="#0B610B">{{ model.footer }}</font></b>
<hr size="2" width="100%" align="center" />
</td>
</tr>
</table>
</body>
</html>
Loading…
Cancel
Save