Simon Hunt | 400ebbf | 2017-01-06 20:07:50 -0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2017-present Open Networking Foundation |
Simon Hunt | 400ebbf | 2017-01-06 20:07:50 -0800 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | /* |
| 18 | ONOS GUI -- Widget -- Table Detail Panel Service |
| 19 | */ |
| 20 | (function () { |
| 21 | 'use strict'; |
| 22 | |
| 23 | // injected refs |
Simon Hunt | 5c3ed73 | 2017-07-20 19:03:28 +0000 | [diff] [blame] | 24 | var $log, $interval, $timeout, fs, wss; |
Simon Hunt | 400ebbf | 2017-01-06 20:07:50 -0800 | [diff] [blame] | 25 | |
| 26 | // constants |
| 27 | // var refreshInterval = 2000; |
| 28 | |
| 29 | function noop() {} |
| 30 | |
| 31 | // TODO: describe the input object for the main function |
| 32 | // example params to (functionX): |
| 33 | // { |
| 34 | // ... |
| 35 | // } |
| 36 | function buildBasePanel(opts) { |
| 37 | var popTopF = fs.isF(opts.popTop) || noop, |
| 38 | popMidF = fs.isF(opts.popMid) || noop, |
| 39 | popBotF = fs.isF(opts.popBot) || noop; |
| 40 | |
| 41 | $log.debug('options are', opts); |
| 42 | |
| 43 | // TODO use panel service to create base panel |
| 44 | |
| 45 | // TODO: create divs, and pass into invocations of popTopF(div), etc. |
| 46 | } |
| 47 | |
| 48 | // more functions |
| 49 | |
| 50 | // TODO: add ref to PanelService |
| 51 | angular.module('onosWidget') |
| 52 | .factory('TableDetailService', |
Simon Hunt | 5c3ed73 | 2017-07-20 19:03:28 +0000 | [diff] [blame] | 53 | ['$log', '$interval', '$timeout', 'FnService', 'WebSocketService', |
Simon Hunt | 400ebbf | 2017-01-06 20:07:50 -0800 | [diff] [blame] | 54 | |
Simon Hunt | 5c3ed73 | 2017-07-20 19:03:28 +0000 | [diff] [blame] | 55 | function (_$log_, _$interval_, _$timeout_, _fs_, _wss_) { |
Simon Hunt | 400ebbf | 2017-01-06 20:07:50 -0800 | [diff] [blame] | 56 | $log = _$log_; |
Simon Hunt | 5c3ed73 | 2017-07-20 19:03:28 +0000 | [diff] [blame] | 57 | $interval = _$interval_; |
| 58 | $timeout = _$timeout_; |
Simon Hunt | 400ebbf | 2017-01-06 20:07:50 -0800 | [diff] [blame] | 59 | fs = _fs_; |
Simon Hunt | 5c3ed73 | 2017-07-20 19:03:28 +0000 | [diff] [blame] | 60 | wss = _wss_; |
Simon Hunt | 400ebbf | 2017-01-06 20:07:50 -0800 | [diff] [blame] | 61 | |
| 62 | return { |
Simon Hunt | 5c3ed73 | 2017-07-20 19:03:28 +0000 | [diff] [blame] | 63 | buildBasePanel: buildBasePanel |
Simon Hunt | 400ebbf | 2017-01-06 20:07:50 -0800 | [diff] [blame] | 64 | }; |
| 65 | }]); |
| 66 | }()); |