Commit 2226df9e authored by nanahira's avatar nanahira

add resolved mark

parent a764c104
...@@ -36,7 +36,8 @@ export class Instance { ...@@ -36,7 +36,8 @@ export class Instance {
let text = `${this.markdown ? segment('markdown') : ''}# ${this.title}`; let text = `${this.markdown ? segment('markdown') : ''}# ${this.title}`;
for (const alert of alerts) { for (const alert of alerts) {
text += `\n\n## ${ const resolved = alert.status === 'resolved';
text += `\n\n## ${resolved ? '[RESOLVED] ' : ''}${
alert.annotations.summary || alert.labels.alertname alert.annotations.summary || alert.labels.alertname
}\n\n`; }\n\n`;
for (const [key, value] of Object.entries(alert.labels)) { for (const [key, value] of Object.entries(alert.labels)) {
...@@ -44,7 +45,7 @@ export class Instance { ...@@ -44,7 +45,7 @@ export class Instance {
text += `* ${key}: \`${value}\`\n`; text += `* ${key}: \`${value}\`\n`;
} }
text += `\n`; text += `\n`;
if (alert.status === 'resolved') { if (resolved) {
text += this.resolvedMessage; text += this.resolvedMessage;
continue; continue;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment