diff options
Diffstat (limited to 'framework/src/onos/web/gui/src/main/webapp/app/view/app')
3 files changed, 0 insertions, 260 deletions
diff --git a/framework/src/onos/web/gui/src/main/webapp/app/view/app/app.css b/framework/src/onos/web/gui/src/main/webapp/app/view/app/app.css deleted file mode 100644 index 9413369a..00000000 --- a/framework/src/onos/web/gui/src/main/webapp/app/view/app/app.css +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2015 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 -- Host View -- CSS file - */ - -#ov-app h2 { - display: inline-block; -} - -#ov-app div.ctrl-btns { - width: 290px; -} - -#ov-app form#inputFileForm, -#ov-app input#uploadFile { - display: none; -} diff --git a/framework/src/onos/web/gui/src/main/webapp/app/view/app/app.html b/framework/src/onos/web/gui/src/main/webapp/app/view/app/app.html deleted file mode 100644 index 85b044fb..00000000 --- a/framework/src/onos/web/gui/src/main/webapp/app/view/app/app.html +++ /dev/null @@ -1,80 +0,0 @@ -<!-- app partial HTML --> -<div id="ov-app"> - <div class="tabular-header"> - <h2>Applications ({{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> - - <form id="inputFileForm"> - <input id="uploadFile" - type="file" size="50" accept=".oar" - file-model="appFile"> - </form> - <div icon icon-size="36" icon-id="plus" - class="active" trigger-form - tooltip tt-msg="uploadTip"> - </div> - <div icon icon-size="36" icon-id="play" - ng-click="appAction('activate')" - tooltip tt-msg="activateTip" - ng-class="{active: ctrlBtnState.installed}"> - </div> - <div icon icon-size="36" icon-id="stop" - ng-click="appAction('deactivate')" - tooltip tt-msg="deactivateTip" - ng-class="{active: ctrlBtnState.active}"> - </div> - <div icon icon-size="36" icon-id="garbage" - ng-click="appAction('uninstall')" - tooltip tt-msg="uninstallTip" - ng-class="{active: ctrlBtnState.selection}"> - </div> - </div> - </div> - - <div class="summary-list" onos-table-resize> - <div ng-show="loading" class="loading-wheel" - icon icon-id="loading" icon-size="75"></div> - - <div class="table-header" onos-sortable-header> - <table> - <tr> - <td colId="state" class="table-icon" sortable></td> - <td colId="id" sortable>App ID </td> - <td colId="version" sortable>Version </td> - <td colId="origin" sortable>Origin </td> - <td colId="desc" col-width="475px">Description </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 Applications found - </td> - </tr> - - <tr ng-repeat="app in tableData track by $index" - ng-click="selectCallback($event, app)" - ng-class="{selected: app.id === selId}" - ng-repeat-complete row-id="{{app.id}}"> - <td class="table-icon"> - <div icon icon-id="{{app._iconid_state}}"></div> - </td> - <td>{{app.id}}</td> - <td>{{app.version}}</td> - <td>{{app.origin}}</td> - <td>{{app.desc}}</td> - </tr> - </table> - </div> - - </div> - -</div> diff --git a/framework/src/onos/web/gui/src/main/webapp/app/view/app/app.js b/framework/src/onos/web/gui/src/main/webapp/app/view/app/app.js deleted file mode 100644 index 7cc081cb..00000000 --- a/framework/src/onos/web/gui/src/main/webapp/app/view/app/app.js +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright 2015 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 -- App View Module - */ - -(function () { - 'use strict'; - - // constants - var INSTALLED = 'INSTALLED', - ACTIVE = 'ACTIVE', - APP_MGMENT_REQ = 'appManagementRequest', - FILE_UPLOAD_URL = 'applications/upload'; - - angular.module('ovApp', []) - .controller('OvAppCtrl', - ['$log', '$scope', '$http', - 'FnService', 'TableBuilderService', 'WebSocketService', 'UrlFnService', - 'KeyService', - - function ($log, $scope, $http, fs, tbs, wss, ufs, ks) { - $scope.ctrlBtnState = {}; - $scope.uploadTip = 'Upload an application (.oar file)'; - $scope.activateTip = 'Activate selected application'; - $scope.deactivateTip = 'Deactivate selected application'; - $scope.uninstallTip = 'Uninstall selected application'; - - function selCb($event, row) { - // selId comes from tableBuilder - $scope.ctrlBtnState.selection = !!$scope.selId; - refreshCtrls(); - } - - function refreshCtrls() { - var row, rowIdx; - if ($scope.ctrlBtnState.selection) { - rowIdx = fs.find($scope.selId, $scope.tableData); - row = rowIdx >= 0 ? $scope.tableData[rowIdx] : null; - - $scope.ctrlBtnState.installed = row && row.state === INSTALLED; - $scope.ctrlBtnState.active = row && row.state === ACTIVE; - } else { - $scope.ctrlBtnState.installed = false; - $scope.ctrlBtnState.active = false; - } - } - - tbs.buildTable({ - scope: $scope, - tag: 'app', - selCb: selCb, - respCb: refreshCtrls - }); - - // TODO: reexamine where keybindings should be - directive or controller? - ks.keyBindings({ - esc: [$scope.selectCallback, 'Deselect app'], - _helpFormat: ['esc'] - }); - ks.gestureNotes([ - ['click row', 'Select / deselect app'], - ['scroll down', 'See more apps'] - ]); - - $scope.appAction = function (action) { - if ($scope.ctrlBtnState.selection) { - $log.debug('Initiating ' + action + ' of ' + $scope.selId); - wss.sendEvent(APP_MGMENT_REQ, { - action: action, - name: $scope.selId, - sortCol: $scope.sortParams.sortCol, - sortDir: $scope.sortParams.sortDir - }); - } - }; - - $scope.$on('FileChanged', function () { - var formData = new FormData(); - if ($scope.appFile) { - formData.append('file', $scope.appFile); - $http.post(ufs.rsUrl(FILE_UPLOAD_URL), formData, { - transformRequest: angular.identity, - headers: { - 'Content-Type': undefined - } - }) - .finally(function () { - $scope.sortCallback($scope.sortParams); - document.getElementById('inputFileForm').reset(); - }); - } - }); - - $scope.$on('$destroy', function () { - ks.unbindKeys(); - }); - - $log.log('OvAppCtrl has been created'); - }]) - - // triggers the input form to appear when button is clicked - .directive('triggerForm', function () { - return { - restrict: 'A', - link: function (scope, elem) { - elem.bind('click', function () { - document.getElementById('uploadFile') - .dispatchEvent(new MouseEvent('click')); - }); - } - }; - }) - - // binds the model file to the scope in scope.appFile - // sends upload request to the server - .directive('fileModel', ['$parse', - function ($parse) { - return { - restrict: 'A', - link: function (scope, elem, attrs) { - var model = $parse(attrs.fileModel), - modelSetter = model.assign; - - elem.bind('change', function () { - scope.$apply(function () { - modelSetter(scope, elem[0].files[0]); - }); - scope.$emit('FileChanged'); - }); - } - }; - }]); -}()); |