blob: 23f46493b18bb05f76cbb06660e32d4afa25ee2e [file] [log] [blame]
Paul Greysonc090d142013-04-09 16:59:03 -07001function appInit(cb) {
Paul Greyson7a300822013-04-09 12:57:49 -07002
3 // populates selected flows with empty rows
4 updateSelectedFlows();
5
6 d3.select('#showFlowChooser').on('click', function () {
7 showFlowChooser();
8 });
Paul Greysonc090d142013-04-09 16:59:03 -07009
Paul Greysone6266b92013-04-09 23:15:27 -070010 d3.select('#action-all').on('click', function () {
11 var prompt = "Switch controllers to all?"
Paul Greyson28cf92b2013-04-10 13:15:06 -070012 doConfirm(prompt, function (result) {
13 if (result) {
14 switchAll();
15 }
16 });
Paul Greysone6266b92013-04-09 23:15:27 -070017 });
18
19 d3.select('#action-local').on('click', function () {
20 var prompt = "Switch controllers to local?"
Paul Greyson28cf92b2013-04-10 13:15:06 -070021 doConfirm(prompt, function (result) {
22 if (result) {
23 switchLocal();
24 }
25 });
Paul Greysone6266b92013-04-09 23:15:27 -070026 });
27
28 d3.select('#action-scale').on('click', function () {
29 alert('scale')
30 });
31
Paul Greyson69f8baa2013-04-10 12:16:53 -070032 d3.select('#action-reset').on('click', function () {
33 alert('reset')
34 });
35
Paul Greyson0ad75202013-04-11 12:29:32 -070036 d3.select('#action-kill').on('click', function () {
37 var prompt = "Kill ONOS node?";
38 var options = model.activeControllers;
39 doConfirm(prompt, function (result) {
40 controllerDown(result);
41 }, options);
42 });
43
Paul Greysonc090d142013-04-09 16:59:03 -070044 createTopologyView(cb);
Paul Greyson7a300822013-04-09 12:57:49 -070045}