mirror of
https://github.com/nttgin/BGPalerter.git
synced 2024-05-19 06:50:08 +00:00
better fix to make multiple paths handling transparent in templates
This commit is contained in:
@@ -104,7 +104,7 @@ export default class Report {
|
||||
context.pathNumber = Math.min(this.params.showPaths, sortedPathIndex.length);
|
||||
context.paths = sortedPathIndex
|
||||
.slice(0, this.params.showPaths)
|
||||
.map(i => i[0]).join("\n");
|
||||
.map(i => i[0]).join(";");
|
||||
} else {
|
||||
context.pathNumber = "";
|
||||
context.paths = "Disabled";
|
||||
|
@@ -110,7 +110,9 @@ export default class ReportEmail extends Report {
|
||||
};
|
||||
|
||||
getEmailText = (channel, content) => {
|
||||
return this.parseTemplate(this.templates[channel], this.getContext(channel, content));
|
||||
const context = this.getContext(channel, content);
|
||||
context.paths = context.paths.split(";").join("\n");
|
||||
return this.parseTemplate(this.templates[channel], context);
|
||||
};
|
||||
|
||||
_sendEmail = (email) => {
|
||||
|
@@ -64,7 +64,7 @@ export default class ReportHTTP extends Report {
|
||||
const context = this.getContext(channel, content);
|
||||
|
||||
if (this.params.showPaths > 0 && context.pathNumber > 0) {
|
||||
context.summary = `${context.summary}. Top ${context.pathNumber} most used AS paths: ${context.paths.split("\n").join(";")}.`;
|
||||
context.summary = `${context.summary}. Top ${context.pathNumber} most used AS paths: ${context.paths}.`;
|
||||
}
|
||||
const blob = this.parseTemplate(this.params.templates[channel] || this.params.templates["default"], context);
|
||||
this.axios({
|
||||
|
Reference in New Issue
Block a user