[ONOS-3642] Add GUI Meter View

This implements the web GUI meter view.
Current implementation uses the group table icon for meter,
and the revised meter icon will be updated in following commit.
See ONOS-3645 for detail.

Change-Id: Iaa2e673ef83024135d757a2aaec1c31a87263217
diff --git a/web/gui/src/main/webapp/app/view/meter/meter.css b/web/gui/src/main/webapp/app/view/meter/meter.css
new file mode 100644
index 0000000..b9e72cd
--- /dev/null
+++ b/web/gui/src/main/webapp/app/view/meter/meter.css
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ ONOS GUI -- Meter View -- CSS file
+ */
+
+#ov-meter h2 {
+    display: inline-block;
+}
+
+#ov-meter div.ctrl-btns {
+}
+
+.light #ov-meter .current-view use {
+    fill: white;
+}
+.dark #ov-meter .current-view use {
+    fill: #304860;
+}
+
+.light #ov-meter .current-view rect {
+    fill: deepskyblue;
+}
+.dark #ov-meter .current-view rect {
+    fill: #eee;
+}
+
+.light #ov-meter tr:nth-child(4n + 1),
+.light #ov-meter tr:nth-child(4n + 2) {
+    background-color: #eee;
+}
+.light #ov-meter tr:nth-child(4n + 3),
+.light #ov-meter tr:nth-child(4n) {
+    background-color: #ddd;
+}
+.dark #ov-meter tr:nth-child(4n + 1),
+.dark #ov-meter tr:nth-child(4n + 2) {
+    background-color: #444;
+}
+.dark #ov-meter tr:nth-child(4n + 3),
+.dark #ov-meter tr:nth-child(4n) {
+    background-color: #333;
+}
+
+/* highlighted color */
+.light #ov-meter tr:nth-child(4n + 1).data-change,
+.light #ov-meter tr:nth-child(4n + 2).data-change,
+.light #ov-meter tr:nth-child(4n + 3).data-change,
+.light #ov-meter tr:nth-child(4n).data-change {
+    background-color: #FDFFDC;
+}
+.dark #ov-meter tr:nth-child(4n + 1).data-change,
+.dark #ov-meter tr:nth-child(4n + 2).data-change,
+.dark #ov-meter tr:nth-child(4n + 3).data-change,
+.dark #ov-meter tr:nth-child(4n).data-change {
+    background-color: #5A5600;
+}
+
+#ov-meter td.bands {
+    padding-left: 36px;
+    opacity: 0.65;
+}
\ No newline at end of file
diff --git a/web/gui/src/main/webapp/app/view/meter/meter.html b/web/gui/src/main/webapp/app/view/meter/meter.html
new file mode 100644
index 0000000..bfa48ca
--- /dev/null
+++ b/web/gui/src/main/webapp/app/view/meter/meter.html
@@ -0,0 +1,79 @@
+<!-- Meter partial HTML -->
+<div id="ov-meter">
+    <div class="tabular-header">
+        <h2>
+            Meters for Device {{devId || "(No device selected)"}}
+            ({{tableData.length}} total)
+        </h2>
+        <div class="ctrl-btns">
+            <div class="refresh" ng-class="{active: autoRefresh}"
+                 icon icon-size="36" icon-id="refresh"
+                 tooltip tt-msg="autoRefreshTip"
+                 ng-click="toggleRefresh()"></div>
+
+            <div class="separator"></div>
+
+            <div class="active"
+                 icon icon-id="deviceTable" icon-size="36"
+                 tooltip tt-msg="deviceTip"
+                 ng-click="nav('device')"></div>
+
+            <div class="active"
+                 icon icon-id="flowTable" icon-size="36"
+                 tooltip tt-msg="flowTip"
+                 ng-click="nav('flow')"></div>
+
+            <div class="active"
+                 icon icon-id="portTable" icon-size="36"
+                 tooltip tt-msg="portTip"
+                 ng-click="nav('port')"></div>
+
+            <div class="active"
+                 icon icon-id="groupTable" icon-size="36"
+                 tooltip tt-msg="groupTip"
+                 ng-click="nav('group')"></div>
+
+            <div class="current-view"
+                 icon icon-id="meterTable" icon-size="36"></div>
+        </div>
+    </div>
+
+    <div class="summary-list" onos-table-resize>
+        <div class="table-header" onos-sortable-header>
+            <table>
+                <tr>
+                    <td colId="id" sortable>Meter ID </td>
+                    <td colId="app_id" sortable>App ID </td>
+                    <td colId="state" sortable>State </td>
+                    <td colId="packets" sortable>Packets </td>
+                    <td colId="bytes" sortable>Bytes </td>
+                </tr>
+            </table>
+        </div>
+
+        <div class="table-body">
+            <table onos-flash-changes id-prop="id">
+                <tr ng-if="!tableData.length" class="no-data">
+                    <td colspan="5">
+                        No Meters found
+                    </td>
+                </tr>
+
+                <tr ng-repeat-start="meter in tableData track by $index"
+                    ng-repeat-complete row-id="{{meter.id}}">
+                    <td>{{meter.id}}</td>
+                    <td>{{meter.app_id}}</td>
+                    <td>{{meter.state}}</td>
+                    <td>{{meter.packets}}</td>
+                    <td>{{meter.bytes}}</td>
+                </tr>
+                <tr row-id="{{meter.id}}" ng-repeat-end>
+                    <td class="bands" colspan="5"
+                        ng-bind-html="meter.bands"></td>
+                </tr>
+            </table>
+        </div>
+
+    </div>
+
+</div>
\ No newline at end of file
diff --git a/web/gui/src/main/webapp/app/view/meter/meter.js b/web/gui/src/main/webapp/app/view/meter/meter.js
new file mode 100644
index 0000000..b2e2607
--- /dev/null
+++ b/web/gui/src/main/webapp/app/view/meter/meter.js
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ ONOS GUI -- Meter View Module
+ */
+(function () {
+    'use strict';
+
+    // injected references
+    var $log, $scope, $location, fs, tbs, ns;
+
+    angular.module('ovMeter', [])
+    .controller('OvMeterCtrl',
+        ['$log', '$scope', '$location', '$sce',
+            'FnService', 'TableBuilderService', 'NavService',
+
+        function (_$log_, _$scope_, _$location_, $sce, _fs_, _tbs_, _ns_) {
+            var params;
+            $log = _$log_;
+            $scope = _$scope_;
+            $location = _$location_;
+            fs = _fs_;
+            tbs = _tbs_;
+            ns = _ns_;
+            $scope.deviceTip = 'Show device table';
+            $scope.flowTip = 'Show flow view for this device';
+            $scope.portTip = 'Show port view for this device';
+            $scope.groupTip = 'Show group view for this device';
+
+            params = $location.search();
+            if (params.hasOwnProperty('devId')) {
+                $scope.devId = params['devId'];
+            }
+
+            tbs.buildTable({
+                scope: $scope,
+                tag: 'meter',
+                query: params
+            });
+
+            $scope.$watch('tableData', function () {
+                if (!fs.isEmptyObject($scope.tableData)) {
+                    $scope.tableData.forEach(function (meter) {
+                        meter.bands = $sce.trustAsHtml(meter.bands);
+                    });
+                }
+            });
+
+            $scope.nav = function (path) {
+                if ($scope.devId) {
+                    ns.navTo(path, { devId: $scope.devId });
+                }
+            };
+
+            $log.log('OvMeterCtrl has been created');
+        }]);
+}());
\ No newline at end of file