Simon Hunt | 94104e7 | 2017-06-13 11:38:55 -0700 | [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 | /* |
Simon Hunt | 94104e7 | 2017-06-13 11:38:55 -0700 | [diff] [blame] | 19 | ONOS GUI -- Lion -- Localization Utilities |
| 20 | */ |
| 21 | (function () { |
| 22 | 'use strict'; |
| 23 | |
| 24 | var $log, fs; |
| 25 | |
Simon Hunt | 083e6fb | 2017-06-16 16:51:41 -0700 | [diff] [blame] | 26 | // returns a lion bundle (function) for the given bundle-key |
| 27 | function bundle(bundleKey) { |
| 28 | var bundle = { |
Simon Hunt | 94104e7 | 2017-06-13 11:38:55 -0700 | [diff] [blame] | 29 | computer: 'Calcolatore', |
| 30 | disk: 'Disco', |
| 31 | monitor: 'Schermo', |
| 32 | keyboard: 'Tastiera' |
| 33 | }; |
| 34 | |
Simon Hunt | 083e6fb | 2017-06-16 16:51:41 -0700 | [diff] [blame] | 35 | if (bundleKey === 'core.view.cluster') { |
| 36 | bundle = { |
Simon Hunt | e556e94 | 2017-06-19 15:35:44 -0700 | [diff] [blame] | 37 | // grouped to match core.view.cluster.lioncfg |
Simon Hunt | 083e6fb | 2017-06-16 16:51:41 -0700 | [diff] [blame] | 38 | title_cluster_nodes: 'Cluster Nodes', |
Simon Hunt | e556e94 | 2017-06-19 15:35:44 -0700 | [diff] [blame] | 39 | k_esc_hint: 'Close the details panel', |
| 40 | k_click_hint: 'Select a row to show cluster node details', |
| 41 | k_scroll_down_hint: 'See available cluster nodes', |
| 42 | |
| 43 | devices: 'Devices', |
Simon Hunt | 083e6fb | 2017-06-16 16:51:41 -0700 | [diff] [blame] | 44 | node_id: 'Node ID', |
| 45 | ip_address: 'IP Address', |
| 46 | tcp_port: 'TCP Port', |
Simon Hunt | 083e6fb | 2017-06-16 16:51:41 -0700 | [diff] [blame] | 47 | uri: 'URI', |
Simon Hunt | e556e94 | 2017-06-19 15:35:44 -0700 | [diff] [blame] | 48 | protocol: 'Protocol', |
| 49 | |
Simon Hunt | 083e6fb | 2017-06-16 16:51:41 -0700 | [diff] [blame] | 50 | type: 'Type', |
| 51 | chassis_id: 'Chassis ID', |
| 52 | vendor: 'Vendor', |
| 53 | hw_version: 'H/W Version', |
| 54 | sw_version: 'S/W Version', |
Simon Hunt | 083e6fb | 2017-06-16 16:51:41 -0700 | [diff] [blame] | 55 | serial_number: 'Serial #', |
Simon Hunt | e556e94 | 2017-06-19 15:35:44 -0700 | [diff] [blame] | 56 | |
| 57 | total: 'Total', |
| 58 | active: 'Active', |
| 59 | started: 'Started', |
| 60 | last_updated: 'Last Updated', |
| 61 | |
| 62 | click: 'click', |
| 63 | scroll_down: 'scroll down' |
Simon Hunt | 083e6fb | 2017-06-16 16:51:41 -0700 | [diff] [blame] | 64 | }; |
| 65 | } |
| 66 | |
| 67 | // TODO: Use message handler mech. to get bundle from server |
| 68 | $log.warn('Using fake bundle', bundle); |
| 69 | |
| 70 | return function (key) { |
| 71 | return bundle[key] || '%' + key + '%'; |
| 72 | }; |
Simon Hunt | 94104e7 | 2017-06-13 11:38:55 -0700 | [diff] [blame] | 73 | } |
| 74 | |
| 75 | angular.module('onosUtil') |
| 76 | .factory('LionService', ['$log', 'FnService', |
| 77 | |
| 78 | function (_$log_, _fs_) { |
| 79 | $log = _$log_; |
| 80 | fs = _fs_; |
| 81 | |
| 82 | return { |
| 83 | bundle: bundle |
| 84 | }; |
| 85 | }]); |
| 86 | }()); |