[ONOS-4136] Implement Partitions View.
show partition info in table format
Change-Id: I5df276ab092715249f97ff118d0012da09789f49
diff --git a/web/gui/src/main/webapp/app/view/partition/partition.css b/web/gui/src/main/webapp/app/view/partition/partition.css
new file mode 100644
index 0000000..1ff0447
--- /dev/null
+++ b/web/gui/src/main/webapp/app/view/partition/partition.css
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2015-present 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 -- Partition View (layout) -- CSS file
+ */
+
+#ov-partition h2 {
+ display: inline-block;
+}
+
+#ov-partition div.ctrl-btns {
+}
+
+#ov-partition td {
+ text-align: center;
+}
+#ov-partition td.right {
+ text-align: right;
+}
+#ov-partition td.bands {
+ text-align: left;
+ padding-left: 36px;
+ opacity: 0.65;
+}
diff --git a/web/gui/src/main/webapp/app/view/partition/partition.html b/web/gui/src/main/webapp/app/view/partition/partition.html
new file mode 100644
index 0000000..06494ed
--- /dev/null
+++ b/web/gui/src/main/webapp/app/view/partition/partition.html
@@ -0,0 +1,44 @@
+<!-- Partition partial HTML -->
+<div id="ov-partition">
+ <div class="tabular-header">
+ <h2>Partitions ({{tableData.length}} total)</h2>
+ <div class="ctrl-btns">
+ <div class="refresh" ng-class="{active: autoRefresh}"
+ icon icon-id="refresh" icon-size="42"
+ tooltip tt-msg="autoRefreshTip"
+ ng-click="toggleRefresh()"></div>
+ </div>
+ </div>
+
+ <div class="summary-list" onos-table-resize>
+ <div class="table-header" onos-sortable-header>
+ <table>
+ <tr>
+ <td colId="name" col-width="100px" sortable>Name </td>
+ <td colId="term" col-width="100px" sortable>Term </td>
+ <td colId="leader" col-width="200px" sortable>Leader </td>
+ <td colId="members" >Members </td>
+ </tr>
+ </table>
+ </div>
+
+ <div class="table-body">
+ <table onos-flash-changes id-prop="name">
+ <tr ng-if="!tableData.length" class="no-data">
+ <td colspan="4">
+ {{annots.no_rows_msg}}
+ </td>
+ </tr>
+
+ <tr ng-repeat="partition in tableData track by $index"
+ ng-class="{selected: partition.name === selId}"
+ ng-repeat-complete row-id="{{partition.name}}">
+ <td>{{partition.name}}</td>
+ <td>{{partition.term}}</td>
+ <td>{{partition.leader}}</td>
+ <td>{{partition.members}}</td>
+ </tr>
+ </table>
+ </div>
+ </div>
+</div>
diff --git a/web/gui/src/main/webapp/app/view/partition/partition.js b/web/gui/src/main/webapp/app/view/partition/partition.js
new file mode 100644
index 0000000..11c9a85
--- /dev/null
+++ b/web/gui/src/main/webapp/app/view/partition/partition.js
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2015-present 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 -- Partition View Module
+ */
+
+(function () {
+ 'use strict';
+
+ angular.module('ovPartition', [])
+ .controller('OvPartitionCtrl',
+ ['$log', '$scope', '$sce', 'FnService', 'TableBuilderService',
+
+ function ($log, $scope, $sce, fs, tbs) {
+ tbs.buildTable({
+ scope: $scope,
+ tag: 'partition'
+ });
+
+ $log.log('OvPartitionCtrl has been created');
+ }]);
+}());
diff --git a/web/gui/src/main/webapp/index.html b/web/gui/src/main/webapp/index.html
index 79542fa..a3b47ca 100644
--- a/web/gui/src/main/webapp/index.html
+++ b/web/gui/src/main/webapp/index.html
@@ -197,6 +197,7 @@
<script src="app/view/port/port.js"></script>
<script src="app/view/group/group.js"></script>
<script src="app/view/meter/meter.js"></script>
+ <script src="app/view/partition/partition.js"></script>
<script src="app/view/link/link.js"></script>
<script src="app/view/host/host.js"></script>
<script src="app/view/intent/intent.js"></script>
@@ -223,6 +224,7 @@
<link rel="stylesheet" href="app/view/group/group-theme.css">
<link rel="stylesheet" href="app/view/meter/meter.css">
<link rel="stylesheet" href="app/view/meter/meter-theme.css">
+ <link rel="stylesheet" href="app/view/partition/partition.css">
<link rel="stylesheet" href="app/view/link/link.css">
<link rel="stylesheet" href="app/view/host/host.css">
<link rel="stylesheet" href="app/view/intent/intent.css">