Simon Hunt | 400ebbf | 2017-01-06 20:07:50 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017-present Open Networking Laboratory |
| 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 |
| 24 | var $log, $interval, $timeout, fs, wss; |
| 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', |
| 53 | ['$log', '$interval', '$timeout', 'FnService', 'WebSocketService', |
| 54 | |
| 55 | function (_$log_, _$interval_, _$timeout_, _fs_, _wss_) { |
| 56 | $log = _$log_; |
| 57 | $interval = _$interval_; |
| 58 | $timeout = _$timeout_; |
| 59 | fs = _fs_; |
| 60 | wss = _wss_; |
| 61 | |
| 62 | return { |
| 63 | buildBasePanel: buildBasePanel |
| 64 | }; |
| 65 | }]); |
| 66 | }()); |