No, no, no. 😄 You should never edit search_mrsparkle . The better way is to write some JS modules, and include them into the dashboard. This will update your footers dynamically on dashboard load. Much javascript, better, wow.
EDIT: So, for any links that you want, put them in the new_links array.
Put this in $APP_HOME/appserver/static/dashboard.js . Then hit the _bump endpoint.
require(['jquery', 'underscore', 'splunkjs/mvc', 'splunkjs/mvc/simplexml/ready!'],
function ($, _, mvc) {
var re = /^footer$/i,
new_links = [ {"href": "www.google.com", "text": "Google"}]
_(mvc.Components.toJSON()).chain().filter(function (el) {
var myId = $(el).attr("id") || "undefined",
should_include = false;
var isMyIDUndefined = (myId === "undefined");
if (!isMyIDUndefined) {
var matches = myId.match(re);
var isMatchesNull = (matches === null);
if (!isMatchesNull) {
should_include = true;
}
}
if (should_include) {
console.log("returning " + $(el).attr("id"));
return el;
}
}).each(function (mytableView) {
console.log(mytableView);
var footer_div = $(mytableView.$el[0].childNodes[0].childNodes[0]);
for (var k = 0; k < new_links.length; k++){
footer_div.append('<a href="'+new_links[k].href+'" target="_blank">'+new_links[k].text+'</a>')
}
console.log(footer_div);
});
});
... View more