You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.6 KiB

/*
* The PMEventDispatcher is a singleton used for event based communication between all resources
* for instance the dispatcher can be required in and then be used to bind to a custom resize event
*
* CUSTOM EVENT MAPPINGS
*
* layout:resize -> triggered by PMLayoutView when it resizes due to window resizing
* - NO ARGUMENTS
* node:pin -> triggered by PMTooltipView when the pin button is clicked
* - ARGUMENTS:
* - node data structure for the pinned node
* node:drill -> triggered by PMTooltipView and PMPinnedDetailView when the drill button is clicked
* - ARGUMENTS:
* - node data structure for the drilled node
*/
define(["/static/app/DA-ITSI-CP-vmware-dashboards/swc-vmware-cp/index.js",'/static/app/DA-ITSI-CP-vmware-dashboards/libs/backbone.js','/static/app/DA-ITSI-CP-vmware-dashboards/libs/underscore.js'],
function (SWCVMware, Backbone, _) {
var dispatcher = _.clone(Backbone.Events);
var SplunkUtil = SWCVMware.SplunkUtil;
//Bind to drill events and go to correct page
dispatcher.on("node:drill", function(node) {
if (node.type === "RootFolder") {
//For Root Folders just go to the home screen
SplunkUtil.redirect_to("/app/itsi/home_proactive_monitoring");
}
else {
var query_string_args = {
Type: node.type,
nid: node.node_id,
parent_nid: node.parent.node_id,
host: node.tree
};
//Drill baby drill!
SplunkUtil.redirect_to("/custom/DA-ITSI-CP-vmware-dashboards/vmware_redirector/DA-ITSI-CP-vmware-dashboards/redirect", query_string_args);
}
});
return dispatcher;
});