tree: ec56b6277da823a81868b2d4d9a98cd278edb3c0 [path history] [tgz]
  1. .gitignore
  2. AngularMigration.md
  3. BUCK
  4. README.md
  5. angular.json
  6. doc/
  7. e2e/
  8. karma.conf.js
  9. logger.sh
  10. package-lock.json
  11. package.json
  12. pom.xml
  13. protractor.conf.js
  14. src/
web/gui2/README.md

ONOS GUI 2.0.0

This project is based on Angular 5, as an alternative to the 1.0.0 GUI which was based off AngularJS 1.3.5

To use the new structure on your system, you need to

  1. Change directory in to onos/web/gui - this is where you will run the ng command from.
  2. Run npm install from this folder to add dependencies
  3. Run npm install -g @angular/cli to install the ng command
  4. Run npm install -g @compodoc/compodoc to install Compodoc which can generate documentation
  5. Add the following to your PATH environment variable $ONOS_ROOT/buck-out/gen/web/gui2/node-bin-v8.11.1/node-binaries/bin

This project was generated with Angular CLI version 1.7.4.

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.

Build

The build is handled through the web/gui2/BUCK file. This downloads Node, NPM and Angular CLI It runs ng build and copies everything over in to WEB-INF/classes/dist (there is something weird in BUCK resources - if there is a file in the root dir of the outputted folder this is copied to the sources root directory, where as files are copied to WEB-INF/classes. To get around this I put all the outputted stuff in to dist and it gets copied to /WEB-INF/classes/dist/ )

To start the GUI in a running ONOS at the onos> cli

feature:install onos-gui2

and the gui will be accessible at http://localhost:8181/onos/ui2/dist/

Running unit tests

Run ng test to execute the unit tests via Karma.

Running end-to-end tests

Run ng e2e to execute the end-to-end tests via Protractor.

Generating documentation

Run npm run compodoc to generate documentation via Compodoc

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.