Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
hooks: {
    // hook for handling escape key
    // Must return true to consume ESC, false otherwise.
    escape: function () {
        // Must return true to consume ESC, false otherwise.
        return stds.stopDisplay();
    },

    // hooks for when the selection changes...
    empty: function () {
        selectionCallback('empty');
    },
    single: function (data) {
        selectionCallback('single', data);
    },
    multi: function (selectOrder) {
        selectionCallback('multi', selectOrder);
        tov.addDetailButton('foo');
        tov.addDetailButton('bar');
    }
 
    // mouse hooks
    mouseover: function (m) {
        // m has id, class, and type properties
        $log.debug('mouseover:', m);
        stds.updateDisplay(m);
    },
    mouseout: function () {
        $log.debug('mouseout');
        stds.updateDisplay();
    },
 
    // intent visualization hookhooks
    acceptIntent: function (type) {
        var canHandle = {
            HostToHostIntent: 1,
            PointToPointIntent: 1
        };
        return canHandle[type];
    },
    showintentshowIntent: function (info) {
        stds.selectIntent(info);
    }
}

...

  • mouseover: invoked when the mouse hovers over a node (device or host)
    • the m parameter is a small object with the node ID, class and type
  • mouseout: invoked when the mouse moves away from a node
  • acceptIntent: a filter function that the overlay uses to declare which intent types it can visualize on the topology view
    • the type parameter is the simple class name of the selected intent
    • the function should return true for intent types that it can handle, false otherwise
  • showIntentshowintent: a special callback invoked if the user selects an intent from the table on the Intent View, and selects this overlay to visualize it
    • the info parameter is a small object containing the identity of the selected intent, (appId, appName, key, intentType)
    • the function should pass this parameter to the business logic, which typically sends an event to the server
    • the server-side code locates the appropriate intent, and generates an appropriate "showHighlights" response to send back to the topology view
    • Refer to the traffic overlay for sample code:

...