mirror of
https://github.com/prymitive/karma
synced 2026-05-07 03:26:52 +00:00
Merge pull request #149 from cloudflare/fix-silence-form-colors
Show correct label colors in the silence form
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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
Reference in New Issue
Block a user