Skip to content

Commit

Permalink
Version 1.1.17 (#18)
Browse files Browse the repository at this point in the history
- fix: Expose units for Zookeeper latency metrics in Overview and entity view
- feature: Introducing the smart component enablement, which allows enabling / disabling a Kafka component to be visible from the Overview, to be managed via the configuration user interface
- feature: Expose Zookeeper leader and Broker active controller in Overview dashboard when mono tenancy (environment) detected or selected
- feature: Configuration checker, detect incomplete installation (Kafka inventory not updated) when loading Overview, and provide modal update user interaction
- fix: Prevents multiple endpoint calls in Alerting User Interface management in Ajax
  • Loading branch information
guilhemmarchand committed Apr 14, 2019
1 parent 890ef1b commit 7ed4f48
Show file tree
Hide file tree
Showing 18 changed files with 1,767 additions and 123 deletions.
10 changes: 10 additions & 0 deletions docs/releasenotes.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
Release notes
#############

==============
Version 1.1.17
==============

- fix: Expose units for Zookeeper latency metrics in Overview and entity view
- feature: Introducing the smart component enablement, which allows enabling / disabling a Kafka component to be visible from the Overview, to be managed via the configuration user interface
- feature: Expose Zookeeper leader and Broker active controller in Overview dashboard when mono tenancy (environment) detected or selected
- feature: Configuration checker, detect incomplete installation (Kafka inventory not updated) when loading Overview, and provide modal update user interaction
- fix: Prevents multiple endpoint calls in Alerting User Interface management in Ajax

==============
Version 1.1.16
==============
Expand Down
104 changes: 53 additions & 51 deletions telegraf-kafka/appserver/static/active_button.js
Original file line number Diff line number Diff line change
@@ -1,74 +1,76 @@
require(['splunkjs/mvc/simplexml/ready!'], function(){
require(['splunkjs/ready!', 'splunkjs/mvc'], function(mvc){
require(['splunkjs/mvc/simplexml/ready!'], function() {
require(['splunkjs/ready!', 'splunkjs/mvc'], function(mvc) {

/*
--------------------------------------------------------------
Multi depends buttons - Written by François Toulouse, thanks !
--------------------------------------------------------------
/*
--------------------------------------------------------------
Multi depends buttons - Written by François Toulouse, thanks !
--------------------------------------------------------------
Usage: Add an html bootstrap button
Usage: Add an html bootstrap button
<button class="btn" data-token-name="foo" data-token-value="1">Activate foo token</button>
<button class="btn" data-token-name="bar" data-token-value="1">Activate bar token</button>
<button class="btn" data-token-name="foo" data-token-value="1">Activate foo token</button>
<button class="btn" data-token-name="bar" data-token-value="1">Activate bar token</button>
*/
*/

var defaultTokenModel = mvc.Components.getInstance('default', {create: true});
var submittedTokenModel = mvc.Components.getInstance('submitted', {create: true});
var defaultTokenModel = mvc.Components.getInstance('default', {
create: true
});
var submittedTokenModel = mvc.Components.getInstance('submitted', {
create: true
});

function setToken(name, value) {
defaultTokenModel.set(name, value);
submittedTokenModel.set(name, value);
}

function getToken(name) {
var ret = null;
function getToken(name) {
var ret = null;

if(defaultTokenModel.get(name) != undefined){
ret = defaultTokenModel.get(name);
}
else if(submittedTokenModel.get(name) != undefined){
ret = submittedTokenModel.get(name);
}
if (defaultTokenModel.get(name) != undefined) {
ret = defaultTokenModel.get(name);
} else if (submittedTokenModel.get(name) != undefined) {
ret = submittedTokenModel.get(name);
}

return ret;
return ret;
}

function unsetToken(name) {
defaultTokenModel.unset(name);
submittedTokenModel.unset(name);
}

// For each button with the class "custom-sub-nav"
$('.custom-sub-nav').each(function(){
var $btn_group = $(this);

/* for each button in this nav:
- Cliking on the button: create the token "data-token-name" with attribute value "data-token-value"
- Button has been clicked already and the user click on it again: removes the token "data-token-name"
*/
$btn_group.find('button').on('click', function(){
var $btn = $(this);
var btn_current_label = $btn.html();
var btn_alt_label = $btn.attr('data-alt-label');
var tk_name = $btn.attr('data-token-name');
var tk_value = $btn.attr('data-token-value');

if( getToken(tk_name) == null){
setToken(tk_name, tk_value);
$btn.addClass('active');
}
else{
unsetToken(tk_name);
$btn.removeClass('active');
}

// Manage button label
$btn.html(btn_alt_label);
$btn.attr('data-alt-label', btn_current_label);

});
});
// For each button with the class "custom-sub-nav"
$('.custom-sub-nav').each(function() {
var $btn_group = $(this);

/* for each button in this nav:
- Cliking on the button: create the token "data-token-name" with attribute value "data-token-value"
- Button has been clicked already and the user click on it again: removes the token "data-token-name"
*/
$btn_group.find('button').on('click', function() {
var $btn = $(this);
var btn_current_label = $btn.html();
var btn_alt_label = $btn.attr('data-alt-label');
var tk_name = $btn.attr('data-token-name');
var tk_value = $btn.attr('data-token-value');

if (getToken(tk_name) == null) {
setToken(tk_name, tk_value);
$btn.addClass('active');
} else {
unsetToken(tk_name);
$btn.removeClass('active');
}

// Manage button label
$btn.html(btn_alt_label);
$btn.attr('data-alt-label', btn_current_label);

});
});
});
});
124 changes: 124 additions & 0 deletions telegraf-kafka/appserver/static/configcheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ require(['jquery',
], function($,
utils,
SearchManager) {

// Verify tags (env, label) are using supported patterns, aka no white spaces or tabs
// If tag check operation is successful, verify if installation is complete via the state of the Kafka inventory KVstore based lookup
var desiredSearchName = "checktags"
if (typeof splunkjs.mvc.Components.getInstance(desiredSearchName) == "object") {
splunkjs.mvc.Components.revokeInstance(desiredSearchName)
Expand Down Expand Up @@ -48,6 +51,127 @@ require(['jquery',
$("#modal_tagcheck_error").modal()
} else {
//console.log("configCheck passed")
// Verify if the Kafka Inventory collection is configured
var desiredSearchName = "checkinventory"
if (typeof splunkjs.mvc.Components.getInstance(desiredSearchName) == "object") {
splunkjs.mvc.Components.revokeInstance(desiredSearchName)
}
var sm = new SearchManager({
"id": desiredSearchName,
"cancelOnUnload": true,
"latest_time": "",
"status_buckets": 0,
"earliest_time": "-5m",
"search": "| inputlookup kafka_infra_inventory",
"app": utils.getCurrentApp(),
"preview": true,
"runWhenTimeIsUndefined": false,
"autostart": true
}, {
tokens: true,
tokenNamespace: "submitted"
});
sm.on('search:done', function(properties) {
var searchName = properties.content.request.label
if (properties.content.resultCount == 0) {
//console.log(searchName, "gave no results", properties)
// Show no data modal
$("#modal_time_to_configure").modal()

require(['splunkjs/mvc/simplexml/ready!'], function() {
require(['splunkjs/ready!', 'splunkjs/mvc'], function(mvc) {

// For each button with the class "custom-sub-nav"
$('.update-collection').each(function() {
var $btn_group = $(this);

/* for each button in this nav:
- Cliking on the button: create the token "data-token-name" with attribute value "data-token-value"
- Button has been clicked already and the user click on it again: removes the token "data-token-name"
*/
$btn_group.find('#btn_modal_update_collection').on('click', function() {
//console.log("Update now triggers.");

$("#loadingGray").remove()
$("body").append('<div id="loadingGray" style="background: #e9e9e9; display: block; position: fixed; z-index: 100; top: 0; right: 0; bottom: 0; left: 0; height: 100%; opacity: 0.8;"><div style="width: 100%; margin-top: 250px; padding-bottom: 50px; text-align: center;"><p style="font-size: 18pt; font-weight: bolder;">Updating the KVstore collection...</p></div><div id="spinner"></div></div>')

require(["jquery",
"/static/app/telegraf-kafka/spin.js"
],
function($,
Spinner
) {
new Spinner({
lines: 12,
position: "relative"
}).spin(document.getElementById('spinner'));
})

var desiredSearchName = "updateCollection"
if (typeof splunkjs.mvc.Components.getInstance(desiredSearchName) == "object") {
splunkjs.mvc.Components.revokeInstance(desiredSearchName)
}
var sm = new SearchManager({
"id": desiredSearchName,
"cancelOnUnload": true,
"latest_time": "",
"status_buckets": 0,
"earliest_time": "-4h",
"search": "| savedsearch \"Update Kafka Infrastructure components inventory\"",
"app": utils.getCurrentApp(),
"preview": true,
"runWhenTimeIsUndefined": false,
"autostart": true
}, {
tokens: true,
tokenNamespace: "submitted"
});

sm.on('search:error', function(properties) {
$("#loadingGray").remove()
$("#modal_update_collection_noresults").modal()
});

sm.on('search:fail', function(properties) {
$("#loadingGray").remove()
$("#modal_update_collection_noresults").modal()
});

sm.on('search:done', function(properties) {
var searchName = properties.content.request.label
if (properties.content.resultCount == 0) {
//console.log(searchName, "gave no results", properties)
// Show no data modal
//$("#modal_check_nodata").modal()
$("#loadingGray").remove()
$("#modal_update_collection_noresults").modal()
} else {
//console.log(searchName, "gave results", properties)
$("#loadingGray").remove()
$("#modal_update_collection_done").modal()

// For each button with the class "custom-sub-nav"
$('.dashboard-refresh').each(function() {
var $btn_group = $(this);

/* for each button in this nav:
- Cliking on the button: create the token "data-token-name" with attribute value "data-token-value"
- Button has been clicked already and the user click on it again: removes the token "data-token-name"
*/
$btn_group.find('#btn_modal_reload').on('click', function() {
document.location.reload();
})
})
}
})
});
});

});

});
}
})
return;
}
}
Expand Down
Loading

0 comments on commit 7ed4f48

Please sign in to comment.