mirror of
https://github.com/prymitive/karma
synced 2026-05-07 03:26:52 +00:00
Tweak error message for all Alertmanager instances being down
This commit is contained in:
@@ -17,6 +17,7 @@ var Templates = (function() {
|
||||
internalError: "#internal-error",
|
||||
updateError: "#update-error",
|
||||
instanceError: "#instance-error",
|
||||
configError: "#configuration-error",
|
||||
|
||||
// modal popup with label filters
|
||||
modalTitle: "#modal-title",
|
||||
|
||||
@@ -130,8 +130,8 @@ var Unsee = (function() {
|
||||
Counter.Unknown();
|
||||
$(selectors.instanceErrors).html("");
|
||||
renderError("updateError", {
|
||||
error: "Configuration error",
|
||||
messages: [ "No valid Alertmanager server configuration found" ],
|
||||
error: "Fatal error",
|
||||
messages: [ "No working Alertmanager server found" ],
|
||||
lastTs: Watchdog.GetLastUpdate()
|
||||
});
|
||||
Unsee.WaitForNextReload();
|
||||
@@ -183,21 +183,14 @@ var Unsee = (function() {
|
||||
// we have upstreams but none is working, fail hard
|
||||
Counter.Unknown();
|
||||
$(selectors.instanceErrors).html("");
|
||||
var messages = [];
|
||||
resp.upstreams.instances.sort(function(a, b){
|
||||
if(a.name < b.name) return -1;
|
||||
if(a.name > b.name) return 1;
|
||||
return 0;
|
||||
});
|
||||
var failedInstances = [];
|
||||
$.each(resp.upstreams.instances, function(i, instance) {
|
||||
if (instance.error !== "") {
|
||||
messages.push(instance.name + ": " + instance.error);
|
||||
failedInstances.push(instance);
|
||||
}
|
||||
});
|
||||
renderError("updateError", {
|
||||
error: "Configuration error",
|
||||
messages: messages,
|
||||
lastTs: Watchdog.GetLastUpdate()
|
||||
renderError("configError", {
|
||||
instances: failedInstances
|
||||
});
|
||||
Unsee.WaitForNextReload();
|
||||
}
|
||||
|
||||
@@ -88,3 +88,23 @@
|
||||
</div>
|
||||
<% }) %>
|
||||
</script>
|
||||
|
||||
|
||||
<script type="application/json" id="configuration-error">
|
||||
<div class="jumbotron">
|
||||
<h1 class="text-center">
|
||||
Configuration error
|
||||
<i class="fa fa-exclamation-circle text-danger"/>
|
||||
</h1>
|
||||
<div>
|
||||
<% _.each(instances, function(instance) { %>
|
||||
<p>
|
||||
<span class='label label-list label-primary'>
|
||||
<%- instance.name %>
|
||||
</span>
|
||||
<%- instance.error %>
|
||||
</p>
|
||||
<% }) %>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user