GUI -- [ONOS-344] - Ability to disable Details Pane (press the 'D' key).
Change-Id: Icc3ba464f6619745e775978dd0e26874b84c9a7b
Showing
1 changed file
with
35 additions
and
10 deletions
| ... | @@ -142,9 +142,10 @@ | ... | @@ -142,9 +142,10 @@ |
| 142 | 142 | ||
| 143 | O: [toggleSummary, 'Toggle ONOS summary pane'], | 143 | O: [toggleSummary, 'Toggle ONOS summary pane'], |
| 144 | I: [toggleInstances, 'Toggle ONOS instances pane'], | 144 | I: [toggleInstances, 'Toggle ONOS instances pane'], |
| 145 | + D: [toggleDetails, 'Disable / enable details pane'], | ||
| 145 | B: [toggleBg, 'Toggle background image'], | 146 | B: [toggleBg, 'Toggle background image'], |
| 146 | H: [toggleHosts, 'Toggle host visibility'], | 147 | H: [toggleHosts, 'Toggle host visibility'], |
| 147 | - L: [cycleLabels, 'Cycle Device labels'], | 148 | + L: [cycleLabels, 'Cycle device labels'], |
| 148 | P: togglePorts, | 149 | P: togglePorts, |
| 149 | U: [unpin, 'Unpin node (hover mouse over)'], | 150 | U: [unpin, 'Unpin node (hover mouse over)'], |
| 150 | R: [resetZoomPan, 'Reset zoom / pan'], | 151 | R: [resetZoomPan, 'Reset zoom / pan'], |
| ... | @@ -201,7 +202,9 @@ | ... | @@ -201,7 +202,9 @@ |
| 201 | portLabelsOn = false, | 202 | portLabelsOn = false, |
| 202 | cat7 = d3u.cat7(), | 203 | cat7 = d3u.cat7(), |
| 203 | colorAffinity = false, | 204 | colorAffinity = false, |
| 204 | - showHosts = false; | 205 | + showHosts = false, |
| 206 | + useDetails = true, | ||
| 207 | + haveDetails = false; | ||
| 205 | 208 | ||
| 206 | // constants | 209 | // constants |
| 207 | var hoverModeAll = 1, | 210 | var hoverModeAll = 1, |
| ... | @@ -252,6 +255,10 @@ | ... | @@ -252,6 +255,10 @@ |
| 252 | // ============================== | 255 | // ============================== |
| 253 | // Key Callbacks | 256 | // Key Callbacks |
| 254 | 257 | ||
| 258 | + function flash(txt) { | ||
| 259 | + network.view.flash(txt); | ||
| 260 | + } | ||
| 261 | + | ||
| 255 | function testMe(view) { | 262 | function testMe(view) { |
| 256 | //view.alert('Theme is ' + view.getTheme()); | 263 | //view.alert('Theme is ' + view.getTheme()); |
| 257 | //view.flash('This is some text'); | 264 | //view.flash('This is some text'); |
| ... | @@ -320,7 +327,7 @@ | ... | @@ -320,7 +327,7 @@ |
| 320 | function toggleHosts() { | 327 | function toggleHosts() { |
| 321 | showHosts = !showHosts; | 328 | showHosts = !showHosts; |
| 322 | updateHostVisibility(); | 329 | updateHostVisibility(); |
| 323 | - network.view.flash('Hosts ' + visVal(showHosts)); | 330 | + flash('Hosts ' + visVal(showHosts)); |
| 324 | } | 331 | } |
| 325 | 332 | ||
| 326 | function cycleLabels() { | 333 | function cycleLabels() { |
| ... | @@ -350,7 +357,7 @@ | ... | @@ -350,7 +357,7 @@ |
| 350 | function handleEscape(view) { | 357 | function handleEscape(view) { |
| 351 | if (oiShowMaster) { | 358 | if (oiShowMaster) { |
| 352 | cancelAffinity(); | 359 | cancelAffinity(); |
| 353 | - } else if (detailPane.isVisible()) { | 360 | + } else if (haveDetails) { |
| 354 | deselectAll(); | 361 | deselectAll(); |
| 355 | } else if (oiBox.isVisible()) { | 362 | } else if (oiBox.isVisible()) { |
| 356 | hideInstances(); | 363 | hideInstances(); |
| ... | @@ -775,8 +782,11 @@ | ... | @@ -775,8 +782,11 @@ |
| 775 | 782 | ||
| 776 | function showDetails(data) { | 783 | function showDetails(data) { |
| 777 | evTrace(data); | 784 | evTrace(data); |
| 785 | + haveDetails = true; | ||
| 778 | populateDetails(data.payload); | 786 | populateDetails(data.payload); |
| 779 | - showDetailPane(); | 787 | + if (useDetails) { |
| 788 | + showDetailPane(); | ||
| 789 | + } | ||
| 780 | } | 790 | } |
| 781 | 791 | ||
| 782 | function showTraffic(data) { | 792 | function showTraffic(data) { |
| ... | @@ -904,6 +914,19 @@ | ... | @@ -904,6 +914,19 @@ |
| 904 | hideSummaryPane(); | 914 | hideSummaryPane(); |
| 905 | } | 915 | } |
| 906 | 916 | ||
| 917 | + function toggleDetails() { | ||
| 918 | + useDetails = !useDetails; | ||
| 919 | + if (useDetails) { | ||
| 920 | + flash('Enable details pane'); | ||
| 921 | + if (haveDetails) { | ||
| 922 | + showDetailPane(); | ||
| 923 | + } | ||
| 924 | + } else { | ||
| 925 | + flash('Disable details pane'); | ||
| 926 | + hideDetailPane(); | ||
| 927 | + } | ||
| 928 | + } | ||
| 929 | + | ||
| 907 | // encapsulate interaction between summary and details panes | 930 | // encapsulate interaction between summary and details panes |
| 908 | function showSummaryPane() { | 931 | function showSummaryPane() { |
| 909 | if (detailPane.isVisible()) { | 932 | if (detailPane.isVisible()) { |
| ... | @@ -951,7 +974,7 @@ | ... | @@ -951,7 +974,7 @@ |
| 951 | two: selectOrder[1], | 974 | two: selectOrder[1], |
| 952 | ids: selectOrder | 975 | ids: selectOrder |
| 953 | }); | 976 | }); |
| 954 | - network.view.flash('Host-to-Host flow added'); | 977 | + flash('Host-to-Host flow added'); |
| 955 | } | 978 | } |
| 956 | 979 | ||
| 957 | function addMultiSourceIntentAction() { | 980 | function addMultiSourceIntentAction() { |
| ... | @@ -960,7 +983,7 @@ | ... | @@ -960,7 +983,7 @@ |
| 960 | dst: selectOrder[selectOrder.length - 1], | 983 | dst: selectOrder[selectOrder.length - 1], |
| 961 | ids: selectOrder | 984 | ids: selectOrder |
| 962 | }); | 985 | }); |
| 963 | - network.view.flash('Multi-Source flow added'); | 986 | + flash('Multi-Source flow added'); |
| 964 | } | 987 | } |
| 965 | 988 | ||
| 966 | 989 | ||
| ... | @@ -981,7 +1004,7 @@ | ... | @@ -981,7 +1004,7 @@ |
| 981 | function showTrafficAction() { | 1004 | function showTrafficAction() { |
| 982 | hoverMode = hoverModeIntents; | 1005 | hoverMode = hoverModeIntents; |
| 983 | requestSelectTraffic(); | 1006 | requestSelectTraffic(); |
| 984 | - network.view.flash('Related Traffic'); | 1007 | + flash('Related Traffic'); |
| 985 | } | 1008 | } |
| 986 | 1009 | ||
| 987 | function requestSelectTraffic() { | 1010 | function requestSelectTraffic() { |
| ... | @@ -1000,7 +1023,7 @@ | ... | @@ -1000,7 +1023,7 @@ |
| 1000 | function showDeviceLinkFlowsAction() { | 1023 | function showDeviceLinkFlowsAction() { |
| 1001 | hoverMode = hoverModeFlows; | 1024 | hoverMode = hoverModeFlows; |
| 1002 | requestDeviceLinkFlows(); | 1025 | requestDeviceLinkFlows(); |
| 1003 | - network.view.flash('Device Flows'); | 1026 | + flash('Device Flows'); |
| 1004 | } | 1027 | } |
| 1005 | 1028 | ||
| 1006 | function requestDeviceLinkFlows() { | 1029 | function requestDeviceLinkFlows() { |
| ... | @@ -1018,7 +1041,7 @@ | ... | @@ -1018,7 +1041,7 @@ |
| 1018 | function showAllTrafficAction() { | 1041 | function showAllTrafficAction() { |
| 1019 | hoverMode = hoverModeAll; | 1042 | hoverMode = hoverModeAll; |
| 1020 | requestAllTraffic(); | 1043 | requestAllTraffic(); |
| 1021 | - network.view.flash('All Traffic'); | 1044 | + flash('All Traffic'); |
| 1022 | } | 1045 | } |
| 1023 | 1046 | ||
| 1024 | function requestAllTraffic() { | 1047 | function requestAllTraffic() { |
| ... | @@ -2221,6 +2244,7 @@ | ... | @@ -2221,6 +2244,7 @@ |
| 2221 | } | 2244 | } |
| 2222 | 2245 | ||
| 2223 | function emptySelect() { | 2246 | function emptySelect() { |
| 2247 | + haveDetails = false; | ||
| 2224 | hideDetailPane(); | 2248 | hideDetailPane(); |
| 2225 | cancelTraffic(); | 2249 | cancelTraffic(); |
| 2226 | } | 2250 | } |
| ... | @@ -2232,6 +2256,7 @@ | ... | @@ -2232,6 +2256,7 @@ |
| 2232 | } | 2256 | } |
| 2233 | 2257 | ||
| 2234 | function multiSelect() { | 2258 | function multiSelect() { |
| 2259 | + haveDetails = true; | ||
| 2235 | populateMultiSelect(); | 2260 | populateMultiSelect(); |
| 2236 | requestTrafficForMode(); | 2261 | requestTrafficForMode(); |
| 2237 | } | 2262 | } | ... | ... |
-
Please register or login to post a comment