Yang Model Table View: skeleton code in place.
Change-Id: I836b00674d45ad5a4937bbb6c52be3df178a896e
diff --git a/apps/yms/gui/src/main/resources/app/view/yangModel/yangModel-theme.css b/apps/yms/gui/src/main/resources/app/view/yangModel/yangModel-theme.css
new file mode 100644
index 0000000..afeb601
--- /dev/null
+++ b/apps/yms/gui/src/main/resources/app/view/yangModel/yangModel-theme.css
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2017-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.
+ */
+
diff --git a/apps/yms/gui/src/main/resources/app/view/yangModel/yangModel.css b/apps/yms/gui/src/main/resources/app/view/yangModel/yangModel.css
new file mode 100644
index 0000000..2564c37
--- /dev/null
+++ b/apps/yms/gui/src/main/resources/app/view/yangModel/yangModel.css
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2017-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.
+ */
+
+
+#ov-yang-model h2 {
+ display: inline-block;
+}
+
+#ov-yang-model div.ctrl-btns {
+}
diff --git a/apps/yms/gui/src/main/resources/app/view/yangModel/yangModel.html b/apps/yms/gui/src/main/resources/app/view/yangModel/yangModel.html
new file mode 100644
index 0000000..3860644
--- /dev/null
+++ b/apps/yms/gui/src/main/resources/app/view/yangModel/yangModel.html
@@ -0,0 +1,48 @@
+<!-- YANG Model partial HTML -->
+<div id="ov-yang-model">
+
+ <div class="tabular-header">
+ <h2>YANG Models ({{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="id" col-width="130px" sortable>ID</td>
+ <td colId="type" sortable>Type</td>
+ <!-- TODO: More columns to be added -->
+ </tr>
+ </table>
+ </div>
+
+ <div class="table-body">
+ <table id-prop="id">
+ <tr ng-if="!tableData.length" class="no-data">
+ <!-- TODO: set colspan to the final number of columns -->
+ <td colspan="2">
+ {{annots.no_rows_msg}}
+ </td>
+ </tr>
+
+ <tr ng-repeat="ymodel in tableData track by $index"
+ ng-click="selectCallback($event, ymodel)"
+ ng-class="{selected: ymodel.id === selId}"
+ ng-repeat-complete row-id="{{ymodel.id}}">
+ <td>{{dev.id}}</td>
+ <td>{{dev.type}}</td>
+ <!-- TODO: add more colums here -->
+ </tr>
+ </table>
+ </div>
+ </div>
+
+ <yang-model-details-panel></yang-model-details-panel>
+
+</div>
diff --git a/apps/yms/gui/src/main/resources/app/view/yangModel/yangModel.js b/apps/yms/gui/src/main/resources/app/view/yangModel/yangModel.js
new file mode 100644
index 0000000..226041c
--- /dev/null
+++ b/apps/yms/gui/src/main/resources/app/view/yangModel/yangModel.js
@@ -0,0 +1,98 @@
+/*
+ * Copyright 2017-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 -- YANG Model table view
+ */
+
+(function () {
+ 'use strict';
+
+ // injected refs
+ var $log, $scope, fs, ps, wss;
+
+ // internal state
+ var detailsPanel,
+ ymodel;
+
+ // constants
+ var pName = 'yang-model-details-panel',
+ detailsReq = 'yangModelDetailsRequest',
+ detailsResp = 'yangModelDetailsResponse';
+
+ // callback invoked when data from a details request returns from server
+ function respDetailsCb(data) {
+ $scope.panelData = data.details;
+ ymodel = data.yangModel;
+ $scope.$apply();
+ // TODO: complete the detail panel directive.
+ $log.debug('YANG_MODEL>', detailsResp, data);
+ }
+
+ angular.module('ovYangModel', [])
+ .controller('OvYangModelCtrl', [
+ '$log', '$scope', 'TableBuilderService', 'TableDetailService',
+ 'FnService', 'PanelService', 'WebSocketService',
+
+ function (_$log_, _$scope_, tbs, tds, _fs_, _ps_, _wss_) {
+ var handlers = {};
+
+ $log = _$log_;
+ $scope = _$scope_;
+ fs = _fs_;
+ ps = _ps_;
+ wss = _wss_;
+
+ $scope.panelData = {};
+
+ // register response handler
+ handlers[detailsResp] = respDetailsCb;
+ wss.bindHandlers(handlers);
+
+ // row selection callback
+ function selCb($event, row) {
+ if ($scope.selId) {
+ wss.sendEvent(detailsReq, { id: row.id });
+ } else {
+ $scope.hidePanel();
+ }
+ $log.debug('Got a click on:', row);
+ }
+
+ tbs.buildTable({
+ scope: $scope,
+ tag: 'yangModel',
+ selCb: selCb
+ });
+
+ $scope.$on('$destroy', function () {
+ wss.unbindHandlers(handlers);
+ });
+
+ $log.log('OvYangModelCtrl has been created');
+ }
+ ]);
+
+ // .directive('yangModelDetailsPanel', [
+ // '$rootScope', '$window',
+ // function ($rootScope, $window) {
+ // return function (scope) {
+ // // TODO: details panel internals (see device.js as example
+ // }
+ // }
+ // ]);
+
+}());
\ No newline at end of file
diff --git a/apps/yms/gui/src/main/resources/yangModel/css.html b/apps/yms/gui/src/main/resources/yangModel/css.html
new file mode 100644
index 0000000..b6762b6
--- /dev/null
+++ b/apps/yms/gui/src/main/resources/yangModel/css.html
@@ -0,0 +1,2 @@
+<link rel="stylesheet" href="app/view/yangModel/yangModel.css">
+<link rel="stylesheet" href="app/view/yangModel/yangModel-theme.css">
\ No newline at end of file
diff --git a/apps/yms/gui/src/main/resources/yangModel/js.html b/apps/yms/gui/src/main/resources/yangModel/js.html
new file mode 100644
index 0000000..ff52ac3
--- /dev/null
+++ b/apps/yms/gui/src/main/resources/yangModel/js.html
@@ -0,0 +1 @@
+<script src="app/view/yangModel/yangModel.js"></script>