Paul Greyson | c090d14 | 2013-04-09 16:59:03 -0700 | [diff] [blame] | 1 | function appInit(cb) { |
Paul Greyson | 7a30082 | 2013-04-09 12:57:49 -0700 | [diff] [blame] | 2 | |
| 3 | // populates selected flows with empty rows |
| 4 | updateSelectedFlows(); |
| 5 | |
| 6 | d3.select('#showFlowChooser').on('click', function () { |
| 7 | showFlowChooser(); |
| 8 | }); |
Paul Greyson | c090d14 | 2013-04-09 16:59:03 -0700 | [diff] [blame] | 9 | |
Paul Greyson | e6266b9 | 2013-04-09 23:15:27 -0700 | [diff] [blame] | 10 | d3.select('#action-all').on('click', function () { |
| 11 | var prompt = "Switch controllers to all?" |
Paul Greyson | 28cf92b | 2013-04-10 13:15:06 -0700 | [diff] [blame] | 12 | doConfirm(prompt, function (result) { |
| 13 | if (result) { |
| 14 | switchAll(); |
| 15 | } |
| 16 | }); |
Paul Greyson | e6266b9 | 2013-04-09 23:15:27 -0700 | [diff] [blame] | 17 | }); |
| 18 | |
| 19 | d3.select('#action-local').on('click', function () { |
| 20 | var prompt = "Switch controllers to local?" |
Paul Greyson | 28cf92b | 2013-04-10 13:15:06 -0700 | [diff] [blame] | 21 | doConfirm(prompt, function (result) { |
| 22 | if (result) { |
| 23 | switchLocal(); |
| 24 | } |
| 25 | }); |
Paul Greyson | e6266b9 | 2013-04-09 23:15:27 -0700 | [diff] [blame] | 26 | }); |
| 27 | |
| 28 | d3.select('#action-scale').on('click', function () { |
Paul Greyson | b14d40d | 2013-04-11 12:37:30 -0700 | [diff] [blame] | 29 | var prompt = "Scale network?" |
| 30 | doConfirm(prompt, function (result) { |
| 31 | if (result) { |
| 32 | scaleNetwork(); |
| 33 | } |
| 34 | }); |
Paul Greyson | e6266b9 | 2013-04-09 23:15:27 -0700 | [diff] [blame] | 35 | }); |
| 36 | |
Paul Greyson | 69f8baa | 2013-04-10 12:16:53 -0700 | [diff] [blame] | 37 | d3.select('#action-reset').on('click', function () { |
Paul Greyson | b14d40d | 2013-04-11 12:37:30 -0700 | [diff] [blame] | 38 | var prompt = "Reset network?" |
| 39 | doConfirm(prompt, function (result) { |
| 40 | if (result) { |
| 41 | resetNetwork(); |
| 42 | } |
| 43 | }); |
Paul Greyson | 69f8baa | 2013-04-10 12:16:53 -0700 | [diff] [blame] | 44 | }); |
| 45 | |
Paul Greyson | 0ad7520 | 2013-04-11 12:29:32 -0700 | [diff] [blame] | 46 | d3.select('#action-kill').on('click', function () { |
| 47 | var prompt = "Kill ONOS node?"; |
| 48 | var options = model.activeControllers; |
| 49 | doConfirm(prompt, function (result) { |
| 50 | controllerDown(result); |
| 51 | }, options); |
| 52 | }); |
| 53 | |
Paul Greyson | c090d14 | 2013-04-09 16:59:03 -0700 | [diff] [blame] | 54 | createTopologyView(cb); |
Paul Greyson | 7a30082 | 2013-04-09 12:57:49 -0700 | [diff] [blame] | 55 | } |