Option to enable triggers background highlighting, #532

This commit is contained in:
Alexander Zobnin
2018-03-15 17:49:49 +03:00
parent 22d1643caa
commit aa20e3dc36
14 changed files with 107 additions and 13 deletions

View File

@@ -524,6 +524,16 @@ export class TriggerPanelCtrl extends PanelCtrl {
return statusClass;
}
getBackground(trigger) {
// console.log(trigger.color, this.contextSrv.user.lightTheme);
const mainColor = trigger.color;
const secondColor = this.contextSrv.user.lightTheme ? '#dde4ed' : '#262628';
if (this.contextSrv.user.lightTheme) {
return `linear-gradient(135deg, ${secondColor}, ${mainColor})`;
}
return `linear-gradient(135deg, ${mainColor}, ${secondColor})`;
}
isNewTrigger(trigger) {
try {
const highlightIntervalMs = utils.parseInterval(this.panel.highlightNewerThan || PANEL_DEFAULTS.highlightNewerThan);