Merge pull request #149 from cloudflare/fix-silence-form-colors

Show correct label colors in the silence form
This commit is contained in:
Łukasz Mierzwa
2017-07-25 20:49:43 -07:00
committed by GitHub
3 changed files with 10 additions and 3 deletions

View File

@@ -13,6 +13,10 @@ var Colors = (function() {
colors = colorData;
};
var merge = function(colorData) {
$.extend(colors, colorData);
};
var getClass = function(key, value) {
var label = key + ": " + value;
if (key == "alertname") {
@@ -47,6 +51,7 @@ var Colors = (function() {
return {
Update: update,
Merge: merge,
Get: getStyle,
GetClass: getClass,
GetStaticLabels: getStaticLabels,

View File

@@ -1,6 +1,6 @@
/* globals moment */ // moment.js
/* globals Alerts, Templates, Unsee, UI */
/* globals Alerts, Colors, Templates, Unsee, UI */
/* exported Silence */
var Silence = (function() {
@@ -191,6 +191,8 @@ var Silence = (function() {
);
},
success: function(data) {
// add colors from the response to global color set
Colors.Merge(data.colors);
var modal = $("#silenceModal");
var labels = {};
var alertmanagers = {};

File diff suppressed because one or more lines are too long