diff options
author | 2018-07-10 18:07:44 +0200 | |
---|---|---|
committer | 2018-07-11 16:30:28 -0400 | |
commit | 27fb2d06608fbb070ae2c15a5580a4f5b2423d15 (patch) | |
tree | ccd717991b4e556b67f1fd2cacb345b4d174b41f /sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web | |
parent | 60315525ab5e7c12a9f47c409092e8dba6ad656d (diff) |
Add seed code for sdnr app based on ONF Centennial
At this point in time all the Carbon code from ONF Centennial is added to ONAP.
Later it needs to be refactored and modified for ODL Oxygen.
Change-Id: Iff85dd940c05c3827f1c4e6f9542ecd060c58a46
Issue-ID: SDNC-374
Signed-off-by: demx8as6 <martin.skorupski@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web')
75 files changed, 6070 insertions, 0 deletions
diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/.bowerrc b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/.bowerrc new file mode 100644 index 00000000..1f984984 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/.bowerrc @@ -0,0 +1,5 @@ +{ + "directory": "vendor", + "json": "bower.json" +} + diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/Gruntfile.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/Gruntfile.js new file mode 100644 index 00000000..689a448e --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/Gruntfile.js @@ -0,0 +1,725 @@ +var lrSnippet = require('connect-livereload')();
+var mountFolder = function (connect, dir) {
+ return connect.static(require('path').resolve(dir));
+};
+
+module.exports = function ( grunt ) {
+
+ /**
+ * Load required Grunt tasks. These are installed based on the versions listed
+ * in `package.json` when you do `npm install` in this directory.
+ */
+ grunt.loadNpmTasks('grunt-contrib-clean');
+ grunt.loadNpmTasks('grunt-contrib-copy');
+ grunt.loadNpmTasks('grunt-contrib-jshint');
+ grunt.loadNpmTasks('grunt-contrib-concat');
+ grunt.loadNpmTasks('grunt-contrib-watch');
+ grunt.loadNpmTasks('grunt-contrib-uglify');
+ grunt.loadNpmTasks('grunt-conventional-changelog');
+ grunt.loadNpmTasks('grunt-bump');
+ //grunt.loadNpmTasks('grunt-recess');
+ grunt.loadNpmTasks('grunt-shell');
+ grunt.loadNpmTasks('grunt-karma');
+ grunt.loadNpmTasks('grunt-ng-annotate');
+ grunt.loadNpmTasks('grunt-html2js');
+ grunt.loadNpmTasks('grunt-contrib-less');
+ grunt.loadNpmTasks('grunt-contrib-connect');
+ grunt.loadNpmTasks('grunt-open');
+ grunt.loadNpmTasks('grunt-replace');
+
+ /**
+ * Load in our build configuration file.
+ */
+ var userConfig = require( './build.config.js' );
+
+ var envConfig = {
+
+ replace: {
+ development: {
+ options: {
+ patterns: [
+ {
+ json: grunt.file.readJSON('./config/development.json')
+ }
+ ]
+ },
+ files: [
+ {
+ expand: true,
+ flatten: true,
+ src: ['./config/env.module.js'],
+ dest: 'src/common/config/'
+ }
+ ]
+ },
+ production: {
+ options: {
+ patterns: [
+ {
+ json: grunt.file.readJSON('./config/production.json')
+ }
+ ]
+ },
+ files: [
+ {
+ expand: true,
+ flatten: true,
+ src: ['./config/env.module.js'],
+ dest: 'src/common/config/'
+ }
+ ]
+ }
+ }
+ }
+
+ /**
+ * This is the configuration object Grunt uses to give each plugin its
+ * instructions.
+ */
+ var taskConfig = {
+ /**
+ * We read in our `package.json` file so we can access the package name and
+ * version. It's already there, so we don't repeat ourselves here.
+ */
+ pkg: grunt.file.readJSON("package.json"),
+
+ /**
+ * The banner is the comment that is placed at the top of our compiled
+ * source files. It is first processed as a Grunt template, where the `<%=`
+ * pairs are evaluated based on this very configuration object.
+ */
+ meta: {
+ banner:
+ '/**\n' +
+ ' * <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
+ ' * <%= pkg.homepage %>\n' +
+ ' *\n' +
+ ' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
+ ' * Licensed <%= pkg.licenses.type %> <<%= pkg.licenses.url %>>\n' +
+ ' */\n'
+ },
+
+ /**
+ * Creates a changelog on a new version.
+ */
+ changelog: {
+ options: {
+ dest: 'CHANGELOG.md',
+ template: 'changelog.tpl'
+ }
+ },
+
+ /**
+ * Increments the version number, etc.
+ */
+ bump: {
+ options: {
+ files: [
+ "package.json",
+ "bower.json"
+ ],
+ commit: false,
+ commitMessage: 'chore(release): v%VERSION%',
+ commitFiles: [
+ "package.json",
+ "client/bower.json"
+ ],
+ createTag: false,
+ tagName: 'v%VERSION%',
+ tagMessage: 'Version %VERSION%',
+ push: false,
+ pushTo: 'origin'
+ }
+ },
+
+ /**
+ * The directories to delete when `grunt clean` is executed.
+ */
+ clean: [
+ '<%= build_dir %>',
+ '<%= compile_dir %>'
+ ],
+
+ /**
+ * The `copy` task just copies files from A to B. We use it here to copy
+ * our project assets (images, fonts, etc.) and javascripts into
+ * `build_dir`, and then to copy the assets to `compile_dir`.
+ */
+ copy: {
+ build_app_assets: {
+ files: [
+ {
+ src: [ '**' ],
+ dest: '<%= build_dir %>/assets/',
+ cwd: 'src/assets',
+ expand: true
+ }
+ ]
+ },
+ build_vendor_assets: {
+ files: [
+ {
+ src: [ '<%= vendor_files.assets %>' ],
+ dest: '<%= build_dir %>/assets/',
+ cwd: '.',
+ expand: true,
+ flatten: true
+ }
+ ]
+ },
+ build_appjs: {
+ files: [
+ {
+ src: [ '<%= app_files.js %>', '<%= app_files.css %>', '<%= app_files.lang %>' ],
+ dest: '<%= build_dir %>/',
+ cwd: '.',
+ expand: true
+ }
+ ]
+ },
+ copy_template: {
+ files: [
+ {
+ src: ['<%= app_files.templates %>'],
+ dest: '<%= build_dir %>/',
+ cwd: '.',
+ expand: true
+ }
+ ]
+ },
+ build_vendorjs: {
+ files: [
+ {
+ src: [ '<%= vendor_files.js %>' ],
+ dest: '<%= build_dir %>/',
+ cwd: '.',
+ expand: true
+ }
+ ]
+ },
+ build_appimages: {
+ files: [
+ {
+ src: [ '<%= app_files.images %>' ],
+ dest: '<%= build_dir %>/',
+ cwd: '.',
+ expand: true
+ }
+ ]
+ },
+ build_vendorimages: {
+ files: [
+ {
+ src: [ '<%= vendor_files.images %>' ],
+ dest: '<%= build_dir %>/',
+ cwd: '.',
+ expand: true
+ }
+ ]
+ },
+ build_vendorcss: {
+ files: [
+ {
+ src: [ '<%= vendor_files.css %>' ],
+ dest: '<%= build_dir %>',
+ cwd: '.',
+ expand: true
+ }
+ ]
+ },
+ compile_assets: {
+ files: [
+ {
+ src: [ '**' ],
+ dest: '<%= compile_dir %>/assets',
+ cwd: '<%= build_dir %>/assets',
+ expand: true
+ }
+ ]
+ },
+
+ compile_font: {
+ files: [
+ {
+ src: [ '**' ],
+ dest: '<%= compile_dir %>/font',
+ cwd: '<%= build_dir %>/font',
+ expand: true
+ }
+ ]
+ }
+ },
+
+ /**
+ * `grunt concat` concatenates multiple source files into a single file.
+ */
+ concat: {
+ /**
+ * The `build_css` target concatenates compiled CSS and vendor CSS
+ * together.
+ */
+ build_css: {
+ src: [
+ '<%= vendor_files.css %>',
+ '<%= build_dir %>/assets/<%= pkg.name %>-<%= pkg.version %>.css'
+ ],
+ dest: '<%= build_dir %>/assets/<%= pkg.name %>-<%= pkg.version %>.css'
+ },
+ /**
+ * The `compile_js` target is the concatenation of our application source
+ * code and all specified vendor source code into a single file.
+ */
+ compile_js: {
+ options: {
+ banner: '<%= meta.banner %>'
+ },
+ src: [
+ '<%= vendor_files.js %>',
+ 'module.prefix',
+ '<%= build_dir %>/src/**/*.js',
+ '<%= html2js.common.dest %>',
+ '<%= html2js.app.dest %>',
+ 'module.suffix'
+ ],
+ dest: '<%= compile_dir %>/assets/<%= pkg.name %>-<%= pkg.version %>.js'
+ }
+ },
+
+ /**
+ * `ng-min` annotates the sources before minifying. That is, it allows us
+ * to code without the array syntax.
+ */
+ ngAnnotate: {
+ options: {
+ singleQuotes:true
+ },
+ app: {
+ files: [
+ {
+ src: [ '<%= app_files.js %>' ],
+ cwd: '<%= build_dir %>',
+ dest: '<%= build_dir %>',
+ expand: true
+ }
+ ]
+ }
+ },
+
+ /**
+ * Minify the sources!
+ */
+ uglify: {
+ compile: {
+ options: {
+ banner: '<%= meta.banner %>'
+ },
+ files: {
+ '<%= concat.compile_js.dest %>': '<%= concat.compile_js.dest %>'
+ }
+ }
+ },
+
+ /**
+ * `less` less plugin handles the LESS compilation and minification automatically
+ * this has been changed to the LESS plugin from recess plugin above because of
+ * out of memory issues with the original plugin.
+ */
+
+ less: {
+ development: {
+ options: {
+ paths: ["assets/css"],
+ compress: false,
+ syncImport: true,
+ strictImports: true
+ },
+ files: {
+ '<%= build_dir %>/assets/<%= pkg.name %>-<%= pkg.version %>.css': '<%= app_files.less %>'
+ }
+ },
+ production: {
+ options: {
+ paths: ["assets/css"],
+ compress: true,
+ cleancss: true
+ },
+ files: {
+ '<%= build_dir %>/assets/<%= pkg.name %>-<%= pkg.version %>.css': '<%= app_files.less %>'
+ }
+ }
+ },
+
+ /**
+ * `jshint` defines the rules of our linter as well as which files we
+ * should check. This file, all javascript sources, and all our unit tests
+ * are linted based on the policies listed in `options`. But we can also
+ * specify exclusionary patterns by prefixing them with an exclamation
+ * point (!); this is useful when code comes from a third party but is
+ * nonetheless inside `src/`.
+ */
+ jshint: {
+ src: [
+ '<%= app_files.js %>',
+ '<%= app_files.app_assets %>',
+ ],
+ test: [
+ '<%= app_files.jsunit %>'
+ ],
+ gruntfile: [
+ 'OriginalGruntfile.js'
+ ],
+ options: {
+ curly: true,
+ immed: true,
+ newcap: true,
+ noarg: true,
+ sub: true,
+ boss: true,
+ eqnull: true
+ },
+ globals: {}
+ },
+
+
+ /**
+ * HTML2JS is a Grunt plugin that takes all of your template files and
+ * places them into JavaScript files as strings that are added to
+ * AngularJS's template cache. This means that the templates too become
+ * part of the initial payload as one JavaScript file. Neat!
+ */
+ html2js: {
+ /**
+ * These are the templates from `src/app`.
+ */
+ app: {
+ options: {
+ base: 'src/app'
+ },
+ src: [ '<%= app_files.atpl %>' ],
+ dest: '<%= build_dir %>/templates-app.js'
+ },
+
+ /**
+ * These are the templates from `src/common`.
+ */
+ common: {
+ options: {
+ base: 'src/common'
+ },
+ src: [ '<%= app_files.ctpl %>' ],
+ dest: '<%= build_dir %>/templates-common.js'
+ }
+ },
+
+ /**
+ * The Karma configurations.
+ */
+ karma: {
+ options: {
+ configFile: '<%= build_dir %>/karma-unit.js'
+ },
+ unit: {
+ runnerPort: 9102,
+ background: true,
+ port: 9877 // IMPORTANT!
+ },
+ continuous: {
+ singleRun: true,
+ browsers: ['PhantomJS']
+ }
+ },
+
+ /**
+ * The `index` task compiles the `index.html` file as a Grunt template. CSS
+ * and JS files co-exist here but they get split apart later.
+ */
+ index: {
+
+ /**
+ * During development, we don't want to have wait for compilation,
+ * concatenation, minification, etc. So to avoid these steps, we simply
+ * add all script files directly to the `<head>` of `index.html`. The
+ * `src` property contains the list of included files.
+ */
+ build: {
+ dir: '<%= build_dir %>',
+ src: [
+ '<%= html2js.common.dest %>',
+ '<%= html2js.app.dest %>',
+ '<%= vendor_files.css %>',
+ '<%= build_dir %>/assets/<%= pkg.name %>-<%= pkg.version %>.css'
+ ]
+ },
+
+ /**
+ * When it is time to have a completely compiled application, we can
+ * alter the above to include only a single JavaScript and a single CSS
+ * file. Now we're back!
+ */
+ compile: {
+ dir: '<%= compile_dir %>',
+ src: [
+ '<%= concat.compile_js.dest %>',
+ '<%= concat.build_css.dest %>'
+ //'<%= recess.compile.dest %>'
+ ]
+ }
+ },
+
+ /**
+ * This task compiles the karma template so that changes to its file array
+ * don't have to be managed manually.
+ */
+ karmaconfig: {
+ unit: {
+ dir: '<%= build_dir %>',
+ src: [
+ '<%= vendor_files.js %>',
+ '<%= html2js.app.dest %>',
+ '<%= html2js.common.dest %>',
+ '<%= app_files.js_common %>',
+ '<%= app_files.js_app %>',
+ '<%= app_files.jsunit %>'
+ ]
+ }
+ },
+ connect: {
+ livereload: {
+ options: {
+ port: 9000,
+ hostname: '0.0.0.0',
+ middleware: function (connect) {
+ return [
+ mountFolder(connect, 'build'),
+ lrSnippet
+ ];
+ }
+ }
+ },
+ dev: {
+ options: {
+ hostname: '0.0.0.0',
+ port: 9000,
+ base: 'build'
+ }
+ },
+ prod: {
+ options: {
+ port: 9001,
+ base: 'bin',
+ keepalive: true
+ }
+ }
+ },
+ open: {
+ dev: {
+ path: 'http://127.0.0.1:9000/'
+ },
+ prod: {
+ path: 'http://127.0.0.1:9001/'
+ }
+ },
+ /**
+ * And for rapid development, we have a watch set up that checks to see if
+ * any of the files listed below change, and then to execute the listed
+ * tasks when they do. This just saves us from having to type "grunt" into
+ * the command-line every time we want to see what we're working on; we can
+ * instead just leave "grunt watch" running in a background terminal. Set it
+ * and forget it, as Ron Popeil used to tell us.
+ *
+ * But we don't need the same thing to happen for all the files.
+ */
+ delta: {
+ /**
+ * By default, we want the Live Reload to work for all tasks; this is
+ * overridden in some tasks (like this file) where browser resources are
+ * unaffected. It runs by default on port 35729, which your browser
+ * plugin should auto-detect.
+ */
+ options: {
+ livereload: true
+ },
+
+ /**
+ * When the Gruntfile changes, we just want to lint it. In fact, when
+ * your Gruntfile changes, it will automatically be reloaded!
+ */
+ gruntfile: {
+ files: 'OriginalGruntfile.js',
+ tasks: [ 'jshint:gruntfile' ],
+ options: {
+ livereload: false
+ }
+ },
+
+ /**
+ * When our JavaScript source files change, we want to run lint them and
+ * run our unit tests.
+ */
+ jssrc: {
+ files: [
+ '<%= app_files.js %>', '<%= app_files.lang %>'
+ ],
+ tasks: [ 'jshint:src', 'karma:unit:run', 'copy:build_appjs' ]
+ },
+
+ /**
+ * When assets are changed, copy them. Note that this will *not* copy new
+ * files, so this is probably not very useful.
+ */
+ assets: {
+ files: [
+ 'src/assets/**/*'
+ ],
+ tasks: [ 'copy:build_app_assets' ]
+ },
+
+ /**
+ * When index.html changes, we need to compile it.
+ */
+ html: {
+ files: [ '<%= app_files.html %>' ],
+ tasks: [ 'index:build' ]
+ },
+
+ /**
+ * When our templates change, we only rewrite the template cache.
+ */
+ tpls: {
+ files: [
+ '<%= app_files.atpl %>',
+ '<%= app_files.ctpl %>'
+ ],
+ tasks: ['copy:copy_template']/*[ 'html2js' ]*/
+ },
+
+ /**
+ * When the CSS files change, we need to compile and minify them.
+ */
+ less: {
+ files: [ 'src/**/*.less' ],
+ tasks: [ 'less:development' ]
+ },
+
+ /**
+ * When a JavaScript unit test file changes, we only want to lint it and
+ * run the unit tests. We don't want to do any live reloading.
+ */
+ jsunit: {
+ files: [
+ '<%= app_files.jsunit %>'
+ ],
+ tasks: [ 'jshint:test', 'karma:unit:run' ],
+ options: {
+ livereload: false
+ }
+ }
+ },
+ shell : {
+ requirejs: {
+ command: "node node_modules/requirejs/bin/r.js -o optimize.js"
+ }
+ }
+ };
+
+ grunt.initConfig( grunt.util._.extend( taskConfig, userConfig, envConfig ) );
+
+ /**
+ * In order to make it safe to just compile or copy *only* what was changed,
+ * we need to ensure we are starting from a clean, fresh build. So we rename
+ * the `watch` task to `delta` (that's why the configuration var above is
+ * `delta`) and then add a new task called `watch` that does a clean build
+ * before watching for changes.
+ */
+ grunt.renameTask( 'watch', 'delta' );
+ grunt.registerTask( 'watch', [ 'build', 'karma:unit', 'delta' ] );
+
+ grunt.registerTask('live', ['build', 'connect:dev', 'delta']);
+ /**
+ * The default task is to build and compile.
+ */
+ grunt.registerTask( 'default', [ 'compile' ] );
+
+ /**
+ * The `build` task gets your app ready to run for development and testing.
+ */
+ grunt.registerTask( 'common', [
+ 'clean', 'html2js', 'jshint', 'concat:build_css', 'less:development',
+ 'copy:build_app_assets', 'copy:build_vendor_assets',
+ 'copy:build_appjs', 'copy:copy_template', 'copy:build_vendorimages', 'copy:build_appimages', 'copy:build_vendorjs', 'copy:build_vendorcss', 'karmaconfig', 'index:build'
+ ]);
+
+ grunt.registerTask( 'build', ['replace:development', 'common', 'karma:continuous']);
+
+ /**
+ * The `compile` task gets your app ready for deployment by concatenating and
+ * minifying your code.
+ */
+ grunt.registerTask( 'compile', ['replace:production', 'common', 'karma:continuous', 'ngAnnotate', 'shell:requirejs']);
+
+ /**
+ * A utility function to get all app JavaScript sources.
+ */
+ function filterForJS ( files ) {
+ return files.filter( function ( file ) {
+ return file.match( /\.js$/ );
+ });
+ }
+
+ /**
+ * A utility function to get all app CSS sources.
+ */
+ function filterForCSS ( files ) {
+ return files.filter( function ( file ) {
+ return file.match( /\.css$/ );
+ });
+ }
+
+ /**
+ * The index.html template includes the stylesheet and javascript sources
+ * based on dynamic names calculated in this Gruntfile. This task assembles
+ * the list into variables for the template to use and then runs the
+ * compilation.
+ */
+ grunt.registerMultiTask( 'index', 'Process index.html template', function () {
+ var dirRE = new RegExp( '^('+grunt.config('build_dir')+'|'+grunt.config('compile_dir')+')\/', 'g' );
+ var jsFiles = filterForJS( this.filesSrc ).map( function ( file ) {
+ return file.replace( dirRE, '' );
+ });
+ var cssFiles = filterForCSS( this.filesSrc ).map( function ( file ) {
+ return file.replace( dirRE, '' );
+ });
+
+ grunt.file.copy('src/index.html', this.data.dir + '/index.html', {
+ process: function ( contents, path ) {
+ return grunt.template.process( contents, {
+ data: {
+ scripts: jsFiles,
+ styles: cssFiles,
+ version: grunt.config( 'pkg.version' )
+ }
+ });
+ }
+ });
+ });
+
+ /**
+ * In order to avoid having to specify manually the files needed for karma to
+ * run, we use grunt to manage the list for us. The `karma/*` files are
+ * compiled as grunt templates for use by Karma. Yay!
+ */
+ grunt.registerMultiTask( 'karmaconfig', 'Process karma config templates', function () {
+ var jsFiles = filterForJS( this.filesSrc );
+
+ grunt.file.copy( 'karma/karma-unit.tpl.js', grunt.config( 'build_dir' ) + '/karma-unit.js', {
+ process: function ( contents, path ) {
+ return grunt.template.process( contents, {
+ data: {
+ scripts: jsFiles
+ }
+ });
+ }
+ });
+ });
+
+};
diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/README.md b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/README.md new file mode 100644 index 00000000..776afd97 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/README.md @@ -0,0 +1,53 @@ + + +Create repo-tar-file +tar -zcf ../dluxrepo * + +Reference of bower dependencies Matthias + "dependencies": { + "angular-ui-grid": "4.0.6", + "angular-touch": "1.6.5", + "angular-ui-router": "0.2.18", + "cytoscape": "3.1.1", + "angular-cookies": "1.6.5", + "restangular": "1.6.1", + "jsonformatter": "0.6.0", + "angular-clipboard": "1.6.0", + "@types/angular-clipboard": "1.5.2", + "angular-translate-loader-partial": "2.15.2", + "angular-translate-loader-static-files": "2.15.2", + "angular-css-injector": "1.0.4", + "angular-sanitize": "1.6.5", + "angular-chart.js": "1.1.1", + "chart.js": "2.6.0", + "@types/color-convert": "1.9.0", + "@types/color-name": "1.1.0", + "@types/chart.js": "2.6.7", + "angular-translate": "2.15.2", + "oclazyload": "1.1.0", + "angular-ui-bootstrap": "2.5.0", + "angular-animate": "1.6.5", + "angular": "1.6.5", + "@types/angular": "1.6.32", + "jquery": "3.2.1", + "@types/jquery": "3.2.13", + "lodash": "4.17.4", + "@types/lodash": "4.14.77", + "@types/markdown-it": "0.0.4", + "@types/argparse": "1.0.33", + "@types/sprintf-js": "1.1.0", + "@types/entities": "1.1.0", + "@types/linkify-it": "2.0.2", + "@types/mdurl": "1.0.1", + "@types/is-alphanumerical": "1.0.0", + "@types/trim": "0.1.0", + "@types/node": "9.4.0", + "@types/inherits": "0.0.30", + "@types/xtend": "4.0.2", + "@types/unist": "1.0.0", + "@types/vfile": "2.2.2", + "@types/vfile-location": "2.0.0", + "@types/extend": "3.0.0", + "@types/replace-ext": "0.0.27", + "@types/marked": "0.3.0", + "marked": "0.3.12" diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/bower.json b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/bower.json new file mode 100644 index 00000000..95662abb --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/bower.json @@ -0,0 +1,58 @@ +{ + "name": "opendaylight-dlux", + "version": "0.2.0", + "dependencies": { + "angular": "~1.4.0", + "angular-resource": "~1.4.0", + "angular-cookies": "~1.4.0", + "angular-sanitize": "~1.4.0", + "angular-messages": "~1.4.0", + "angular-animate": "~1.4.0", + "angular-aria": "~1.4.0", + "json3": "~3.2.4", + "jquery": "~1.9.1", + "jquery-ui": "1.11.1", + "es5-shim": "~2.0.8", + "angular-ui-date": "~0.0.11", + "requirejs": "~2.1.14", + "font-awesome": "~4.7.0", + "bootstrap": "~3.0.2", + "angular-ui-router": "~0.2.10", + "angular-ui-utils": "~0.0.3", + "d3": "~3.3.2", + "restangular": "1.4.0", + "angular-ui-select2": "~0.0.5", + "underscore": "~1.8.3", + "underscore.string": "~3.2.1", + "select2": "^3.3.2", + "select2-bootstrap-css": "~1.2.5", + "footable": "2.0.1", + "vis": "2.0.0", + "sigma": "https://github.com/jacomyal/sigma.js/releases/download/v1.0.3/release-v1.0.3.zip", + "ng-slider": "2.2.2", + "zeroclipboard": "~2.2.0", + "ng-clip": "~0.2.6", + "angular-translate": "~2.7.2", + "angular-translate-loader-static-files": "~2.7.2", + "angular-translate-loader-partial": "~2.7.2", + "angular-material": "~1.0.8", + "material-design-icons": "~2.2.3" + }, + "devDependencies": { + "angular": "~1.4.0", + "angular-mocks": "~1.4.0", + "bootstrap": "~3.0.2", + "angular-bootstrap": "~2.5.0", + "ng-grid": "~2.0.7", + "requirejs-domready": "~2.0.1", + "ocLazyLoad": "0.3.0", + "angular-css-injector": "~1.0.3", + "grunt-shell": "~0.7.0" + }, + "resolutions": { + "angular": "~1.4.0", + "angular-translate": "~2.7.2", + "angular-animate": "~1.4.0", + "select2": "^3.3.2" + } +} diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/bower.json.1.6.5 b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/bower.json.1.6.5 new file mode 100644 index 00000000..1c651af8 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/bower.json.1.6.5 @@ -0,0 +1,59 @@ +{ + "name": "opendaylight-dlux", + "version": "0.2.0", + "dependencies": { + "angular": "1.6.5", + "angular-resource": "1.6.5", + "angular-cookies": "1.6.5", + "angular-sanitize": "1.6.5", + "angular-messages": "1.6.5", + "angular-animate": "1.6.5", + "angular-aria": "1.6.5", + "json3": "~3.2.4", + "jquery": "~1.9.1", + "jquery-ui": "1.11.1", + "es5-shim": "~2.0.8", + "angular-ui-date": "~0.0.11", + "requirejs": "~2.1.14", + "font-awesome": "~4.7.0", + "bootstrap": "~3.0.2", + "angular-ui-router": "~0.2.10", + "angular-ui-utils": "~0.0.3", + "d3": "~3.3.2", + "lodash": "4.17.4", + "restangular": "1.6.1", + "angular-ui-select2": "~0.0.5", + "underscore": "~1.8.3", + "underscore.string": "~3.2.1", + "select2": "^3.3.2", + "select2-bootstrap-css": "~1.2.5", + "footable": "2.0.1", + "vis": "2.0.0", + "sigma": "https://github.com/jacomyal/sigma.js/releases/download/v1.0.3/release-v1.0.3.zip", + "ng-slider": "2.2.2", + "zeroclipboard": "~2.2.0", + "ng-clip": "~0.2.6", + "angular-translate": "2.15.2", + "angular-translate-loader-partial": "2.15.2", + "angular-translate-loader-static-files": "2.15.2", + "angular-material": "~1.0.8", + "material-design-icons": "~2.2.3" + }, + "devDependencies": { + "angular": "1.6.5", + "angular-mocks": "1.6.5", + "bootstrap": "~3.0.2", + "angular-bootstrap": "~2.5.0", + "ng-grid": "~2.0.7", + "requirejs-domready": "~2.0.1", + "ocLazyLoad": "0.3.0", + "angular-css-injector": "~1.0.3", + "grunt-shell": "~0.7.0" + }, + "resolutions": { + "angular": "1.6.5", + "angular-translate": "2.15.2", + "angular-animate": "1.6.5", + "select2": "^3.3.2" + } +} diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/bower.json.1.6.5.2 b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/bower.json.1.6.5.2 new file mode 100644 index 00000000..9763bf29 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/bower.json.1.6.5.2 @@ -0,0 +1,58 @@ +{ + "name": "opendaylight-dlux", + "version": "0.2.0", + "dependencies": { + "angular": "~1.6.5", + "angular-resource": "~1.6.5", + "angular-cookies": "~1.6.5", + "angular-sanitize": "~1.6.5", + "angular-messages": "~1.6.5", + "angular-animate": "~1.6.5", + "angular-aria": "~1.6.5", + "json3": "~3.2.4", + "jquery": "~1.9.1", + "jquery-ui": "1.11.1", + "es5-shim": "~2.0.8", + "angular-ui-date": "~0.0.11", + "requirejs": "~2.1.14", + "font-awesome": "~4.7.0", + "bootstrap": "~3.0.2", + "angular-ui-router": "~0.2.10", + "angular-ui-utils": "~0.0.3", + "d3": "~3.3.2", + "restangular": "1.6.1", + "angular-ui-select2": "~0.0.5", + "underscore": "~1.8.3", + "underscore.string": "~3.2.1", + "select2": "^3.3.2", + "select2-bootstrap-css": "~1.2.5", + "footable": "2.0.1", + "vis": "2.0.0", + "sigma": "https://github.com/jacomyal/sigma.js/releases/download/v1.0.3/release-v1.0.3.zip", + "ng-slider": "2.2.2", + "zeroclipboard": "~2.2.0", + "ng-clip": "~0.2.6", + "angular-translate": "~2.15.2", + "angular-translate-loader-partial": "~2.15.2", + "angular-translate-loader-static-files": "~2.15.2", + "angular-material": "~1.0.8", + "material-design-icons": "~2.2.3" + }, + "devDependencies": { + "angular": "~1.6.5", + "angular-mocks": "~1.6.5", + "bootstrap": "~3.0.2", + "angular-bootstrap": "~2.5.0", + "ng-grid": "~2.0.7", + "requirejs-domready": "~2.0.1", + "ocLazyLoad": "0.3.0", + "angular-css-injector": "~1.0.3", + "grunt-shell": "~0.7.0" + }, + "resolutions": { + "angular": "~1.6.5", + "angular-translate": "~2.15.2", + "angular-animate": "~1.6.5", + "select2": "^3.3.2" + } +} diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/bower.json.orig b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/bower.json.orig new file mode 100644 index 00000000..95662abb --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/bower.json.orig @@ -0,0 +1,58 @@ +{ + "name": "opendaylight-dlux", + "version": "0.2.0", + "dependencies": { + "angular": "~1.4.0", + "angular-resource": "~1.4.0", + "angular-cookies": "~1.4.0", + "angular-sanitize": "~1.4.0", + "angular-messages": "~1.4.0", + "angular-animate": "~1.4.0", + "angular-aria": "~1.4.0", + "json3": "~3.2.4", + "jquery": "~1.9.1", + "jquery-ui": "1.11.1", + "es5-shim": "~2.0.8", + "angular-ui-date": "~0.0.11", + "requirejs": "~2.1.14", + "font-awesome": "~4.7.0", + "bootstrap": "~3.0.2", + "angular-ui-router": "~0.2.10", + "angular-ui-utils": "~0.0.3", + "d3": "~3.3.2", + "restangular": "1.4.0", + "angular-ui-select2": "~0.0.5", + "underscore": "~1.8.3", + "underscore.string": "~3.2.1", + "select2": "^3.3.2", + "select2-bootstrap-css": "~1.2.5", + "footable": "2.0.1", + "vis": "2.0.0", + "sigma": "https://github.com/jacomyal/sigma.js/releases/download/v1.0.3/release-v1.0.3.zip", + "ng-slider": "2.2.2", + "zeroclipboard": "~2.2.0", + "ng-clip": "~0.2.6", + "angular-translate": "~2.7.2", + "angular-translate-loader-static-files": "~2.7.2", + "angular-translate-loader-partial": "~2.7.2", + "angular-material": "~1.0.8", + "material-design-icons": "~2.2.3" + }, + "devDependencies": { + "angular": "~1.4.0", + "angular-mocks": "~1.4.0", + "bootstrap": "~3.0.2", + "angular-bootstrap": "~2.5.0", + "ng-grid": "~2.0.7", + "requirejs-domready": "~2.0.1", + "ocLazyLoad": "0.3.0", + "angular-css-injector": "~1.0.3", + "grunt-shell": "~0.7.0" + }, + "resolutions": { + "angular": "~1.4.0", + "angular-translate": "~2.7.2", + "angular-animate": "~1.4.0", + "select2": "^3.3.2" + } +} diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/build.config.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/build.config.js new file mode 100644 index 00000000..9b487f09 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/build.config.js @@ -0,0 +1,134 @@ +/**
+ * This file/module contains all configuration for the build process.
+ */
+module.exports = {
+ /**
+ * The `build_dir` folder is where our projects are compiled during
+ * development and the `compile_dir` folder is where our app resides once it's
+ * completely built.
+ */
+ build_dir: 'build',
+ compile_dir: 'target/generated-resources/pages',
+
+ /**
+ * This is a collection of file patterns that refer to our app code (the
+ * stuff in `src/`). These file paths are used in the configuration of
+ * build tasks. `js` is all project javascript, less tests. `ctpl` contains
+ * our reusable components' (`src/common`) template HTML files, while
+ * `atpl` contains the same, but for our app's code. `html` is just our
+ * main HTML file, `less` is our main stylesheet, and `unit` contains our
+ * app's unit tests.
+ */
+ app_files: {
+ js: [ 'src/**/*.js', '!src/main/**/*.js', '!src/**/*.spec.js', '!src/assets/**/*.js' ],
+ jsunit: [ 'src/**/*.spec.js' ],
+ js_common: [ 'src/common/**/*.js', '!src/common/**/*.spec.js', '!src/common/assets/**/*.js' ],
+ js_app: [ 'src/app/**/*.js', '!src/app/**/*.spec.js', '!src/app/assets/**/*.js' ],
+ app_assets: [ '! src/app/yangui/assets/js/**/*.js', '! src/app/yangman/assets/js/**/*.js' ],
+
+ atpl: [ 'src/app/**/*.tpl.html' ],
+ ctpl: [ 'src/common/**/*.tpl.html' ],
+
+ html: [ 'src/index.html'],
+ less: 'src/less/main.less',
+ css: ['src/app/**/*.css'],
+ lang: ['src/app/**/assets/data/*.json'],
+ templates: ['src/**/*.tpl.html'],
+ images: ['src/app/**/assets/images/*.*']
+ },
+
+ /**
+ * This is a collection of files used during testing only.
+ */
+
+
+ /**
+ * This is the same as `app_files`, except it contains patterns that
+ * reference vendor code (`vendor/`) that we need to place into the build
+ * process somewhere. While the `app_files` property ensures all
+ * standardized files are collected for compilation, it is the user's job
+ * to ensure non-standardized (i.e. vendor-related) files are handled
+ * appropriately in `vendor_files.js`.
+ *
+ * The `vendor_files.js` property holds files to be automatically
+ * concatenated and minified with our project source files.
+ *
+ * The `vendor_files.css` property holds any CSS files to be automatically
+ * included in our app.
+ *
+ * The `vendor_files.assets` property holds any assets to be copied along
+ * with our app's assets. This structure is flattened, so it is not
+ * recommended that you use wildcards.
+ */
+ vendor_files: {
+ js: [
+ 'vendor/vis/dist/vis.min.js',
+ 'vendor/jquery/jquery.min.js',
+ 'vendor/jquery/jquery.min.map',
+ 'vendor/jquery-ui/jquery-ui.min.js',
+ 'vendor/bootstrap/js/dropdown.js',
+ 'vendor/angular/angular.js',
+ 'vendor/requirejs/requirejs.js',
+ 'vendor/ocLazyLoad/dist/ocLazyLoad.js',
+ 'vendor/angular-css-injector/angular-css-injector.js',
+ 'vendor/angular-route/angular-route.js',
+ 'vendor/angular-bootstrap/ui-bootstrap-tpls.min.js',
+ 'vendor/placeholders/angular-placeholders-0.0.1-SNAPSHOT.min.js',
+ 'vendor/angular-ui-router/release/angular-ui-router.js',
+ 'vendor/angular-ui-utils/modules/route/route.js',
+ 'vendor/angular-cookies/angular-cookies.min.js',
+ 'vendor/angular-mocks/angular-mocks.js',
+ 'vendor/requirejs/require.js',
+ 'vendor/angular-ui-select2/index.js',
+ 'vendor/ng-grid/build/ng-grid.min.js',
+ 'vendor/restangular/dist/restangular.min.js',
+ 'vendor/underscore/underscore.js',
+ 'vendor/underscore.string/dist/underscore.string.min.js',
+ 'vendor/d3/d3.min.js',
+ 'vendor/select2/select2.js',
+ 'vendor/footable/dist/footable.min.js',
+ 'vendor/footable/dist/footable.paginate.min.js',
+ 'vendor/footable/dist/footable.sort.min.js',
+ 'vendor/angular-translate/angular-translate.min.js',
+ 'vendor/angular-sanitize/angular-sanitize.min.js',
+ 'vendor/angular-translate-loader-static-files/angular-translate-loader-static-files.min.js',
+ 'vendor/ng-slider/dist/ng-slider.min.js',
+ 'vendor/sigma/sigma.min.js',
+ 'vendor/sigma/plugins/sigma.parsers.gexf.min.js',
+ 'vendor/sigma/plugins/sigma.layout.forceAtlas2.min.js',
+ 'vendor/sigma/plugins/sigma.plugins.dragNodes.min.js',
+ 'vendor/sigma/plugins/sigma.renderers.customShapes.min.js',
+ 'vendor/ng-clip/src/ngClip.js',
+ 'vendor/zeroclipboard/dist/ZeroClipboard.js',
+ 'vendor/angular-translate-loader-partial/angular-translate-loader-partial.js',
+ 'vendor/angular-animate/angular-animate.min.js',
+ 'vendor/angular-aria/angular-aria.min.js',
+ 'vendor/angular-material/angular-material.min.js',
+ 'vendor/angular-messages/angular-messages.min.js',
+ ],
+ css: [
+ 'vendor/ng-grid/ng-grid.min.css',
+ 'vendor/select2/select2.css',
+ 'vendor/select2-bootstrap-css/select2-bootstrap.css',
+ 'vendor/footable/css/footable.core.min.css',
+ 'vendor/footable/css/footable.standalone.min.css',
+ 'vendor/vis/dist/vis.min.css',
+ 'vendor/ng-slider/dist/css/ng-slider.min.css',
+ 'vendor/angular-material/angular-material.css',
+ 'vendor/material-design-icons/iconfont/*',
+ ],
+ images: [
+ 'vendor/select2/select2.png',
+ 'vendor/select2/select2-spinner.gif',
+ 'vendor/select2/select2x2.png'
+ ],
+ assets: [
+ 'vendor/zeroclipboard/dist/ZeroClipboard.swf',
+ ],
+ font: [
+ 'vendor/font-awesome/font/*',
+ 'vendor/footable/css/fonts/*',
+
+ ]
+ }
+};
diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/clean b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/clean new file mode 100755 index 00000000..adc2028c --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/clean @@ -0,0 +1,7 @@ +#!/bin/bash + +# Extendd clean of DLUX if working on different angular versionsA +# To be executed in dlux-web root + +rm -r target node_modules node_modules build vendor +rm -r src/app src/assets src/common diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/config/development.json b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/config/development.json new file mode 100644 index 00000000..a0f2aceb --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/config/development.json @@ -0,0 +1,6 @@ +{ + "configEnv":"ENV_DEV", + "baseURL": "http://localhost:", + "adSalPort": "8080", + "mdSalPort" : "8181" +} diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/config/env.module.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/config/env.module.js new file mode 100644 index 00000000..e4504d59 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/config/env.module.js @@ -0,0 +1,37 @@ +define(['angular'], function (angular) { + 'use strict'; + + var config = angular.module('config', []) + .constant('ENV', { + + baseURL: '@@baseURL', + adSalPort: '@@adSalPort', + mdSalPort: '@@mdSalPort', + mdSalSecuredPort: '@@mdSalSecuredPort', + configEnv: '@@configEnv', + getBaseURL: function (salType) { + if (salType !== undefined) { + var urlPrefix = ''; + if (this.configEnv === 'ENV_DEV') { + urlPrefix = this.baseURL; + } else { + urlPrefix = window.location.protocol + '//' + window.location.hostname + ':'; + } + + if (salType === 'AD_SAL') { + return urlPrefix + this.adSalPort; + } else if (salType === 'MD_SAL') { + var basePort = this.mdSalPort; + if (window.location.protocol === 'https:') { + basePort = this.mdSalSecuredPort; + } + return urlPrefix + basePort; + } + } + //default behavior + return ''; + } + }); + + return config; +}); diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/config/production.json b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/config/production.json new file mode 100644 index 00000000..3d77470b --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/config/production.json @@ -0,0 +1,7 @@ +{ + "configEnv":"ENV_PROD", + "baseURL": "", + "adSalPort": "8080", + "mdSalPort" : "8181", + "mdSalSecuredPort" : "8443" +} diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/karma/karma-unit.tpl.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/karma/karma-unit.tpl.js new file mode 100644 index 00000000..3e2142e9 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/karma/karma-unit.tpl.js @@ -0,0 +1,63 @@ +module.exports = function ( karma ) { + karma.set({ + /** + * From where to look for files, starting with the location of this file. + */ + basePath: '../', + + /** + * This is the list of file patterns to load into the browser during testing. + */ + files: [ + 'src/test-main.js', + {pattern: 'vendor/**/*.js', included: false}, + {pattern: 'src/**/*.js', included: false}, + {pattern: 'src/**/*.js', included: false} + ], + exclude: [ + 'src/assets/**/*.js' + ], + frameworks: [ 'jasmine', 'requirejs' ], + plugins: [ 'karma-jasmine', 'karma-coverage', 'karma-requirejs', 'karma-firefox-launcher', 'karma-chrome-launcher', 'karma-phantomjs-launcher', 'karma-coffee-preprocessor' ], + + preprocessors: { + '**/*.coffee': 'coffee', + }, + + /** + * How to report, by default. + */ + reporters: 'dots', + + /** + * On which port should the browser connect, on which port is the test runner + * operating, and what is the URL path for the browser to use. + */ + port: 9018, + runnerPort: 9101, + urlRoot: '/', + + /** + * Disable file watching by default. + */ + autoWatch: false, + singleRun: false, + /** + * The list of browsers to launch to test on. This includes only "Firefox" by + * default, but other browser names include: + * Chrome, ChromeCanary, Firefox, Opera, Safari, PhantomJS + * + * Note that you can also use the executable name of the browser, like "chromium" + * or "firefox", but that these vary based on your operating system. + * + * You may also leave this blank and manually navigate your browser to + * http://localhost:9018/ when you're running tests. The window/tab can be left + * open and the tests will automatically occur there during the build. This has + * the aesthetic advantage of not launching a browser every time you save. + */ + browsers: [ + 'Chrome' + ] + }); +}; + diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/module.prefix b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/module.prefix new file mode 100644 index 00000000..c52d9b72 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/module.prefix @@ -0,0 +1 @@ +(function ( window, angular, undefined ) { diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/module.suffix b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/module.suffix new file mode 100644 index 00000000..f6354bac --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/module.suffix @@ -0,0 +1 @@ +})( window, window.angular ); diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/optimize.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/optimize.js new file mode 100644 index 00000000..90aa2c52 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/optimize.js @@ -0,0 +1,30 @@ +({ + appDir: "build/", + mainConfigFile: "src/main.js", + baseUrl: "src", + dir: "target/generated-resources/pages", + removeCombined: true, + findNestedDependencies: true, + modules: [ + { + name: "main", + exclude: [ + "angular", + "ui-bootstrap", + "Restangular", + "underscore", + "angular-ui-router", + "angular-css-injector", + "angular-cookies", + "angular-translate", + "angular-translate-loader-static-files", + "jquery", + "footable", + "d3", + "vis", + "ocLazyLoad" + ] + } + ] + +}) diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/package.json b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/package.json new file mode 100644 index 00000000..fb4325a0 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/package.json @@ -0,0 +1,67 @@ +{ + "author": "Mathieu Lemay", + "name": "opendaylight-dlux", + "description": "openDayLight User eXperience", + "version": "0.2.0", + "homepage": "http://opendaylight.org", + "license": "EPL-1.0", + "bugs": "https://bugs.opendaylight.org/", + "repository": { + "type": "git", + "url": "https://git.opendaylight.org/gerrit/dlux.git" + }, + "dependencies": {}, + "devDependencies": { + "bower": "~1.3.12", + "karma":"~0.12.0", + "grunt": "~0.4.5", + "grunt-cli": "~0.1.13", + "grunt-contrib-copy": "~0.4.1", + "grunt-contrib-concat": "~0.3.0", + "grunt-contrib-coffee": "~0.7.0", + "grunt-contrib-uglify": "~0.2.0", + "grunt-contrib-compass": "~0.3.0", + "grunt-contrib-jshint": "~0.8.0", + "grunt-contrib-cssmin": "~0.6.0", + "grunt-contrib-connect": "~0.3.0", + "grunt-contrib-clean": "~0.4.1", + "grunt-contrib-htmlmin": "~0.1.3", + "grunt-contrib-imagemin": "~0.1.4", + "grunt-contrib-watch": "~0.6.1", + "grunt-usemin": "~0.1.11", + "grunt-svgmin": "~0.2.0", + "grunt-rev": "~0.1.0", + "grunt-karma": "~0.8.0", + "grunt-open": "~0.2.0", + "grunt-concurrent": "~0.3.0", + "matchdep": "~0.1.2", + "connect-livereload": "~0.2.0", + "grunt-google-cdn": "~0.2.0", + "connect-modrewrite": "~0.5.4", + "grunt-recess": "~0.5.0", + "grunt-contrib-less": "~0.8.2", + "grunt-conventional-changelog": "~1.0.0", + "grunt-bump": "0.0.13", + "grunt-html2js": "~0.2.4", + "grunt-coffeelint": "0.0.8", + "requirejs": "~2.1.19", + "karma-requirejs": "~0.2.2", + "grunt-shell": "~0.7.0", + "grunt-ng-annotate": "~0.3.2", + "grunt-replace": "~0.7.8", + "karma-chrome-launcher": "~0.1.4", + "karma-firefox-launcher": "~0.1.3", + "karma-jasmine": "~0.1.5", + "karma-coffee-preprocessor": "~0.2.1", + "karma-coverage": "~0.2.6", + "karma-phantomjs-launcher": "~0.1.4", + "angular-mocks": "~1.2.22", + "jasmine": "~2.0.1" + }, + "engines": { + "node": ">=0.8.0" + }, + "scripts": { + "test": "grunt test" + } +} diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/pom.xml b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/pom.xml new file mode 100644 index 00000000..1b92c39e --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/pom.xml @@ -0,0 +1,211 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <parent>
+ <groupId>org.opendaylight.dlux</groupId>
+ <artifactId>dlux-parent</artifactId>
+ <version>0.5.1-Carbon</version>
+ <relativePath>..</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.opendaylight.dlux</groupId>
+ <artifactId>dlux-web</artifactId>
+ <name>DLUX - DLUX Static Web</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.dlux</groupId>
+ <artifactId>dlux.common.navigation.resources</artifactId>
+ <version>${common.navigation.resources.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.dlux</groupId>
+ <artifactId>dlux.common.layout.resources</artifactId>
+ <version>${common.layout.resources.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.dlux</groupId>
+ <artifactId>dlux.common.authentication.resources</artifactId>
+ <version>${common.authentication.resources.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.dlux</groupId>
+ <artifactId>dlux.common.login.resources</artifactId>
+ <version>${common.login.resources.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.dlux</groupId>
+ <artifactId>dlux.common.general.resources</artifactId>
+ <version>${common.general.resources.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.dlux</groupId>
+ <artifactId>dlux.loader.resources</artifactId>
+ <version>${loader.resources.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.dlux</groupId>
+ <artifactId>dlux.core.resources</artifactId>
+ <version>${core.resources.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.dlux</groupId>
+ <artifactId>dlux.common.topbar.resources</artifactId>
+ <version>${common.topbar.resources.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>target/generated-resources</directory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </resource>
+ </resources>
+ <plugins>
+ <!--Clean extracted resources-->
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>2.5</version>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>src</directory>
+ <includes>
+ <include>test-main.js</include>
+ <include>index.html</include>
+ <include>main.js</include>
+ <include>app/app.controller.js</include>
+ <include>app/app.module.js</include>
+ <include>app/routingConfig.js</include>
+ <include>app/core/</include>
+ <include>app/graph/</include>
+ <include>common/navigation/</include>
+ <include>common/layout/</include>
+ <include>common/authentification/</include>
+ <include>common/login/</include>
+ <include>common/general/</include>
+ <include>common/topbar/</include>
+ <include>assets/</include>
+ </includes>
+ <excludes></excludes>
+ <followSymlinks>false</followSymlinks>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <!--src/app/ Resources-->
+ <execution>
+ <id>unpack-core-resources</id>
+ <goals>
+ <goal>unpack-dependencies</goal>
+ </goals>
+ <phase>generate-sources</phase>
+ <configuration>
+ <outputDirectory>${project.basedir}/src/app/</outputDirectory>
+ <groupId>org.opendaylight.dlux</groupId>
+ <includeArtifactIds>
+ dlux.core.resources,
+ </includeArtifactIds>
+ <excludes>META-INF\/**</excludes>
+ <excludeTransitive>true</excludeTransitive>
+ <ignorePermissions>false</ignorePermissions>
+ </configuration>
+ </execution>
+ <!--src/common Resources-->
+ <execution>
+ <id>unpack-general-resources</id>
+ <goals>
+ <goal>unpack-dependencies</goal>
+ </goals>
+ <phase>generate-sources</phase>
+ <configuration>
+ <outputDirectory>${project.basedir}/src/common/</outputDirectory>
+ <groupId>org.opendaylight.dlux</groupId>
+ <includeArtifactIds>
+ dlux.common.navigation.resources,
+ dlux.common.layout.resources,
+ dlux.common.authentication.resources,
+ dlux.common.login.resources,
+ dlux.common.general.resources,
+ dlux.common.topbar.resources,
+ </includeArtifactIds>
+ <excludes>META-INF\/**</excludes>
+ <excludeTransitive>true</excludeTransitive>
+ <ignorePermissions>false</ignorePermissions>
+ </configuration>
+ </execution>
+ <!--loader Resources-->
+ <execution>
+ <id>unpack-loader-resources</id>
+ <goals>
+ <goal>unpack-dependencies</goal>
+ </goals>
+ <phase>generate-sources</phase>
+ <configuration>
+ <outputDirectory>${project.basedir}/src/</outputDirectory>
+ <groupId>org.opendaylight.dlux</groupId>
+ <includeArtifactIds>dlux.loader.resources</includeArtifactIds>
+ <excludes>META-INF\/**</excludes>
+ <excludeTransitive>true</excludeTransitive>
+ <ignorePermissions>false</ignorePermissions>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>com.github.eirslett</groupId>
+ <artifactId>frontend-maven-plugin</artifactId>
+ <version>0.0.24</version>
+ <executions>
+ <execution>
+ <id>npm</id>
+ <goals>
+ <goal>install-node-and-npm</goal>
+ <goal>npm</goal>
+ </goals>
+ <phase>generate-resources</phase>
+ </execution>
+ <execution>
+ <id>bower</id>
+ <goals>
+ <goal>bower</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>grunt</id>
+ <goals>
+ <goal >grunt</goal>
+ </goals>
+ <configuration>
+ <!-- optional: if not specified, it will run Grunt's default
+ task (and you can remove this whole <configuration> section.) -->
+ <arguments>--force</arguments>
+ </configuration>
+
+ </execution>
+ </executions>
+ <configuration>
+ <nodeVersion>v0.12.7</nodeVersion>
+ <npmVersion>3.1.3</npmVersion>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/README.md b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/README.md new file mode 100644 index 00000000..7391578f --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/README.md @@ -0,0 +1,51 @@ +# OpenDaylight DLUX
+
+OpenDaylight DLUX is a Javascript-based stateless user interface that communicates with the service backend to provide a consistent and user-friendly interface to interact with OpenDaylight projects and base controller.
+
+
+## Build DLUX code with Karaf feature and distribution
+
+All necessary modules mentioned above such as nodesjs, bower etc. will be installed automatically, when you run the dlux build for first time. Run following command at dlux home directory /dlux to build dlux feature and distribution along with code.
+Once successful, It will make dlux feature available to install and also create dlux karaf distribution. You can find karaf distribution at dlux/distribution-dlux.
+
+ $ mvn clean install
+
+__NOTE__: Some people reported about node related error while maven build. Those errors are usually environment related, mostly happens because of the permission issues or node is not installed properly. Try to reinstall node manually.
+
+### Install NodeJS manually if needed
+
+__For Windows and Mac without brew:__
+
+ Go to http://www.nodejs.org
+ Download and install NodeJS
+
+__For Mac with brew installed:__
+
+ $ brew update
+ $ brew install node
+
+__Verify NodeJS is installed:__
+
+ $ npm --version
+
+__Run DLUX in karaf distribution__
+
+Once you have dlux distribution or you have karaf distribution from integration repository. You can turn on the dlux feature to access the UI.
+We will take example of dlux distribution here. Navigate to directory dlux/distribution-dlux/target/assembly/bin and start the karaf via following command -
+
+ ./karaf
+
+On the karaf shell, install dlux core feature via running following command -
+
+ feature:install odl-dlux-core
+
+
+It will internally install odl-restconf and dlux topology application along with core dlux components. once this feature is successfully installed.
+Access the dlux UI at __http://localhost:8181/index.html__. Default credentials are admin/admin for login.
+
+All the applications in dlux are now karaf features. You can install other dlux applications such as nodes, yang-ui from karaf console using commands such as
+
+ feature:install odl-dlux-node
+ feature:install odl-dlux-yangui
+
+For more details - follow the wiki at [dlux opendaylight](https://wiki.opendaylight.org/view/OpenDaylight_dlux:Getting_started)
diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/app/LICENSE b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/app/LICENSE new file mode 100644 index 00000000..82d2ab25 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/app/LICENSE @@ -0,0 +1,208 @@ +Eclipse Public License - v 1.0 + +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC +LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM +CONSTITUTES RECIPIENT’S ACCEPTANCE OF THIS AGREEMENT. + +1. DEFINITIONS + +"Contribution" means: + +a) in the case of the initial Contributor, the initial code and documentation +distributed under this Agreement, and +b) in the case of each subsequent Contributor: + +i) changes to the Program, and + +ii) additions to the Program; + +where such changes and/or additions to the Program originate from and are +distributed by that particular Contributor. A Contribution 'originates' from a +Contributor if it was added to the Program by such Contributor itself or anyone +acting on such Contributor’s behalf. Contributions do not include additions to +the Program which: (i) are separate modules of software distributed in +conjunction with the Program under their own license agreement, and (ii) are not +derivative works of the Program. + +"Contributor" means any person or entity that distributes the Program. + +"Licensed Patents " mean patent claims licensable by a Contributor which are +necessarily infringed by the use or sale of its Contribution alone or when +combined with the Program. + +"Program" means the Contributions distributed in accordance with this Agreement. + +"Recipient" means anyone who receives the Program under this Agreement, +including all Contributors. + +2. GRANT OF RIGHTS + +a) Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide, royalty-free copyright license to +reproduce, prepare derivative works of, publicly display, publicly perform, +distribute and sublicense the Contribution of such Contributor, if any, and such +derivative works, in source code and object code form. + +b) Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed +Patents to make, use, sell, offer to sell, import and otherwise transfer the +Contribution of such Contributor, if any, in source code and object code form. +This patent license shall apply to the combination of the Contribution and the +Program if, at the time the Contribution is added by the Contributor, such +addition of the Contribution causes such combination to be covered by the +Licensed Patents. The patent license shall not apply to any other combinations +which include the Contribution. No hardware per se is licensed hereunder. + +c) Recipient understands that although each Contributor grants the licenses to +its Contributions set forth herein, no assurances are provided by any +Contributor that the Program does not infringe the patent or other intellectual +property rights of any other entity. Each Contributor disclaims any liability to +Recipient for claims brought by any other entity based on infringement of +intellectual property rights or otherwise. As a condition to exercising the +rights and licenses granted hereunder, each Recipient hereby assumes sole +responsibility to secure any other intellectual property rights needed, if any. +For example, if a third party patent license is required to allow Recipient to +distribute the Program, it is Recipient’s responsibility to acquire that license +before distributing the Program. + +d) Each Contributor represents that to its knowledge it has sufficient copyright +rights in its Contribution, if any, to grant the copyright license set forth in +this Agreement. + +3. REQUIREMENTS + +A Contributor may choose to distribute the Program in object code form under its +own license agreement, provided that: + +a) it complies with the terms and conditions of this Agreement; and + +b) its license agreement: + +i) effectively disclaims on behalf of all Contributors all warranties and +conditions, express and implied, including warranties or conditions of title and +non-infringement, and implied warranties or conditions of merchantability and +fitness for a particular purpose; + +ii) effectively excludes on behalf of all Contributors all liability for +damages, including direct, indirect, special, incidental and consequential +damages, such as lost profits; + +iii) states that any provisions which differ from this Agreement are offered by +that Contributor alone and not by any other party; and + +iv) states that source code for the Program is available from such Contributor, +and informs licensees how to obtain it in a reasonable manner on or through a +medium customarily used for software exchange. + +When the Program is made available in source code form: + +a) it must be made available under this Agreement; and +b) a copy of this Agreement must be included with each copy of the Program. + +Contributors may not remove or alter any copyright notices contained within the +Program. + +Each Contributor must identify itself as the originator of its Contribution, if +any, in a manner that reasonably allows subsequent Recipients to identify the +originator of the Contribution. + +4. COMMERCIAL DISTRIBUTION + +Commercial distributors of software may accept certain responsibilities with +respect to end users, business partners and the like. While this license is +intended to facilitate the commercial use of the Program, the Contributor who +includes the Program in a commercial product offering should do so in a manner +which does not create potential liability for other Contributors. Therefore, if +a Contributor includes the Program in a commercial product offering, such +Contributor ("Commercial Contributor") hereby agrees to defend and indemnify +every other Contributor ("Indemnified Contributor") against any losses, damages +and costs (collectively "Losses") arising from claims, lawsuits and other legal +actions brought by a third party against the Indemnified Contributor to the +extent caused by the acts or omissions of such Commercial Contributor in +connection with its distribution of the Program in a commercial product +offering. The obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. In order +to qualify, an Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial Contributor to +control, and cooperate with the Commercial Contributor in, the defense and any +related settlement negotiations. The Indemnified Contributor may participate in +any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial product +offering, Product X. That Contributor is then a Commercial Contributor. If that +Commercial Contributor then makes performance claims, or offers warranties +related to Product X, those performance claims and warranties are such +Commercial Contributor’s responsibility alone. Under this section, the +Commercial Contributor would have to defend claims against the other +Contributors related to those performance claims and warranties, and if a court +requires any other Contributor to pay any damages as a result, the Commercial +Contributor must pay those damages. + +5. NO WARRANTY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR +IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, +NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each +Recipient is solely responsible for determining the appropriateness of using and +distributing the Program and assumes all risks associated with its exercise of +rights under this Agreement , including but not limited to the risks and costs +of program errors, compliance with applicable laws, damage to or loss of data, +programs or equipment, and unavailability or interruption of operations. + +6. DISCLAIMER OF LIABILITY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY +CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST +PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS +GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. GENERAL + +If any provision of this Agreement is invalid or unenforceable under applicable +law, it shall not affect the validity or enforceability of the remainder of the +terms of this Agreement, and without further action by the parties hereto, such +provision shall be reformed to the minimum extent necessary to make such +provision valid and enforceable. + +If Recipient institutes patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Program itself +(excluding combinations of the Program with other software or hardware) +infringes such Recipient’s patent(s), then such Recipient’s rights granted under +Section 2(b) shall terminate as of the date such litigation is filed. + +All Recipient’s rights under this Agreement shall terminate if it fails to +comply with any of the material terms or conditions of this Agreement and does +not cure such failure in a reasonable period of time after becoming aware of +such noncompliance. If all Recipient’s rights under this Agreement terminate, +Recipient agrees to cease use and distribution of the Program as soon as +reasonably practicable. However, Recipient’s obligations under this Agreement +and any licenses granted by Recipient relating to the Program shall continue and +survive. + +Everyone is permitted to copy and distribute copies of this Agreement, but in +order to avoid inconsistency the Agreement is copyrighted and may only be +modified in the following manner. The Agreement Steward reserves the right to +publish new versions (including revisions) of this Agreement from time to time. +No one other than the Agreement Steward has the right to modify this Agreement. +The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation +may assign the responsibility to serve as the Agreement Steward to a suitable +separate entity. Each new version of the Agreement will be given a +distinguishing version number. The Program (including Contributions) may always +be distributed subject to the version of the Agreement under which it was +received. In addition, after a new version of the Agreement is published, +Contributor may elect to distribute the Program (including its Contributions) +under the new version. Except as expressly stated in Sections 2(a) and 2(b) +above, Recipient receives no rights or licenses to the intellectual property of +any Contributor under this Agreement, whether expressly, by implication, +estoppel or otherwise. All rights in the Program not expressly granted under +this Agreement are reserved. + +This Agreement is governed by the laws of the State of New York and the +intellectual property laws of the United States of America. No party to this +Agreement will bring a legal action under this Agreement more than one year +after the cause of action arose. Each party waives its rights to a jury trial in +any resulting litigation. diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/app/README.md b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/app/README.md new file mode 100644 index 00000000..7391578f --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/app/README.md @@ -0,0 +1,51 @@ +# OpenDaylight DLUX
+
+OpenDaylight DLUX is a Javascript-based stateless user interface that communicates with the service backend to provide a consistent and user-friendly interface to interact with OpenDaylight projects and base controller.
+
+
+## Build DLUX code with Karaf feature and distribution
+
+All necessary modules mentioned above such as nodesjs, bower etc. will be installed automatically, when you run the dlux build for first time. Run following command at dlux home directory /dlux to build dlux feature and distribution along with code.
+Once successful, It will make dlux feature available to install and also create dlux karaf distribution. You can find karaf distribution at dlux/distribution-dlux.
+
+ $ mvn clean install
+
+__NOTE__: Some people reported about node related error while maven build. Those errors are usually environment related, mostly happens because of the permission issues or node is not installed properly. Try to reinstall node manually.
+
+### Install NodeJS manually if needed
+
+__For Windows and Mac without brew:__
+
+ Go to http://www.nodejs.org
+ Download and install NodeJS
+
+__For Mac with brew installed:__
+
+ $ brew update
+ $ brew install node
+
+__Verify NodeJS is installed:__
+
+ $ npm --version
+
+__Run DLUX in karaf distribution__
+
+Once you have dlux distribution or you have karaf distribution from integration repository. You can turn on the dlux feature to access the UI.
+We will take example of dlux distribution here. Navigate to directory dlux/distribution-dlux/target/assembly/bin and start the karaf via following command -
+
+ ./karaf
+
+On the karaf shell, install dlux core feature via running following command -
+
+ feature:install odl-dlux-core
+
+
+It will internally install odl-restconf and dlux topology application along with core dlux components. once this feature is successfully installed.
+Access the dlux UI at __http://localhost:8181/index.html__. Default credentials are admin/admin for login.
+
+All the applications in dlux are now karaf features. You can install other dlux applications such as nodes, yang-ui from karaf console using commands such as
+
+ feature:install odl-dlux-node
+ feature:install odl-dlux-yangui
+
+For more details - follow the wiki at [dlux opendaylight](https://wiki.opendaylight.org/view/OpenDaylight_dlux:Getting_started)
diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/app/app.controller.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/app/app.controller.js new file mode 100644 index 00000000..025f556a --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/app/app.controller.js @@ -0,0 +1,23 @@ +define(['app/app.module'], function (app) { + 'use strict'; + + app.register.controller('AppCtrl', function ($rootScope, $state, $scope, $location) { + $rootScope.useMobile = + function() { + if( navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || + navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/BlackBerry/i) || + navigator.userAgent.match(/Windows Phone/i) ) { + return true; + } + else { + return false; + } + }; + + $scope.isCollapse = false; + $scope.breadcrumbs = {}; + $scope.isState = function(name) { + return $state.includes(name); + }; + }); +}); diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/app/app.module.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/app/app.module.js new file mode 100644 index 00000000..3773b5e6 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/app/app.module.js @@ -0,0 +1,124 @@ + +// These variables are provided by the server in karaf distribution. +// The path of all *.module.js go here. They are RequireJs module. +// You can uncomment them only for development purpose if you are not using +//karaf based dlux deployment +/* +var module = [ + 'angular', + 'angular-translate', + 'angular-sanitize', + 'angular-translate-loader-static-files', + 'angular-translate-loader-partial', + 'angular-ui-router', + 'ocLazyLoad', + 'angular-css-injector', +]; + +var deps = [ + 'app/core/core.module', + 'app/node/nodes.module', + 'app/topology/topology.module', + 'common/login/login.module', + 'app/yangui/main', + 'app/yangman/main', + 'app/yangvisualizer/yangvisualizer.module', + 'common/sigmatopology/sigmatopology.module', + 'common/navigation/navigation.module', + 'common/topbar/topbar.module', + 'common/layout/layout.module', + 'common/config/env.module' +]; + +// The name of all angularjs module +var e = [ + 'ui.router', + 'oc.lazyLoad', + 'pascalprecht.translate', + 'ngSanitize', + 'angular.css.injector', + 'app', + 'app.nodes', + 'app.topology', + 'app.common.login', + 'app.yangui', + 'app.yangman', + 'app.yangvisualizer', + 'app.common.sigmatopology', + 'app.common.nav', + 'app.common.topbar', + 'app.common.layout']; +//--------------------\\ + +*/ + +define(module, function(angular) { + 'use strict'; + var preboot = [], + register = {}, + dlux_angular = {}, + orig_angular = angular, + app = angular.module('app', []); + + angular.extend(dlux_angular, orig_angular); + + dlux_angular.module = function(name, deps) { + var module = orig_angular.module(name, deps); + preboot.push(module); + return module; + }; + + window.angular = dlux_angular; // backward compatibility + + // The overal config he is done here. + app.config(function ($urlRouterProvider, $ocLazyLoadProvider, $translateProvider, $translatePartialLoaderProvider, $controllerProvider, $compileProvider, $provide, $filterProvider, cssInjectorProvider) { + + $urlRouterProvider.otherwise("/topology"); // set the default route + + cssInjectorProvider.setSinglePageMode(true); // remove all added CSS files when the page change + + // set the ocLazyLoader to output error and use requirejs as loader + $ocLazyLoadProvider.config({ + debug: true, + asyncLoader: require + }); + + $translateProvider.useLoader('$translatePartialLoader', { + urlTemplate: '/src/{part}-{lang}.json' + }); + + $translatePartialLoaderProvider.addPart('../assets/data/locale'); + $translateProvider.preferredLanguage('en_US'); + $translateProvider.useSanitizeValueStrategy('escape'); + + // the only way to add a dynamic module + register = { + controller : $controllerProvider.register, + directive : $compileProvider.directive, + factory : $provide.factory, + filter: $filterProvider.register, + service : $provide.service + }; + + app.register = {}; + angular.extend(app.register, register); + }); + + /* --- define vs require war --- + * From my understanding, we use require when + * we want to load a dependency and run it. Define + * is only to define the dependency for a module. + */ + require(deps, function() { + angular.element(document).ready(function() { + angular.bootstrap(document, e).invoke(function() { + preboot.forEach(function(m) { + angular.extend(m, register); + }); + console.log('bootstrap done (: '); + }); + }); + }); + + return app; +}); diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/app/core/core.module.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/app/core/core.module.js new file mode 100644 index 00000000..c065ddca --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/app/core/core.module.js @@ -0,0 +1,10 @@ +define(['angular', './core.services'], function (angular, services) { + 'use strict'; + var core = angular.module('app.core', []); + + core.provider('ContentHelper', services.ContentHelper); + core.provider('NavHelper', services.NavHelper); + core.provider('TopBarHelper', services.TopBarHelper); + + return core; +}); diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/app/core/core.services.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/app/core/core.services.js new file mode 100644 index 00000000..d7e24fd4 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/app/core/core.services.js @@ -0,0 +1,181 @@ +define(['jquery'], function ($) { + 'use strict'; + + var TopBarHelper = function () { + var ids = []; + var ctrls = []; + + this.addToView = function (url) { + $.ajax({ + url: url, + method: 'GET', + async: false + }).done(function (data) { + ids.push(data); + }); + }; + + this.getViews = function () { + var template = ''; + + for (var i = 0; i < ids.length; ++i) { + template += ids[i]; + } + + return template; + }; + + this.addControllerUrl = function (url) { + ctrls.push(url); + }; + + this.getControllers = function () { + return ctrls; + }; + + this.$get = ['apiToken', function (apiToken) { + return new TopBarHelper(apiToken); + }]; + }; + + var NavHelper = function () { + var ids = []; + var ctrls = []; + var menu = []; + + function NavHelperProvider() { + this.addToView = function (url) { + $.ajax({ + url: url, + method: 'GET', + async: false + }).done(function (data) { + ids.push(data); + }); + }; + + this.getViews = function () { + var template = ''; + + for (var i = 0; i < ids.length; ++i) { + template += ids[i]; + } + + return template; + }; + + this.addControllerUrl = function (url) { + ctrls.push(url); + }; + + this.getControllers = function () { + return ctrls; + }; + + var getMenuWithId = function (menu, level) { + if (menu === undefined) { + return null; + } + var currentLevel = level[0]; + + var menuItem = $.grep(menu, function (item) { + return item.id === currentLevel; + })[0]; + + if (level.length === 1) { + return menuItem; + } else { + return getMenuWithId(menuItem.submenu, level.slice(1)); + } + }; + + this.addToMenu = function (id, obj) { + var lvl = id.split('.'); + obj.id = lvl.pop(); + + if (lvl.length === 0) { + menu.push(obj); + } else { + var menuItem = getMenuWithId(menu, lvl); + + if (menuItem) { + if (!menuItem.submenu) { + menuItem.submenu = []; + } + menuItem.submenu.push(obj); + } else { + var submenu = { + 'id': lvl[0], + 'title': lvl[0], + 'active': '', + 'submenu': [obj] + }; + menu.push(submenu); + } + } + }; + + this.getMenu = function () { + return menu; + }; + + this.$get = function NavHelperFactory() { + return new NavHelperProvider(); + }; + } + var persistentProvider = new NavHelperProvider(); + + return persistentProvider; + + }; + + var ContentHelper = function () { + var ids = []; + var ctrls = []; + + function ContentHelperProvider() { + this.addToView = function (url) { + $.ajax({ + url: url, + method: 'GET', + async: false + }).done(function (data) { + ids.push(data); + }); + }; + + this.getViews = function () { + var template = ''; + + for (var i = 0; i < ids.length; ++i) { + template += ids[i]; + } + + return template; + }; + + this.addControllerUrl = function (url) { + ctrls.push(url); + }; + + this.getControllers = function () { + return ctrls; + }; + + this.$get = function ContentHelperFactory() { + return new ContentHelperProvider(); + }; + } + var persistentProvider = new ContentHelperProvider(); + + return persistentProvider; + + }; + + return { + ContentHelper: ContentHelper, + NavHelper: NavHelper, + TopBarHelper: TopBarHelper + }; + +}); diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/app/core/core.spec.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/app/core/core.spec.js new file mode 100644 index 00000000..908c19d8 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/app/core/core.spec.js @@ -0,0 +1,89 @@ +define(['app/core/core.module', 'app/core/core.services'], function() { + describe("Core Module", function() { + + beforeEach(angular.mock.module('app.core')); + + describe(":: Common Provider function", function() { + var _ContentHelper, _NavHelper, url, deferred; + url = 'test/index.tpl.html'; + + beforeEach(angular.mock.inject(function(ContentHelper) { + _ContentHelper = ContentHelper; + deferred = jQuery.Deferred(); + })); + + it(':: Should be do an ajax call and add the view to the list', function() { + spyOn($, 'ajax').andReturn (deferred); + _ContentHelper.addToView(url); + deferred.resolve(url); + + expect($.ajax.mostRecentCall.args[0]["url"]).toEqual(url); + expect(_ContentHelper.getViews()).toContain(url); + }); + + it('Should add a controller to the list', function() { + _ContentHelper.addControllerUrl(url); + + expect(_ContentHelper.getControllers()).toContain(url); + }); + }); + + describe(':: Menu management method', function() { + var menu = { + "id" : 'menu', + "title" : 'lvl0 menu', + "active" : '', + "submenu" : [ ] + }; + + var submenu = { + "id" : 'sub menu', + "title" : 'lvl1 menu', + "active" : '', + "submenu" : [ ] + }; + + + beforeEach(angular.mock.inject(function(NavHelper) { + _NavHelper = NavHelper; + })); + + + it('Should add a child even if there no parent', function() { + var menus = null; + _NavHelper.addToMenu('root.lvl1', submenu); + + menus = _NavHelper.getMenu(); + + expect(menus[0]).toEqual({ + "id":'root', + "title":'root', + "active": '', + "submenu": [submenu] + }); + }); + + it('Should add a item to the root menu', function() { + var menus = null; + + _NavHelper.addToMenu('main', menu); + menus = _NavHelper.getMenu(); + + expect(menus[0]).toEqual(menu); + }); + + it('Should add a item to the sub menu', function() { + var menus = null; + + _NavHelper.addToMenu('main', menu); + _NavHelper.addToMenu('main.lvl1', submenu); + + menus = _NavHelper.getMenu(); + + expect(menus[0].submenu[0]).toEqual(submenu); + }); + + }); + + }); +}); diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/app/routingConfig.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/app/routingConfig.js new file mode 100644 index 00000000..3e0ee90a --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/app/routingConfig.js @@ -0,0 +1,103 @@ +(function(exports){ + + var config = { + + /* List all the roles you wish to use in the app + * You have a max of 31 before the bit shift pushes the accompanying integer out of + * the memory footprint for an integer + */ + roles :[ + 'public', + 'user', + 'admin'], + + /* + Build out all the access levels you want referencing the roles listed above + You can use the "*" symbol to represent access to all roles + */ + accessLevels : { + 'public' : "*", + 'anon': ['public'], + 'user' : ['user', 'admin'], + 'admin': ['admin'] + } + + }; + + exports.userRoles = buildRoles(config.roles); + exports.accessLevels = buildAccessLevels(config.accessLevels, exports.userRoles); + + /* + Method to build a distinct bit mask for each role + It starts off with "1" and shifts the bit to the left for each element in the + roles array parameter + */ + + function buildRoles(roles){ + + var bitMask = "01"; + var userRoles = {}; + + for(var role in roles){ + var intCode = parseInt(bitMask, 2); + userRoles[roles[role]] = { + bitMask: intCode, + title: roles[role] + }; + bitMask = (intCode << 1 ).toString(2); + } + + return userRoles; + } + + /* + This method builds access level bit masks based on the accessLevelDeclaration parameter which must + contain an array for each access level containing the allowed user roles. + */ + function buildAccessLevels(accessLevelDeclarations, userRoles){ + + var accessLevels = {}; + var resultBitMask = ''; + for(var level in accessLevelDeclarations){ + + if(typeof accessLevelDeclarations[level] == 'string'){ + if(accessLevelDeclarations[level] == '*'){ + + resultBitMask = ''; + + for( var roleTemp in userRoles){ + resultBitMask += "1"; + } + //accessLevels[level] = parseInt(resultBitMask, 2); + accessLevels[level] = { + bitMask: parseInt(resultBitMask, 2), + title: accessLevelDeclarations[level] + }; + } + else { + console.log("Access Control Error: Could not parse '" + accessLevelDeclarations[level] + "' as access definition for level '" + level + "'"); + } + + } + else { + + resultBitMask = 0; + for(var role in accessLevelDeclarations[level]){ + if(userRoles.hasOwnProperty(accessLevelDeclarations[level][role])) { + resultBitMask = resultBitMask | userRoles[accessLevelDeclarations[level][role]].bitMask; + } + else { + console.log("Access Control Error: Could not find role '" + accessLevelDeclarations[level][role] + "' in registered roles while building access for '" + level + "'"); + } + } + accessLevels[level] = { + bitMask: resultBitMask, + title: accessLevelDeclarations[level][role] + }; + } + } + + return accessLevels; + } + +})(typeof exports === 'undefined' ? this['routingConfig'] = {} : exports);
\ No newline at end of file diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/LICENSE b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/LICENSE new file mode 100644 index 00000000..82d2ab25 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/LICENSE @@ -0,0 +1,208 @@ +Eclipse Public License - v 1.0 + +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC +LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM +CONSTITUTES RECIPIENT’S ACCEPTANCE OF THIS AGREEMENT. + +1. DEFINITIONS + +"Contribution" means: + +a) in the case of the initial Contributor, the initial code and documentation +distributed under this Agreement, and +b) in the case of each subsequent Contributor: + +i) changes to the Program, and + +ii) additions to the Program; + +where such changes and/or additions to the Program originate from and are +distributed by that particular Contributor. A Contribution 'originates' from a +Contributor if it was added to the Program by such Contributor itself or anyone +acting on such Contributor’s behalf. Contributions do not include additions to +the Program which: (i) are separate modules of software distributed in +conjunction with the Program under their own license agreement, and (ii) are not +derivative works of the Program. + +"Contributor" means any person or entity that distributes the Program. + +"Licensed Patents " mean patent claims licensable by a Contributor which are +necessarily infringed by the use or sale of its Contribution alone or when +combined with the Program. + +"Program" means the Contributions distributed in accordance with this Agreement. + +"Recipient" means anyone who receives the Program under this Agreement, +including all Contributors. + +2. GRANT OF RIGHTS + +a) Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide, royalty-free copyright license to +reproduce, prepare derivative works of, publicly display, publicly perform, +distribute and sublicense the Contribution of such Contributor, if any, and such +derivative works, in source code and object code form. + +b) Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed +Patents to make, use, sell, offer to sell, import and otherwise transfer the +Contribution of such Contributor, if any, in source code and object code form. +This patent license shall apply to the combination of the Contribution and the +Program if, at the time the Contribution is added by the Contributor, such +addition of the Contribution causes such combination to be covered by the +Licensed Patents. The patent license shall not apply to any other combinations +which include the Contribution. No hardware per se is licensed hereunder. + +c) Recipient understands that although each Contributor grants the licenses to +its Contributions set forth herein, no assurances are provided by any +Contributor that the Program does not infringe the patent or other intellectual +property rights of any other entity. Each Contributor disclaims any liability to +Recipient for claims brought by any other entity based on infringement of +intellectual property rights or otherwise. As a condition to exercising the +rights and licenses granted hereunder, each Recipient hereby assumes sole +responsibility to secure any other intellectual property rights needed, if any. +For example, if a third party patent license is required to allow Recipient to +distribute the Program, it is Recipient’s responsibility to acquire that license +before distributing the Program. + +d) Each Contributor represents that to its knowledge it has sufficient copyright +rights in its Contribution, if any, to grant the copyright license set forth in +this Agreement. + +3. REQUIREMENTS + +A Contributor may choose to distribute the Program in object code form under its +own license agreement, provided that: + +a) it complies with the terms and conditions of this Agreement; and + +b) its license agreement: + +i) effectively disclaims on behalf of all Contributors all warranties and +conditions, express and implied, including warranties or conditions of title and +non-infringement, and implied warranties or conditions of merchantability and +fitness for a particular purpose; + +ii) effectively excludes on behalf of all Contributors all liability for +damages, including direct, indirect, special, incidental and consequential +damages, such as lost profits; + +iii) states that any provisions which differ from this Agreement are offered by +that Contributor alone and not by any other party; and + +iv) states that source code for the Program is available from such Contributor, +and informs licensees how to obtain it in a reasonable manner on or through a +medium customarily used for software exchange. + +When the Program is made available in source code form: + +a) it must be made available under this Agreement; and +b) a copy of this Agreement must be included with each copy of the Program. + +Contributors may not remove or alter any copyright notices contained within the +Program. + +Each Contributor must identify itself as the originator of its Contribution, if +any, in a manner that reasonably allows subsequent Recipients to identify the +originator of the Contribution. + +4. COMMERCIAL DISTRIBUTION + +Commercial distributors of software may accept certain responsibilities with +respect to end users, business partners and the like. While this license is +intended to facilitate the commercial use of the Program, the Contributor who +includes the Program in a commercial product offering should do so in a manner +which does not create potential liability for other Contributors. Therefore, if +a Contributor includes the Program in a commercial product offering, such +Contributor ("Commercial Contributor") hereby agrees to defend and indemnify +every other Contributor ("Indemnified Contributor") against any losses, damages +and costs (collectively "Losses") arising from claims, lawsuits and other legal +actions brought by a third party against the Indemnified Contributor to the +extent caused by the acts or omissions of such Commercial Contributor in +connection with its distribution of the Program in a commercial product +offering. The obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. In order +to qualify, an Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial Contributor to +control, and cooperate with the Commercial Contributor in, the defense and any +related settlement negotiations. The Indemnified Contributor may participate in +any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial product +offering, Product X. That Contributor is then a Commercial Contributor. If that +Commercial Contributor then makes performance claims, or offers warranties +related to Product X, those performance claims and warranties are such +Commercial Contributor’s responsibility alone. Under this section, the +Commercial Contributor would have to defend claims against the other +Contributors related to those performance claims and warranties, and if a court +requires any other Contributor to pay any damages as a result, the Commercial +Contributor must pay those damages. + +5. NO WARRANTY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR +IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, +NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each +Recipient is solely responsible for determining the appropriateness of using and +distributing the Program and assumes all risks associated with its exercise of +rights under this Agreement , including but not limited to the risks and costs +of program errors, compliance with applicable laws, damage to or loss of data, +programs or equipment, and unavailability or interruption of operations. + +6. DISCLAIMER OF LIABILITY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY +CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST +PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS +GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. GENERAL + +If any provision of this Agreement is invalid or unenforceable under applicable +law, it shall not affect the validity or enforceability of the remainder of the +terms of this Agreement, and without further action by the parties hereto, such +provision shall be reformed to the minimum extent necessary to make such +provision valid and enforceable. + +If Recipient institutes patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Program itself +(excluding combinations of the Program with other software or hardware) +infringes such Recipient’s patent(s), then such Recipient’s rights granted under +Section 2(b) shall terminate as of the date such litigation is filed. + +All Recipient’s rights under this Agreement shall terminate if it fails to +comply with any of the material terms or conditions of this Agreement and does +not cure such failure in a reasonable period of time after becoming aware of +such noncompliance. If all Recipient’s rights under this Agreement terminate, +Recipient agrees to cease use and distribution of the Program as soon as +reasonably practicable. However, Recipient’s obligations under this Agreement +and any licenses granted by Recipient relating to the Program shall continue and +survive. + +Everyone is permitted to copy and distribute copies of this Agreement, but in +order to avoid inconsistency the Agreement is copyrighted and may only be +modified in the following manner. The Agreement Steward reserves the right to +publish new versions (including revisions) of this Agreement from time to time. +No one other than the Agreement Steward has the right to modify this Agreement. +The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation +may assign the responsibility to serve as the Agreement Steward to a suitable +separate entity. Each new version of the Agreement will be given a +distinguishing version number. The Program (including Contributions) may always +be distributed subject to the version of the Agreement under which it was +received. In addition, after a new version of the Agreement is published, +Contributor may elect to distribute the Program (including its Contributions) +under the new version. Except as expressly stated in Sections 2(a) and 2(b) +above, Recipient receives no rights or licenses to the intellectual property of +any Contributor under this Agreement, whether expressly, by implication, +estoppel or otherwise. All rights in the Program not expressly granted under +this Agreement are reserved. + +This Agreement is governed by the laws of the State of New York and the +intellectual property laws of the United States of America. No party to this +Agreement will bring a legal action under this Agreement more than one year +after the cause of action arose. Each party waives its rights to a jury trial in +any resulting litigation. diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/README.md b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/README.md new file mode 100644 index 00000000..7391578f --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/README.md @@ -0,0 +1,51 @@ +# OpenDaylight DLUX
+
+OpenDaylight DLUX is a Javascript-based stateless user interface that communicates with the service backend to provide a consistent and user-friendly interface to interact with OpenDaylight projects and base controller.
+
+
+## Build DLUX code with Karaf feature and distribution
+
+All necessary modules mentioned above such as nodesjs, bower etc. will be installed automatically, when you run the dlux build for first time. Run following command at dlux home directory /dlux to build dlux feature and distribution along with code.
+Once successful, It will make dlux feature available to install and also create dlux karaf distribution. You can find karaf distribution at dlux/distribution-dlux.
+
+ $ mvn clean install
+
+__NOTE__: Some people reported about node related error while maven build. Those errors are usually environment related, mostly happens because of the permission issues or node is not installed properly. Try to reinstall node manually.
+
+### Install NodeJS manually if needed
+
+__For Windows and Mac without brew:__
+
+ Go to http://www.nodejs.org
+ Download and install NodeJS
+
+__For Mac with brew installed:__
+
+ $ brew update
+ $ brew install node
+
+__Verify NodeJS is installed:__
+
+ $ npm --version
+
+__Run DLUX in karaf distribution__
+
+Once you have dlux distribution or you have karaf distribution from integration repository. You can turn on the dlux feature to access the UI.
+We will take example of dlux distribution here. Navigate to directory dlux/distribution-dlux/target/assembly/bin and start the karaf via following command -
+
+ ./karaf
+
+On the karaf shell, install dlux core feature via running following command -
+
+ feature:install odl-dlux-core
+
+
+It will internally install odl-restconf and dlux topology application along with core dlux components. once this feature is successfully installed.
+Access the dlux UI at __http://localhost:8181/index.html__. Default credentials are admin/admin for login.
+
+All the applications in dlux are now karaf features. You can install other dlux applications such as nodes, yang-ui from karaf console using commands such as
+
+ feature:install odl-dlux-node
+ feature:install odl-dlux-yangui
+
+For more details - follow the wiki at [dlux opendaylight](https://wiki.opendaylight.org/view/OpenDaylight_dlux:Getting_started)
diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/authentification/auth.module.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/authentification/auth.module.js new file mode 100644 index 00000000..ec953e40 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/authentification/auth.module.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2014 Inocybe Technologies, and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ + +define(['angular', './auth.services', 'common/config/env.module'], function (angular, services) { + 'use strict'; + var auth = angular.module('app.common.auth', ['config']); + + // services + auth.factory('Auth', services.Auth); + auth.factory('Base64', services.Base64); + auth.factory('NbInterceptor', services.NbInterceptor); + + return auth; +}); diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/authentification/auth.services.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/authentification/auth.services.js new file mode 100644 index 00000000..da07de2d --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/authentification/auth.services.js @@ -0,0 +1,199 @@ +/* + * Copyright (c) 2014 Inocybe Technologies, and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ + +define([], function () { + 'use strict'; + + var Auth = function ($http, $window, Base64, ENV) { + var factory = {}; + // Set Authorization header to username + password + factory.setBasic = function (user, pw) { + $window.localStorage.odlUser = user; + $window.localStorage.odlPass = pw; + // for backward compatibility + $window.sessionStorage.odlUser = user; + $window.sessionStorage.odlPass = pw; + }; + + // for backward compatibility + if ($window.localStorage.odlUser && $window.localStorage.odlPass) { + $window.sessionStorage.odlUser = $window.localStorage.odlUser; + $window.sessionStorage.odlPass = $window.localStorage.odlPass; + } + + factory.unsetBasic = function () { + if ($http.defaults.headers.common.Authorization !== null) { + delete $http.defaults.headers.common.Authorization; + } + $window.localStorage.clear(); + $window.sessionStorage.clear(); + document.cookie = 'JSESSIONID=; Path=/restconf; Expires=Thu, 01 Jan 1970 00:00:01 GMT;'; + }; + + // Return the current user object + factory.getUser = function () { + var user = $window.localStorage.odlUser || null; + return user; + }; + + factory.authorize = function (accessLevel, role) { + if (role === undefined) { + role = currentUser.role; + } + return accessLevel.bitMask & role.bitMask; + }; + factory.isAuthed = function () { + var authed = factory.getUser() ? true : false; + return authed; + }; + factory.isLoggedIn = function (user) { + if (user === undefined) { + user = currentUser; + } + return user.role.title === userRoles.user.title || user.role.title === userRoles.admin.title; + }; + factory.login = function (user, pw, cb, eb) { + factory.setBasic(user, pw); + $http.get(ENV.getBaseURL('MD_SAL') + '/restconf/modules') + .success(function (data) { + cb(data); + }) + .error(function (resp) { + if (resp.errors) { + var errorDetails = resp.errors.error[0]; + if (errorDetails && errorDetails['error-tag'] === 'data-missing') { + // Authentication succeed, but API does not have data, allow to enter + cb(resp); + return; + } + } + factory.unsetBasic(); + eb(resp); + }); + }; + factory.logout = function (success) { + factory.unsetBasic(); + success(); + }; + return factory; + }; + Auth.$inject = ['$http', '$window', 'Base64', 'ENV']; + + var Base64 = function () { + var keyStr = 'ABCDEFGHIJKLMNOP' + + 'QRSTUVWXYZabcdef' + + 'ghijklmnopqrstuv' + + 'wxyz0123456789+/' + + '='; + return { + encode: function (input) { + var output = ""; + var chr1, chr2, chr3 = ""; + var enc1, enc2, enc3, enc4 = ""; + var i = 0; + + do { + chr1 = input.charCodeAt(i++); + chr2 = input.charCodeAt(i++); + chr3 = input.charCodeAt(i++); + + enc1 = chr1 >> 2; + enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); + enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); + enc4 = chr3 & 63; + + if (isNaN(chr2)) { + enc3 = enc4 = 64; + } else if (isNaN(chr3)) { + enc4 = 64; + } + + output = output + + keyStr.charAt(enc1) + + keyStr.charAt(enc2) + + keyStr.charAt(enc3) + + keyStr.charAt(enc4); + chr1 = chr2 = chr3 = ""; + enc1 = enc2 = enc3 = enc4 = ""; + } while (i < input.length); + + return output; + }, + decode: function (input) { + var output = ""; + var chr1, chr2, chr3 = ""; + var enc1, enc2, enc3, enc4 = ""; + var i = 0; + + // remove all characters that are not A-Z, a-z, 0-9, +, /, or = + var base64test = /[^A-Za-z0-9\+\/\=]/g; + if (base64test.exec(input)) { + alert("There were invalid base64 characters in the input text.\n" + + "Valid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\n" + + "Expect errors in decoding."); + } + + input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); + + do { + enc1 = keyStr.indexOf(input.charAt(i++)); + enc2 = keyStr.indexOf(input.charAt(i++)); + enc3 = keyStr.indexOf(input.charAt(i++)); + enc4 = keyStr.indexOf(input.charAt(i++)); + + chr1 = (enc1 << 2) | (enc2 >> 4); + chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); + chr3 = ((enc3 & 3) << 6) | enc4; + + output = output + String.fromCharCode(chr1); + + if (enc3 != 64) { + output = output + String.fromCharCode(chr2); + } + if (enc4 != 64) { + output = output + String.fromCharCode(chr3); + } + + chr1 = chr2 = chr3 = ""; + enc1 = enc2 = enc3 = enc4 = ""; + + } while (i < input.length); + + return output; + } + }; + }; + + // Filter to add authorization header if its a nb api call + var NbInterceptor = function ($q, $window, Base64) { + return { + request: function (config) { + // Use AAA basic authentication + if (config.url.indexOf('restconf') !== -1 || config.url.indexOf('apidoc') !== -1) { + config.headers = config.headers || {}; + if ($window.localStorage.odlUser && $window.localStorage.odlPass) { + var encoded = Base64.encode($window.localStorage.odlUser + ':' + $window.localStorage.odlPass); + config.headers.Authorization = 'Basic ' + encoded; + } + } + return config; + }, + response: function (response) { + return response || $q.when(response); + } + }; + }; + NbInterceptor.$inject = ['$q', '$window', 'Base64']; + + return { + Auth: Auth, + Base64: Base64, + NbInterceptor: NbInterceptor + }; + +}); diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/authentification/auth.spec.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/authentification/auth.spec.js new file mode 100644 index 00000000..911b56cf --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/authentification/auth.spec.js @@ -0,0 +1,111 @@ +define(['common/authentification/auth.module'], function () { + describe('Auth Module', function () { + var _Auth, httpBackend, deferred; + beforeEach(module('app.common.auth')); + + beforeEach(inject(function ($injector) { + _Auth = $injector.get('Auth'); + httpBackend = $injector.get('$httpBackend'); + })); + + it('Should have defined function facilate the authentication process', function () { + expect(_Auth.setBasic).toBeDefined(); + expect(_Auth.unsetBasic).toBeDefined(); + expect(_Auth.getUser).toBeDefined(); + expect(_Auth.authorize).toBeDefined(); + expect(_Auth.isAuthed).toBeDefined(); + expect(_Auth.isLoggedIn).toBeDefined(); + expect(_Auth.login).toBeDefined(); + expect(_Auth.logout).toBeDefined(); + }); + + describe(':: Authentication header', function () { + var username = 'john', + password = 'abc123', + _window = null; + + beforeEach(inject(function ($window) { + _window = $window; + })); + + it('Should set the basic authenticate header', function () { + _Auth.setBasic(username, password); + + expect(_window.localStorage.odlUser).toBeDefined(); + expect(_window.localStorage.odlUser).toEqual(username); + + expect(_window.localStorage.odlPass).toBeDefined(); + expect(_window.localStorage.odlPass).toEqual(password); + }); + + it('Should unset the basic authenticate header', inject(function ($http) { + _Auth.setBasic(username, password); + _Auth.unsetBasic(); + + expect(_window.localStorage.odlUser).toBeUndefined(); + expect(_window.localStorage.odlPass).toBeUndefined(); + expect($http.defaults.headers.common.Authorization).toBeUndefined(); + })); + }); + + describe(':: Login management', function () { + var username = 'john', + password = 'abc123'; + + it('Should return the current user or null otherwise', function () { + var user = _Auth.getUser(); + expect(user).toBeNull(); + + _Auth.setBasic(username, password); + expect(user).toEqual(user); + }); + + it('Should set the authentication header and send a callback if success', function () { + httpBackend.expect('GET', /.*/).respond(200, ''); + var successSpy = jasmine.createSpy("successSpy"); + var errorSpy = jasmine.createSpy("errorSpy"); + spyOn(_Auth, 'setBasic'); + + _Auth.login(username, password, successSpy, errorSpy); + httpBackend.flush(); + + expect(_Auth.setBasic).toHaveBeenCalledWith(username, password); + expect(successSpy).toHaveBeenCalled(); + expect(errorSpy).not.toHaveBeenCalled(); + }); + + it('Should unset the authentication header and send a callback if error', function () { + httpBackend.expect('GET', /.*/).respond(404, ''); + var successSpy = jasmine.createSpy("successSpy"); + var errorSpy = jasmine.createSpy("errorSpy"); + spyOn(_Auth, 'setBasic'); + spyOn(_Auth, 'unsetBasic'); + + _Auth.login(username, password, successSpy, errorSpy); + httpBackend.flush(); + + expect(_Auth.setBasic).toHaveBeenCalledWith(username, password); + expect(_Auth.unsetBasic).toHaveBeenCalled(); + expect(successSpy).not.toHaveBeenCalled(); + expect(errorSpy).toHaveBeenCalled(); + }); + + it('Should unset the authentication header on logout', function () { + var successSpy = jasmine.createSpy("successSpy"); + spyOn(_Auth, 'unsetBasic'); + + _Auth.logout(successSpy); + + expect(_Auth.unsetBasic).toHaveBeenCalled(); + expect(successSpy).toHaveBeenCalled(); + }); + + afterEach(function () { + httpBackend.verifyNoOutstandingExpectation(); + httpBackend.verifyNoOutstandingRequest(); + }); + + }); + + }); +}); diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/config/env.module.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/config/env.module.js new file mode 100644 index 00000000..633ad138 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/config/env.module.js @@ -0,0 +1,37 @@ +define(['angular'], function (angular) { + 'use strict'; + + var config = angular.module('config', []) + .constant('ENV', { + + baseURL: '', + adSalPort: '8080', + mdSalPort: '8181', + mdSalSecuredPort: '8443', + configEnv: 'ENV_PROD', + getBaseURL: function (salType) { + if (salType !== undefined) { + var urlPrefix = ''; + if (this.configEnv === 'ENV_DEV') { + urlPrefix = this.baseURL; + } else { + urlPrefix = window.location.protocol + '//' + window.location.hostname + ':'; + } + + if (salType === 'AD_SAL') { + return urlPrefix + this.adSalPort; + } else if (salType === 'MD_SAL') { + var basePort = this.mdSalPort; + if (window.location.protocol === 'https:') { + basePort = this.mdSalSecuredPort; + } + return urlPrefix + basePort; + } + } + //default behavior + return ''; + } + }); + + return config; +}); diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/general/common.general.directives.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/general/common.general.directives.js new file mode 100644 index 00000000..78429dc1 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/general/common.general.directives.js @@ -0,0 +1,43 @@ +define(['common/general/common.general.module'], function(general) { + + general.directive('stateIcon', function() { + return { + restrict: 'E', + replace: true, + scope: { + stateValue: '@value' + }, + template: '<span class="glyphicon glyphicon-{{stateIcon}}-sign"></span>', + controller: ['$scope', function ($scope) { + var value = $scope.stateValue; + + var icons = {1: 'ok', 0: 'exclamation'}; + var textStates = {'true': 1, 'false': 0}; + + if (_.isString(value) && !value.match('^[0-9]$')) { + value = textStates[value]; + } + $scope.stateIcon = icons[value]; + }] + + }; + }); + + general.directive('portState', function() { + return { + restrict: 'E', + replace: true, + scope: { + stateValue: '@value' + }, + template: '<span ng-style="{color: stateColor}">{{stateString}}</span>', + controller: ['$scope', function ($scope) { + var states = {0: 'DOWN', 1: 'UP'}; + var colors = {0: 'red', 1: 'green'}; + + $scope.stateString = states[$scope.stateValue]; + $scope.stateColor = colors[$scope.stateValue]; + }] + }; + }); +}); diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/general/common.general.filters.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/general/common.general.filters.js new file mode 100644 index 00000000..519525c7 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/general/common.general.filters.js @@ -0,0 +1,15 @@ +define(['common/general/common.general.module'], function(general) { + + // Filter to return only valid ports (like id != 0) + general.filter('noRootPorts', function () { + return function (input) { + if (!input) { + return; + } + return input.filter(function(port) { + return port.nodeconnector.id !== "0" ? port : null; + }); + }; + }); + +}); diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/general/common.general.module.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/general/common.general.module.js new file mode 100644 index 00000000..68f7c68b --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/general/common.general.module.js @@ -0,0 +1,5 @@ +define(['angularAMD', 'Restangular', 'common/config/env.module'], function(ng) { + var general = angular.module('app.common.general', ['restangular', 'config']); + + return general; +}); diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/general/common.general.services.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/general/common.general.services.js new file mode 100644 index 00000000..6529ceab --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/general/common.general.services.js @@ -0,0 +1,63 @@ +define(['common/general/common.general.module'], function(general) { + + general.factory('GeneralRestangular', function(Restangular, ENV) { + return Restangular.withConfig(function(RestangularConfig) { + RestangularConfig.setBaseUrl(ENV.baseURL); + }); + }); + + + general.factory('SwitchSvc', function (GeneralRestangular) { + var svc = { + base: function (container) { + container = container || 'default'; + return GeneralRestangular.one('controller/nb/v2').one('switchmanager', container); + }, + data: null + }; + + svc.delete = function(node) { + /* console.log(node); + return svc.nodeUrl('default', node.node.type, node.node.id).remove();*/ + }; + + // URL for nodes + svc.nodesUrl = function (container) { + return svc.base(container).all('nodes'); + }; + + // URL for a node + svc.nodeUrl = function (container, type, id) { + return svc.base(container).one('node', type).one(id); + }; + + svc.getAll = function (container) { + return svc.nodesUrl(container).getList(); + }; + + svc.getConnectorProperties = function (container, type, id) { + return svc.nodeUrl(container, type, id).get(); + }; + + svc.itemData = function (i) { + return { + state: 'node.detail', + name: i.properties.description.value !== 'None' ? i.properties.description.value : i.node.type + '/' + i.node.id, + params: {nodeId: i.node.id, nodeType: i.node.type} + }; + }; + + svc.itemsData = function (data_) { + var data = []; + + angular.forEach(data_.nodeProperties, function (value, key) { + data.push(svc.itemData(value)); + }); + + return data; + }; + + return svc; + }); +}); + diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/general/common.navigation.directives.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/general/common.navigation.directives.js new file mode 100644 index 00000000..9c0dd759 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/general/common.navigation.directives.js @@ -0,0 +1,232 @@ +define(['common/general/common.navigation.module'], function(common) { + + /* + * Helper to set CSS class to active via ng-class using $location.path() + * or $state.includes() + */ + common.directive('isActive', function($compile) { + return { + restrict: 'A', + replace: false, + scope: { + state: '@', + stateParams: '=', + stateActive: '@', + url: '@' + }, + + controller: ['$scope', '$location', '$state', function ($scope, $location, $state) { + $scope.$state = $state; + $scope.$location = $location; + }], + compile: function() { + return function (scope, iElement, iAttrs, controller) { + var active; + if (scope.state) { + var state = scope.stateActive || scope.$state.current.name.split('.')[0]; + active = 'active: $state.includes(\'' + scope.state + '\')'; + } else if (scope.url) { + active = 'active: url === $location.path()'; + } else { + active = "false"; + } + iElement.attr('ng-class', '{ ' + active + ' }'); // Adding the ngClass + iElement.removeAttr('is-active'); // Avoid infinite loop + $compile(iElement)(scope); + }; + } + }; + }); + + + common.directive('brdAnchor', function ($compile, $rootScope) { + return { + restrict: 'E', + replace: true, + scope: { + label: '@', + state: '@', + stateParams: '=', + url: '@' + }, + + /* The idea is to support both state and url, to be able to set {active} either + if stateActive matches via $state.includes() or if the url matches + Change this into a actual href later on ? - see https://github.com/angular-ui/ui-router/issues/395 + */ + template: '<a href="" ng-click="doClick()">{{label}}</a>', + controller: ['$scope', '$rootScope', '$location', '$state', function ($scope, $rootScope, $location, $state) { + $scope.$location = $location; + $scope.$state = $state; + + $scope.doClick = function () { + var args = { + label: $scope.label, + state: $scope.state, + stateParams: $scope.stateParams, + url: $scope.url + }; + + $rootScope.$broadcast('event:navigation', args); + + if (!$scope.url && $scope.state) { + var params = $scope.stateParams || {}; + $state.transitionTo($scope.state, params, { location: true, inherit: true, relative: $state.$current, notify: true }); + } else if ($scope.url) { + $location.path($scope.url); + } + }; + }] + }; + }); + + + common.directive('buttonCancel', function() { + // Runs during compile + return { + restrict: 'E', + replace: true, + scope: { + 'btnLabel': '@label', + 'btnSize': '@size', + 'btnGlyph': '@glyph', + 'cancelFunc': '=function', + 'state': '@', + 'stateParams': '=', + }, + template: '<button class="btn btn-{{size}} btn-danger" ng-click="doCancel()"><i class="icon-remove-sign"></i> {{label}}</button>', + controller: ['$scope', '$state', function ($scope, $state) { + $scope.label = $scope.btnLabel || 'Cancel'; + $scope.size = $scope.btnSize || 'md'; + $scope.glyph = $scope.btnGlyph || 'remove-circle'; + + $scope.doCancel = function () { + if (angular.isFunction($scope.cancelFunc)) { + $scope.cancelFunc(); + return; + } + + var params = $scope.stateParams || {}; + $state.transitionTo($scope.state, params, { location: true, inherit: true, relative: $state.$current, notify: true }); + + }; + }] + }; + }); + + common.directive('buttonSubmit', function(){ + // Runs during compile + return { + restrict: 'E', + replace: true, + scope: { + 'btnLabel': '@label', + 'btnSize': '@size', + 'btnGlyph': '@glyph', + 'submitFunc': '=function', + 'form': '=form', + 'validator': '=' + }, + template: '<button class="btn btn-{{size}} btn-orange" ng-click="doSubmit()" ng-disabled="submitDisabled"><i class="icon-ok-sign"></i> {{label}}</button>', + controller: ['$scope', function ($scope) { + $scope.label = $scope.btnLabel || 'Submit'; + $scope.size = $scope.btnSize || 'md'; + $scope.glyph = $scope.btnGlyph || 'ok-circle'; + + $scope.submitDisabled = true; + + $scope.doSubmit = function ()Â { + if ($scope.submitFunc) { + $scope.submitFunc(); + } + }; + + $scope.toggle = function (newVal) { + $scope.submitDisabled = newVal ? false : true; + }; + + + // Setup a watch for form.$valid if it's passed + if (!$scope.validator && $scope.form) { + $scope.$watch('form.$valid', function (newVal, oldVal) { + $scope.toggle(newVal); + }); + } + + // This overrules the form watch if set - use with cauthion! + if ($scope.validator && angular.isFunction($scope.validator)) { + $scope.$watch( + function() { + return $scope.validator(); + }, + function(newVal, oldVal) { + $scope.toggle(newVal); + } + ); + } + + // Lastly if none of the above goes we'll just enable ourselves + if (!$scope.form && !$scope.validator) { + $scope.submitDisabled = false; + } + }] + }; + }); + + + common.directive('showSelected', function() { + // Runs during compile + return { + restrict: 'E', + replace: true, + scope: { + 'data': '=' + }, + template: '<span>Selected: {{data.length}}</span>' + }; + }); + + common.directive('ctrlReload', function() { + // Runs during compile + return { + replace: true, + restrict: 'E', + scope: { + svc: '=service' + }, + template: '<button class="btn btn-primary btn-xs" ng-click="svc.getAll()"><i class="icon-refresh"></i></button>', + link: function ($scope, iElm, iAttrs, controller) { + $scope.$on('evt:refresh', function() { + $scope.svc.getAll(); + }); + } + }; + }); + + common.directive('ctrlDelete', function($rootScope) { + // Runs during compile + return { + replace: true, + restrict: 'E', + template: '<button class="btn btn-danger btn-xs" ng-click="deleteSelected()" ng-disabled="gridOptions.selectedItems.length == 0"><i class="icon-remove"></i></button>', + link: function($scope, iElm, iAttrs, controller) { + var i = 0; + var selected = $scope.gridOptions.selectedItems; + + // Fire up a evt:refresh event once done. + $scope.deleteSelected = function () { + angular.forEach(selected, function(value, key) { + $scope.svc.delete(value).then( + function () { + i++; + if (i == selected.length) { + $rootScope.$broadcast('evt:refresh'); + } + } + ); + }); + }; + } + }; + }); +}); diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/general/common.navigation.module.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/general/common.navigation.module.js new file mode 100644 index 00000000..0bd2e848 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/general/common.navigation.module.js @@ -0,0 +1,6 @@ +define(['angularAMD'], function(ng) { + + var common_navigation = angular.module('app.common.navigation', []); + + return common_navigation; +}); diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/general/finishRender.module.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/general/finishRender.module.js new file mode 100644 index 00000000..3faf3f13 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/general/finishRender.module.js @@ -0,0 +1,24 @@ +define(['angularAMD'], function(ng) { + var module = angular.module('app.common.finishRender', []); + + module.config(function($compileProvider) { + module.register = { + directive : $compileProvider.register + }; + }); + + module.directive('onFinishRender', function ($timeout) { + return { + restrict: 'A', + link: function (scope, element, attr) { + if (scope.$last === true) { + $timeout(function () { + scope.$emit('ngRepeatFinished'); + }); + } + } + }; + }); + + return module; +}); diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/layout/index.tpl.html b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/layout/index.tpl.html new file mode 100644 index 00000000..0c57c523 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/layout/index.tpl.html @@ -0,0 +1,17 @@ + +<div ui-view="topbar"></div> +<div id="red"></div> +<div id="gray"></div> +<div id="wrapper"> + <nav id="sideMenu" ui-view="navigation" role="navigation"></nav> + <div id="page-wrapper-content"> + <div class="container-fluid"> + <div class="row content-row"> + <div id="pageContent" class="col-xs-12" ui-view="content"> + <!-- PAGE CONTENT BEGINS --> + </div><!-- /.col --> + </div><!-- /.row --> + </div> + </div><!-- /.page-content --> +</div> +<!-- /.main-content --> diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/layout/layout.module.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/layout/layout.module.js new file mode 100644 index 00000000..5438b050 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/layout/layout.module.js @@ -0,0 +1,44 @@ +// This module is used to populate views from the index.tpl.html +// Each module will register html pages with the appropriate HelperProvider's +// and this module will take everything from those Helpers and fill the view. +define(['angular', 'angular-ui-router', 'ocLazyLoad', 'common/general/common.general.directives', + 'common/general/common.navigation.directives', 'app/core/core.module'], function (angular) { + 'use strict'; + + var layout = angular.module('app.common.layout', ['ui.router.state', 'app.core', 'app.common.general', 'app.common.navigation']); + + layout.config(function ($stateProvider, TopBarHelperProvider, NavHelperProvider, ContentHelperProvider) { + + $stateProvider.state('main', { + url: '/', + views: { + 'mainContent@': { + controller: 'AppCtrl', + templateUrl: 'src/common/layout/index.tpl.html' + }, + 'navigation@main': { + template: NavHelperProvider.getViews(), + controller: 'NavCtrl' + }, + 'topbar@main': { + template: TopBarHelperProvider.getViews(), + controller: 'TopbarCtrl' + }, + 'content@main': { + template: ContentHelperProvider.getViews() + } + }, + resolve: { + loadCtrl: ['$ocLazyLoad', function ($ocLazyLoad) { + return $ocLazyLoad.load({ + files: ['app/app.controller'].concat(TopBarHelperProvider.getControllers()).concat(NavHelperProvider.getControllers()) + }); + }] + } + }); + + }); + + return layout; + +}); diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/login/forgot_password.tpl.html b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/login/forgot_password.tpl.html new file mode 100644 index 00000000..b366876b --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/login/forgot_password.tpl.html @@ -0,0 +1,45 @@ +<div id="forgot-box" class="forgot-box widget-box no-border"> + <div class="widget-body"> + <div class="widget-main"> + <h4 class="header red lighter bigger"> + <i class="icon-key"></i> + Retrieve Password + </h4> + + <div class="space-6"></div> + <p> + Enter your email and to receive instructions + </p> + + <form> + <fieldset> + <label> + <span class="block input-icon input-icon-right"> + <input type="email" class="span12" + data-ng-model="recover.email" + placeholder="Email"/> + <i class="icon-envelope"></i> + </span> + </label> + + <div class="clearfix"> + <button ng-click="sendForgotPassword()" type="button" + class="width-35 pull-right btn btn-small btn-danger"> + <i class="icon-lightbulb"></i> + Send Me! + </button> + </div> + </fieldset> + </form> + </div> + <!--/widget-main--> + + <div class="toolbar center"> + <a href="#" onclick="show_box('login-box'); return false;" class="back-to-login-link"> + Back to login + <i class="icon-arrow-right"></i> + </a> + </div> + </div> + <!--/widget-body--> +</div><!--/forgot-box-->
\ No newline at end of file diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/login/login.controller.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/login/login.controller.js new file mode 100644 index 00000000..750340d1 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/login/login.controller.js @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2014 Inocybe Technologies, and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ + +define(['common/login/login.module', 'common/authentification/auth.services'], function(login) { + + login.controller('LoginCtrl', function ($scope, $http, $window, Auth, $location) { + // default values + $scope.login = {}; + $scope.login.username = ""; + $scope.login.password = ""; + $scope.login.remember = false; + $scope.rememberme = true; + + $scope.sendLogin = function () { + Auth.login($scope.login.username, $scope.login.password, $scope.success, $scope.errorDisplay); + }; + + $scope.success = function(response) { + $window.location.href = 'index.html'; + }; + $scope.errorDisplay = function (error) { + $scope.error = "Unable to login"; + + }; + }); + + login.controller('forgotPasswordCtrl', function ($scope, $http) { + $scope.recover = {}; + $scope.recover.email = ""; + $scope.sendForgotPassword = function () { + $http.post('/recover', $scope.recover).success(function (data) { + if (data.recover) { + console.log("email sent"); + } + else { + console.log("email not sent"); + } + }); + + }; + }); + + login.controller('registerCtrl', function ($scope, $http) { + $scope.register = {}; + $scope.register.email = ""; + $scope.register.username = ""; + $scope.register.password = ""; + $scope.register.repeatPassword = ""; + $scope.register.userAgreement = false; + + $scope.sendRegister = function () { + $http.post('/register', $scope.register).success(function (data) { + if (data.register) { + console.log("registration is successful"); + } + else { + console.log("registration failed"); + } + }); + }; + }); +}); diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/login/login.less b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/login/login.less new file mode 100644 index 00000000..a4f9912a --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/login/login.less @@ -0,0 +1,193 @@ +/* login pages */ + +.login-container { + width:375px; + margin:0 auto; +} + +.login-layout { + background-color:#1D2024; + .main-container:after { + display:none; + } + + .main-content { + margin-left:0; + min-height:100%; + padding-left: 15px; + padding-right:15px; + } + + + label { + margin-bottom:11px; + } + + + .widget-box { + visibility:hidden; + position:absolute; + overflow:hidden; + width:100%; + + border-bottom:none; + box-shadow:none; + padding:6px; + background-color:#394557; + + .transform(~"scale(0,1) translate(-150px)"); + &.visible { + visibility:visible; + .transform(~"scale(1,1) translate(0)"); + + .transition(~"all .3s ease"); + -o-transition: none;/* too slow */ + -webkit-transition: none;/* works in chrome but not in safari, never scales back to 1! */ + } + + .widget-main { + padding:16px 36px 36px; + background:#F7F7F7; + form { + margin:0; + } + } + .widget-body .toolbar > div > a { + font-size:15px; + font-weight:400; + text-shadow:1px 0px 1px rgba(0,0,0,0.25); + } + } + + +} + + + + +.login-box { + .forgot-password-link { color:#FE9; } + .user-signup-link { color:#CF7; } + + .toolbar { + background:#5090C1; + border-top:2px solid #597597; + > div { + width:50%; + display:inline-block; + padding:9px 0 11px; + + &:first-child {//the first link + float:left; + text-align:left; + > a { + margin-left:11px; + } + + + div {//the next one + float:right; + text-align:right; + > a { + margin-right:11px; + } + } + } + } + } +} + + + + +.forgot-box .toolbar { + background:#C16050; + border-top:2px solid #976559; + padding:9px 18px; +} + +.signup-box .toolbar { + background:#76B774; + border-top:2px solid #759759; + padding:9px 18px; +} + +.forgot-box .back-to-login-link , .signup-box .back-to-login-link{ + color:#FE9; + font-size:14px; + font-weight:bold; + text-shadow:1px 0px 1px rgba(0,0,0,0.25); +} + + + + + +/* social login */ +.login-layout .login-box .widget-main { + padding-bottom:16px; +} +.login-box { + + .social-or-login { + margin-top:4px; + + position:relative; z-index:1; + :first-child { + display:inline-block; + background: #F7F7F7; + padding: 0 8px; + color: #5090C1; font-size: 13px; + } + + &:before { + content:""; display:block; + position:absolute; z-index:-1; + top:50%; left:0; right:0; + border-top:1px dotted #A6C4DB; + } + } + + .social-login { + margin-top:12px; + a { + border-radius:100%; + width:42px; height:42px; line-height:46px; + padding:0; + margin:0 1px; + border:none; + > [class*="icon-"] { + font-size:24px; + margin:0; + } + } + } + +} + + + + + +/* loginbox */ +@media only screen and (max-width: @screen-xs) { +.login-layout .widget-box .widget-main { + padding:16px; +} +} +@media only screen and (max-width: @screen-xs) { +.login-container { + width:98%; +} +.login-layout .widget-box { + padding:0; +} + +.login-box .toolbar > div { + width:auto; +} +} +@media only screen and (max-width: @screen-xs-max) { +.login-layout .widget-box.visible { + .transition(~"none"); +} +} diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/login/login.module.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/login/login.module.js new file mode 100644 index 00000000..72702c65 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/login/login.module.js @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2014 Inocybe Technologies, and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ + +define(['angularAMD', 'jquery', 'common/authentification/auth.module', 'ocLazyLoad'], function (ng, $) { + var login = angular.module('app.common.login', ['app.common.auth', 'ui.router.state']); + + login.config(function ($stateProvider, $httpProvider) { + $stateProvider + .state('login', { + url: '/login', + views: { + 'mainContent@': { + templateUrl: 'src/common/login/login.tpl.html', + controller: 'LoginCtrl' + } + }, + resolve: { + loadController: ['$ocLazyLoad', function ($ocLazyLoad) { + return $ocLazyLoad.load({ + files: ['src/common/login/login.controller.js'] + }); + }] + } + }); + + $httpProvider.interceptors.push('NbInterceptor'); + }); + + login.run(function ($rootScope, $location, Auth) { + + // to avoid recursive loop + var publicPath = ['/login']; + + var isPublicPath = function (route) { + var found = false; + $.each(publicPath, function (key, value) { + found = found || route.match('^' + value); + }); + return found; + }; + + $rootScope.$on('$stateChangeStart', function () { + if (!isPublicPath($location.url()) && !Auth.isAuthed()) { + $location.path('/login'); + } + }); + + }); + + return login; +}); diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/login/login.spec.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/login/login.spec.js new file mode 100644 index 00000000..47fcf35b --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/login/login.spec.js @@ -0,0 +1,61 @@ +define(['common/login/login.controller', 'angular-ui-router', 'common/layout/layout.module'], function() { + describe('Login Module', function() { + var scope, state, controller, location, AuthMock; + var url = '/test'; + + beforeEach(module('ui.router')); + beforeEach(module('app.common.layout')); + beforeEach(module('app.common.login', function($provide) { + AuthMock = { + isAuthed: function() {}, + login: function() {} + }; + $provide.value('Auth', AuthMock); + })); + + beforeEach(inject( function($rootScope, $controller, $state, $location) { + scope = $rootScope.$new(); + controller = $controller; + state = $state; + location = $location; + })); + + it('Should load the login state', function() { + var stateName = 'login'; + + controller('LoginCtrl', {$scope: scope, $state: state}); + expect(state.href(stateName, {})).toBe('#/login'); + }); + + it('Should redirect any url to login if not logged', function() { + var stateName = 'login'; + spyOn(AuthMock,'isAuthed').andReturn(false); + location.url(url); + controller('LoginCtrl', {$scope: scope, $state: state}); + state.go('main'); + + expect(AuthMock.isAuthed).toHaveBeenCalled(); + expect(state.is("login")); + expect(location.url()).toEqual('/login'); + }); + + it('Should not redirect if logged', function() { + spyOn(AuthMock,'isAuthed').andReturn(true); + location.url(url); + controller('LoginCtrl', {$scope: scope, $state: state}); + state.go('main'); + + expect(AuthMock.isAuthed).toHaveBeenCalled(); + expect(state.is("main")); + expect(location.url()).toEqual(url); + }); + + it('Should call the Auth module', function() { + spyOn(AuthMock,'login'); + controller('LoginCtrl', {$scope: scope, $state: state}); + + scope.sendLogin(); + expect(AuthMock.login).toHaveBeenCalled(); + }); + }); +}); diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/login/login.tpl.html b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/login/login.tpl.html new file mode 100644 index 00000000..ae993569 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/login/login.tpl.html @@ -0,0 +1,31 @@ +<div class="container"> + <div class="row"> + <div class="col-md-4 col-md-offset-4"> + <div class="login-panel panel panel-default"> + <div class="panel-heading"> + <h3 class="panel-title">Please Sign In</h3> + </div> + <div style="color:Red;text-align: center">{{error}}</div> + <img style="width: 350px" src="assets/images/opendaylight-open-source.jpg" alt="OpenDayLight"> + <div class="panel-body"> + <form role="form"> + <fieldset> + <div class="form-group"> + <input class="form-control" ng-model="login.username" placeholder="Username" name="username" type="text" autofocus> + </div> + <div class="form-group"> + <input class="form-control" placeholder="Password" ng-model="login.password" name="password" type="password" value=""> + </div> + <div class="checkbox"> + <label> + <input ng-model="login.remember" name="remember" type="checkbox" value="Remember Me">Remember Me + </label> + </div> + <!-- Change this to a button or input when using this as a form --> + <button ng-click="sendLogin()" class="btn btn-lg btn-orange btn-block">Login</a> + </fieldset> + </form> + </div> + </div> + </div> +</div> diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/login/register.tpl.html b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/login/register.tpl.html new file mode 100644 index 00000000..725dc392 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/login/register.tpl.html @@ -0,0 +1,74 @@ +<div id="signup-box" class="signup-box widget-box no-border"> + <div class="widget-body"> + <div class="widget-main"> + <h4 class="header green lighter bigger"> + <i class="icon-group blue"></i> + New User Registration + </h4> + + <div class="space-6"></div> + <p> Enter your details to begin: </p> + + <form> + <fieldset> + <label class="block clearfix"> + <span class="block input-icon input-icon-right"> + <input type="email" data-ng-model="register.email" class="form-control" placeholder="Email" /> + <i class="icon-envelope"></i> + </span> + </label> + + <label class="block clearfix"> + <span class="block input-icon input-icon-right"> + <input type="text" data-ng-model="register.username" class="form-control" placeholder="Username" /> + <i class="icon-user"></i> + </span> + </label> + + <label class="block clearfix"> + <span class="block input-icon input-icon-right"> + <input type="password" data-ng-model="register.password" class="form-control" placeholder="Password" /> + <i class="icon-lock"></i> + </span> + </label> + + <label class="block clearfix"> + <span class="block input-icon input-icon-right"> + <input type="password" data-ng-model="register.repeatPassword" class="form-control" placeholder="Repeat password" /> + <i class="icon-retweet"></i> + </span> + </label> + + <label class="block"> + <input type="checkbox" data-ng-model="register.userAgreement" class="ace" /> + <span class="lbl"> + I accept the + <a href="#">User Agreement</a> + </span> + </label> + + <div class="space-24"></div> + + <div class="clearfix"> + <button type="reset" class="width-30 pull-left btn btn-sm"> + <i class="icon-refresh"></i> + Reset + </button> + + <button type="button" ng-click="sendRegister()" class="width-65 pull-right btn btn-sm btn-success"> + Register + <i class="icon-arrow-right icon-on-right"></i> + </button> + </div> + </fieldset> + </form> + </div> + + <div class="toolbar center"> + <a href="#" onclick="show_box('login-box'); return false;" class="back-to-login-link"> + <i class="icon-arrow-left"></i> + Back to login + </a> + </div> + </div><!-- /widget-body --> + </div><!-- /signup-box -->
\ No newline at end of file diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/navigation/nav_item_template.tpl.html b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/navigation/nav_item_template.tpl.html new file mode 100644 index 00000000..391696c2 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/navigation/nav_item_template.tpl.html @@ -0,0 +1,14 @@ +<a href="{{item.link}}" ng-if="isValid(item.submenu)" target="_self" ng-click="updateTemplate($event, item)"> + <i class="{{item.icon}}"></i> {{item.title | translate}} + <span ng-show="isValid(item.submenu)" class="arrow icon-angle-down"></span> +</a> +<a href="{{item.link}}" target="_self" ng-if="!isValid(item.submenu)"> + <i class="{{item.icon}}"></i> {{item.title | translate}} +</a> + +<ul class="nav nav-second-level collapse" style="display: {{display}}"> + + <li ng-class="{ active: (isState(item.active) && !isValid(item.submenu)) }" ng-controller="NavItemCtrl" ng-repeat="item in item.submenu" ng-include="'src/common/navigation/nav_item_template.tpl.html'"> + + </li> +</ul> diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/navigation/navigation-min.less b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/navigation/navigation-min.less new file mode 100644 index 00000000..52d78e93 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/navigation/navigation-min.less @@ -0,0 +1,225 @@ +.menu_min() { + &.sidebar { + width:@sidebar-min-width; + &:before { + width:@sidebar-min-width; + } + + .main-content { + margin-left:(@sidebar-min-width); + .breadcrumbs.fixed , .breadcrumbs.breadcrumbs-fixed { left:(@sidebar-min-width); } + } + } + + .nav-list a { + .badge , .label { + position:relative; + top:-1px; + right:auto; + left:4px; + } + } + + .nav-list .submenu .submenu a { + .badge , .label { + top:0; + } + } + + + .nav-list > li { + > a { + position:relative; + > .menu-text { + display:none; + + position:absolute; + left:(@sidebar-min-width - 1); + top:-2px; + width:(@sidebar-width - 16); + height:40px; + + line-height:38px; + background-color:@menumin-bg; + z-index:121; + + .box-shadow(@menumin-shadow); + border:1px solid @menumin-border; + + padding-left:12px; + } + &.dropdown-toggle > .menu-text { + .box-shadow(none); + border:none; + top:-1px; left:@sidebar-min-width; + width:(@sidebar-width - 16); + border-bottom:1px solid @menumin-text-border; + } + .arrow { + display:none; + } + + &:hover:before {/* the right side border on hover */ + width:2px; + } + } + + &:hover > a { + color:@menu-focus-color; + > .menu-text { + display:block; + } + } + &.active > a > .menu-text { + border-left-color:@menu-focus-color; + } + &.open > a { + background-color:@menu-open-bg; + color:@menu-color; + } + &.open.active > a { + background-color:@menu-active-bg; + } + &.open:hover > a { + color:@menu-focus-color; + } + &.active > a { + color:@menu-active-color; + } + + &.active > a:after { /* the caret */ + border-width:10px 6px; + top:8px; + } + &.active.open > a:after { + display:block; + } + &.active.open li.active > a:after { + display:none; + } + + + + > .submenu { + background:@submenu-bg; + position:absolute; z-index:120; + left:(@sidebar-min-width - 1); top:-2px; + + width:(@sidebar-width - 14); + border:1px solid @menumin-border; + + .box-shadow(@menumin-shadow); + + padding-top:40px; + padding-bottom:2px; + + display:none !important; + + &:before { + /* hide the tree like submenu in minimized mode */ + display:none; + } + + li { + &:before { + display:none; + } + + > a { + //border-left:none; + margin-left:0; + padding-left:24px; + > [class*="icon-"]:first-child { + left:4px; + } + } + + } + } + + + + &:hover > .submenu { + display:block !important; + } + &.active > .submenu { + border-left-color:@menu-active-color; + } + } + + + + + + //sidebar shortcuts + .sidebar-shortcuts { + position:relative; + } + .sidebar-shortcuts-mini { + display:block; + } + + .sidebar-shortcuts-large { + display:none; + position:absolute; + z-index:20; + top:-1px; + left:@sidebar-min-width - 1; + + width:(@sidebar-width - 8); + + padding:0 2px 1px; + + background-color:@submenu-bg; + .box-shadow(@menumin-shadow); + border:1px solid @menumin-border; + } + .sidebar-shortcuts:hover .sidebar-shortcuts-large{ + display:block; + } + + .sidebar-collapse { /* minimized collapse button */ + &:before { + left:5px; right:5px; + } + > [class*="icon-"] { + font-size:13px; + padding:0 4px; + line-height:15px; + + border-width:1px; + border-color:darken(@menumin-icon-border, 5%); + } + } + + + + + .nav-list > li > .submenu { + li > .submenu > li { + > a {/*3rd level*/ + margin-left:0px; + padding-left:30px; + } + > .submenu > li > a {/*4th level*/ + margin-left:0px; + padding-left:45px; + } + } + + li.active > a:after { + display:none; + } + } + + + .nav-list li.active.open > .submenu > li.active > a:after { + display: none; + } +} + + + + +.menu-min { + .menu_min(); +} diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/navigation/navigation.controller.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/navigation/navigation.controller.js new file mode 100644 index 00000000..5faa039a --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/navigation/navigation.controller.js @@ -0,0 +1,40 @@ +define(['angular'], function (angular) { + 'use strict'; + + var NavCtrl = function ($scope, NavHelper) { + $scope.navList = NavHelper.getMenu(); + }; + NavCtrl.$inject = ['$scope', 'NavHelper']; + + var NavItemCtrl = function ($scope) { + $scope.display = 'none'; + $scope.isOpen = false; + + $scope.isValid = function (value) { + if (angular.isUndefined(value) || value === null) { + return false; + } else { + return true; + } + }; + + $scope.updateTemplate = function (e) { + e.stopPropagation(); + e.preventDefault(); + + $scope.isOpen = !$scope.isOpen; + if ($scope.display === 'none') { + $scope.display = 'block'; + } else { + $scope.display = 'none'; + } + }; + }; + NavItemCtrl.$inject = ['$scope', 'NavHelper']; + + return { + NavCtrl: NavCtrl, + NavItemCtrl: NavItemCtrl + }; + +}); diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/navigation/navigation.less b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/navigation/navigation.less new file mode 100644 index 00000000..e22014a8 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/navigation/navigation.less @@ -0,0 +1,19 @@ +#page-wrapper { + min-height: 0px !important; +} + +.btn-orange { + background-color: orange; +} + +.error { + color: Red; +} + +html, body, #page-wrapper, #main-content-container{ + height: 100%; +} + +.footable { + margin-top: 25px; +}
\ No newline at end of file diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/navigation/navigation.module.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/navigation/navigation.module.js new file mode 100644 index 00000000..e3c0627c --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/navigation/navigation.module.js @@ -0,0 +1,20 @@ +define(['angular', './navigation.controller', './navigation.services', 'app/core/core.module', + 'Restangular', 'common/config/env.module'], function (angular, controller, services) { + + 'use strict'; + var nav = angular.module('app.common.nav', ['app.core', 'restangular', 'config']); + + nav.config(function (NavHelperProvider) { + NavHelperProvider.addToView('src/common/navigation/navigation.tpl.html'); + NavHelperProvider.addControllerUrl('common/navigation/navigation.controller'); + }); + + // controllers + nav.controller('NavCtrl', controller.NavCtrl); + nav.controller('NavItemCtrl', controller.NavItemCtrl); + + // services + nav.factory('MDSalRestangular', services.MDSalRestangular); + + return nav; +}); diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/navigation/navigation.services.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/navigation/navigation.services.js new file mode 100644 index 00000000..33db13a9 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/navigation/navigation.services.js @@ -0,0 +1,14 @@ +define([], function () { + 'use strict'; + + var MDSalRestangular = function (Restangular, ENV) { + return Restangular.withConfig(function (RestangularConfig) { + RestangularConfig.setBaseUrl(ENV.getBaseURL('MD_SAL')); + }); + }; + MDSalRestangular.$inject = ['Restangular', 'ENV']; + + return { + MDSalRestangular: MDSalRestangular + }; +}); diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/navigation/navigation.spec.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/navigation/navigation.spec.js new file mode 100644 index 00000000..db4e4b18 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/navigation/navigation.spec.js @@ -0,0 +1,103 @@ +define(['common/navigation/navigation.module', 'angular-ui-router',], function () { + describe('Navigation Module', function () { + var scope, NavHelperMock, EventMock, controller; + + beforeEach(angular.mock.module('ui.router')); + beforeEach(module('app.core', function ($provide) { + function NavHelperProvider() { + this.addToView = function (url) {}; + this.addControllerUrl = function (url) {}; + this.$get = function NavHelperFactory() { + return new NavHelperProvider(); + }; + } + $provide.provider('NavHelper', NavHelperProvider); + })); + + beforeEach(module('app.common.nav')); + + beforeEach(inject(function ($rootScope, $controller) { + scope = $rootScope.$new(); + controller = $controller; + + NavHelperMock = { + getMenu: function () { + return { + "id": "", + "title": "", + "active": "", + "submenu": "" + }; + } + }; + + EventMock = { + stopPropagation: function () { + return null; + }, + preventDefault: function () { + return null; + } + }; + + })); + + it('Should have receive all menu items', function () { + spyOn(NavHelperMock, 'getMenu').andCallThrough(); + controller('NavCtrl', { + $scope: scope, + NavHelper: NavHelperMock + }); + + expect(NavHelperMock.getMenu).toHaveBeenCalled(); + expect(scope.navList).toBeDefined(); + }); + + it('Should have create utility methods to show and hide submenu', function () { + controller('NavItemCtrl', { + $scope: scope, + NavHelper: NavHelperMock + }); + + expect(scope.display).toEqual('none'); + expect(scope.isOpen).toBeFalsy(); + + expect(scope.isValid).toBeDefined(); + expect(scope.updateTemplate).toBeDefined(); + }); + + it('Should look if a item exist or not', function () { + controller('NavItemCtrl', { + $scope: scope, + NavHelper: NavHelperMock + }); + var item = {}; + + expect(scope.isValid(item)).toBeTruthy(); + expect(scope.isValid(null)).toBeFalsy(); + }); + + it('Should toggle the status of the item scope', function () { + spyOn(EventMock, 'stopPropagation').andCallThrough(); + spyOn(EventMock, 'preventDefault').andCallThrough(); + controller('NavItemCtrl', { + $scope: scope, + NavHelper: NavHelperMock + }); + + var initOpen = scope.isOpen; + var initDisplay = scope.display; + + scope.updateTemplate(EventMock, {}); + expect(scope.isOpen).not.toEqual(initOpen); + expect(scope.display).not.toEqual(initDisplay); + + scope.updateTemplate(EventMock, {}); + expect(scope.isOpen).toEqual(initOpen); + expect(scope.display).toEqual(initDisplay); + + expect(EventMock.stopPropagation.calls.length).toEqual(2); + expect(EventMock.preventDefault.calls.length).toEqual(2); + }); + }); +}); diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/navigation/navigation.tpl.html b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/navigation/navigation.tpl.html new file mode 100644 index 00000000..d1053ac2 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/navigation/navigation.tpl.html @@ -0,0 +1,6 @@ +<div class="sidebar-collapse"> + <ul id="side-menu" class="nav"> + <li ng-class="{ active: (isState(item.active) && !isValid(item.submenu))}" ng-controller="NavItemCtrl" ng-repeat="item in navList" ng-include="'src/common/navigation/nav_item_template.tpl.html'" ng-type="{{item.id}}"> + </li> + </ul> +</div> diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/topbar/messages.tpl.html b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/topbar/messages.tpl.html new file mode 100644 index 00000000..b637cba6 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/topbar/messages.tpl.html @@ -0,0 +1,28 @@ +<li class="dropdown"> + <a data-toggle="dropdown" class="dropdown-toggle" href=""> + <i class="icon-envelope icon-animated-vertical"></i> + </a> + <ul class="dropdown-menu dropdown-messages"> + <li ng-repeat="message in messages.latest"> + <a href="#"> + <!-- <img src="/avatars/{{message.img}}" class="msg-photo" alt="{{message.name}}'s Avatar"> Do not need it for now --> + <div> + <strong>{{message.name}}</strong> + <span class="pull-right text-muted"> + <em>{{message.time}}</em> + </span> + </div> + <div>{{message.summary}}</div> + </a> + </li> + + + <li> + <a href="#" class="text-center"> + <strong>Read All Messages</strong> + <i class="icon-arrow-right"></i> + </a> + </li> + + </ul> +</li>
\ No newline at end of file diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/topbar/notifications.tpl.html b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/topbar/notifications.tpl.html new file mode 100644 index 00000000..cefa739c --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/topbar/notifications.tpl.html @@ -0,0 +1,25 @@ +<li class="dropdown"> + <a data-toggle="dropdown" class="dropdown-toggle" href=""> + <i class="icon-bell-alt icon-animated-bell"></i> + <span class="badge badge-important">{{ notifs.count }}</span> + </a> + <ul class="dropdown-menu dropdown-alerts"> + <li ng-repeat="notif in notifs.latest"> + <a href="#"> + + <div> + <i class="btn btn-xs no-hover {{notif.iconClass}} {{notif.icon}}"></i>{{notif.title}} + <span class="pull-right text-muted small">4 minutes ago</span> + </div> + </a> + </li> + + + <li> + <a href="#" class="text-center"> + <strong>See all notifications</strong> + <i class="icon-arrow-right"></i> + </a> + </li> + </ul> +</li>
\ No newline at end of file diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/topbar/tasks.tpl.html b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/topbar/tasks.tpl.html new file mode 100644 index 00000000..01a47e09 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/topbar/tasks.tpl.html @@ -0,0 +1,32 @@ +<li class="grey"> + <a data-toggle="dropdown" class="dropdown-toggle" href=""> + <i class="icon-tasks"></i> + <span class="badge badge-grey">{{ tasks.count }}</span> + </a> + + <ul class="dropdown-menu dropdown-tasks"> + <li ng-repeat="task in tasks.latest"> + <a href="#"> + <div> + <p><strong>{{ task.title }}</strong> + <span class="pull-right text-muted">{{ task.percentage }}%</span></p> + </div> + <div class="progress progress-striped active"> + + <div class="progress progress-mini {{task.progressClass}}"> + <div style="width:{{task.percentage}}%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="{{task.percentage}}" role="progressbar" class="progress-bar {{task.progressBarClass}}"> + <span class="sr-only">{{task.percentage}}% Complete</span> + </div> + </div> + </div> + </a> + </li> + + <li> + <a href="#"> + See tasks with details + <i class="icon-arrow-right"></i> + </a> + </li> + </ul> +</li>
\ No newline at end of file diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/topbar/topbar.controller.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/topbar/topbar.controller.js new file mode 100644 index 00000000..81e9616d --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/topbar/topbar.controller.js @@ -0,0 +1,54 @@ +define(['common/topbar/topbar.module', 'common/topbar/topbar.directives', 'common/authentification/auth.services'], function(topbar) { + + topbar.controller('TopbarCtrl', function() { + $('#toggleMenu').click(function(e) { + e.preventDefault(); + $('#wrapper').toggleClass('toggled'); + }); + }); + + topbar.controller('topBarTasksCtrl', function($scope, taskFactory) { + $scope.tasks = taskFactory.getTaskData(); + }); + + topbar.controller('topBarNotifsCtrl', function($scope, notifsFactory) { + $scope.notifs = notifsFactory.getNotifsData(); + $scope.isValid = function(value) { + if (angular.isUndefined(value) || value === null) { + return false; + } else { + return true; + } + }; + }); + + topbar.controller('topBarMessagesCtrl', function($scope, messageFactory) { + $scope.messages = messageFactory.getMessageData(); + $scope.isValid = function(value) { + if (angular.isUndefined(value) || value === null) { + return false; + } else { + return true; + } + }; + }); + + // the authorization module is not converted yet + topbar.controller('topBarUserMenuCtrl', function($scope, $cookieStore, Auth, $window) { + $scope.logOut = logout; + + /** + * Provides logout from application and redirects to login page + * @return {[type]} [description] + */ + function logout() { + Auth.logout(function() { + $window.location.href = 'index.html#/login'; + }); + } + + $scope.getUsername = function() { + return $window.localStorage.odlUser; + }; + }); +}); diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/topbar/topbar.directives.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/topbar/topbar.directives.js new file mode 100644 index 00000000..f29e3c59 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/topbar/topbar.directives.js @@ -0,0 +1,40 @@ +define(['common/topbar/topbar.module'], function(topbar) { + topbar.directive('mcTopBar', function () { + return { + replace: true, + templateUrl: 'topbar/topbar.tpl.html', + }; + }); + + topbar.directive('mcTopBarTasks', function () { + return { + replace: true, + controller: 'topBarTasksCtrl', + templateUrl: 'topbar/tasks.tpl.html' + }; + }); + + topbar.directive('mcTopBarNotifications', function () { + return { + replace: true, + controller: 'topBarNotifsCtrl', + templateUrl: 'topbar/notifications.tpl.html' + }; + }); + + topbar.directive('mcTopBarMessages', function () { + return { + replace: true, + controller: 'topBarMessagesCtrl', + templateUrl: 'topbar/messages.tpl.html' + }; + }); + + topbar.directive('mcTopBarUserMenu', function () { + return { + replace: true, + controller: 'topBarUserMenuCtrl', + templateUrl: 'src/common/topbar/user_menu.tpl.html' + }; + }); +}); diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/topbar/topbar.less b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/topbar/topbar.less new file mode 100644 index 00000000..dadf0a6f --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/topbar/topbar.less @@ -0,0 +1,40 @@ +#toggleMenu { + display:block; + text-align: right; + padding:9px; + color:white !important; +} + +#toggleMenu:focus, #toggleMenu:hover { + background-color: inherit; +} + +#wrapper.toggled { + padding-left: 0; +} + +#wrapper.toggled #sideMenu { + width:0; +} + +#wrapper.toggled #sideMenu ul { + display:none; +} + +div > nav.navbar { + margin-bottom:0; +} + +#logout-button { + color: #ffffff !important; + padding: 9px !important; + min-height: 0; +} + +#logout-button:hover, #logout-button:active, #logout-button:focus { + background-color: inherit !important; +} + +.navbar-top-links * { + vertical-align: middle; +}
\ No newline at end of file diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/topbar/topbar.module.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/topbar/topbar.module.js new file mode 100644 index 00000000..5bb0ba92 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/topbar/topbar.module.js @@ -0,0 +1,11 @@ +define(['angularAMD', 'angular-cookies', 'app/core/core.services'], function(ng) { + var topbar = angular.module('app.common.topbar', ['ngCookies', 'app.core']); + + topbar.config(function($compileProvider, TopBarHelperProvider) { + + TopBarHelperProvider.addToView('src/common/topbar/topbar.tpl.html'); + TopBarHelperProvider.addControllerUrl('common/topbar/topbar.controller'); + }); + + return topbar; +}); diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/topbar/topbar.services.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/topbar/topbar.services.js new file mode 100644 index 00000000..6a6ba885 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/topbar/topbar.services.js @@ -0,0 +1,103 @@ +define(['common/topbar/topbar.module'], function(topbar) { + topbar.factory('taskFactory',function () { + var factory = {}; + factory.getTaskData = function () { + return { + count: 4, + latest: [ + { + title: "Software Update", + percentage: 65 + }, + { + title: "Hardware Upgrade" , + percentage: 35 , + progressBarClass: "progress-bar-danger" + }, + { + title: "Unit Testing" , + percentage: 15 , + progressBarClass: "progress-bar-warning" + }, + { + title: "Bug Fixes" , + percentage: 90 , + progressClass: "progress-striped active", + progressBarClass: "progress-bar-success" + } + ] + }; + + }; + return factory; + }); + + topbar.factory('messageFactory', function () { + var factory = {}; + factory.getMessageData = function () { + return { + count: 5, + latest: [ + { + name: "Alex", + img: "avatar.png", + time: "a moment ago", + summary: "Ciao sociis natoque penatibus et auctor ..." + }, + { + name: "Susan", + img: "avatar3.png", + time: "20 minutes ago", + summary: "Vestibulum id ligula porta felis euismod ..." + }, + { + name: "Bob", + img: "avatar4.png", + time: "3:15 pm", + summary: "Nullam quis risus eget urna mollis ornare ..." + } + ] + }; + }; + return factory; + }); + + topbar.factory('notifsFactory', function () { + var factory = {}; + factory.getNotifsData = function () { + return { + "count": 8, + "latest": [ + { + title: "New Comments", + icon: "icon-comment", + iconClass: "btn-pink", + badge: "+12", + badgeClass: "badge-info" + }, + { + title: "Bob just signed up as an editor ...", + icon: "icon-user", + iconClass: "btn-primary" + }, + { + title: "New Orders", + icon: "icon-shopping-cart", + iconClass: "btn-success", + badge: "+8", + badgeClass: "badge-success" + }, + { + title: "Followers", + icon: "icon-twitter", + iconClass: "btn-info", + badge: "+11", + badgeClass: "badge-info" + } + ] + }; + + }; + return factory; + }); +}); diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/topbar/topbar.tpl.html b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/topbar/topbar.tpl.html new file mode 100644 index 00000000..8fcb6efe --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/topbar/topbar.tpl.html @@ -0,0 +1,25 @@ +<nav class="navbar navbar-default navbar-static-top" role="navigation"> + <!-- the script for the resizing was here --> + + +<img id="logo_opendaylight" src="assets/images/logo_opendaylight.gif" class="img-responsive-v1" border="0" alt="OpenDayLight" /><img id="logo_opendaylight_white" src="assets/images/logo_opendaylight_white.gif" class="img-responsive-v1" border="0" alt="OpenDayLight" /><img ng-src="{{section_logo}}" id="page_logo" class="img-responsive-v1" border="0" alt="OpenDayLight" /> + +<div style="background-color:red;display:inline;width:100%;"></div> + + <ul class="nav navbar-top-links navbar-right"> + <li><a id="toggleMenu" class="btn" href="#"><i class="icon-reorder icon-2x"></i></a></li> + <!--<img src="assets/images/User.png" class="right-topbar" border="0" alt="OpenDayLight" /> + <img src="assets/images/Info.png" class="right-topbar" border="0" alt="OpenDayLight" /> + <img src="assets/images/OSGI.png" class="right-topbar" border="0" alt="OpenDayLight" />--> + <!-- for now no image since we dont use them.... --> + <!-- + Don't need them for now... + <div data-mc-top-bar-tasks></div> + <div data-mc-top-bar-notifications></div> + <div data-mc-top-bar-messages></div> + --> + <div data-mc-top-bar-user-menu></div> + </ul><!-- /.ace-nav --> + + +</nav> diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/topbar/user_menu.tpl.html b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/topbar/user_menu.tpl.html new file mode 100644 index 00000000..d8be4aa4 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/topbar/user_menu.tpl.html @@ -0,0 +1 @@ +<li data-ng-click="logOut()"><a href="#" id="logout-button" class="btn"><i class="icon-off"></i> Logout ({{getUsername()}})</a></li> diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/index.html b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/index.html new file mode 100644 index 00000000..ce4e2604 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/index.html @@ -0,0 +1,43 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8" /> + <title>OpenDaylight Dlux</title> + + <meta name="description" content="overview & stats" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <script type="text/javascript"> + // global variables + + </script> + + <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> + + <!--[if lt IE 9]> + <script src="assets/js/html5shiv.js"></script> + <script src="assets/js/respond.min.js"></script> + <![endif]--> + + <!-- compiled CSS --> + <link rel="stylesheet" type="text/css" href="vendor/ng-grid/ng-grid.min.css" /> + <link rel="stylesheet" type="text/css" href="vendor/select2-bootstrap-css/select2-bootstrap.css" /> + <link rel="stylesheet" type="text/css" href="vendor/footable/css/footable.core.min.css" /> + <link rel="stylesheet" type="text/css" href="vendor/footable/css/footable.standalone.min.css" /> + <link rel="stylesheet" type="text/css" href="vendor/vis/dist/vis.min.css" /> + <link rel="stylesheet" type="text/css" href="vendor/ng-slider/dist/css/ng-slider.min.css" /> + <link rel="stylesheet" type="text/css" href="vendor/angular-material/angular-material.css" /> + <link rel="stylesheet" type="text/css" href="vendor/material-design-icons/iconfont/material-icons.css" /> + <link rel="stylesheet" type="text/css" href="assets/opendaylight-dlux-0.2.0.css" /> + <link rel="stylesheet" href="assets/css/sb-admin.css" /> + + <script type="text/javascript" data-main="src/main.js" src="vendor/requirejs/require.js"></script> + + <link rel="stylesheet" href="assets/css/font-awesome.min.css" /> + <!-- the font-awesome is different from the 'official' one --> + <!-- application CSS --> + </head> + + <body class="skin-3"> + <div ui-view="mainContent" id="main-content-container"></div> + </body> +</html> diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/less/design.less b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/less/design.less new file mode 100644 index 00000000..467bbc57 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/less/design.less @@ -0,0 +1,190 @@ +.menu-sidebar, html { + height: 100%; + background-color: #808285; +} + +.menu-sidebar{ + height: auto; + min-height: calc(~'100% - 61px'); +} + +.navbar-static-side ul li { + border-bottom: none !important; +} + +a { + color: #414042 /*!important*/; +} + +li.active { + background-color: #414042 !important; + a { + color: white !important; + } +} + +#page-wrapper { + background-color: #414042 !important; + border-left: none !important; +} + +.nav .active a { + background: none !important; +} + +.menu { + background: none !important; +} + +.nav.nav-pills { + li a { + color: white !important; + } + li.active { + background-color: orange !important; + } +} + +.form-group label { + color: white; +} + +.select2-choice, .select2-choices { + background-color: #58595B !important; +} + + +.img-responsive-v1 { + height: auto; + max-width: 100%; +} + +.btn-orange { + background-color: orange; +} +h1, h2, h3, h4, h5, h6 { + color: white; +} + +#logo_flows { + background-image: url('images/logo_flows1.gif'); +} + +.footable { + border: none; +} + + +.footable > thead > tr > th { + background-color: orange; + background-image: none; + border: none; + box-shadow: none; +} + +.add-row { + background-color: orange; + border: none; + &:hover { + background-color: rgb(211, 84, 0); + } +} + +.nav.nav-pills li a:hover { + color: black !important; +} + +.menu ul { + border-bottom: 1px solid #939598 !important +} + +.form-group { + input { + border: 1px solid #939598; + } +} + +.select2-choice { + border: 1px solid #939598 !important; +} + +#red { + height: 6px; + width: 100%; + background-color: #EE2E24; +} + +#gray { + height: 6px; + width: 100%; + background-color: #58585A; +} + +.navbar { + min-height: 0px; +} + +.navbar { + border-bottom: none !important; + background-color: black !important; +} +@media all and (max-width: 462px) { + + .navbar { + border-bottom: none !important; + background-color: #F3F3F4 !important; +} + #page_logo { + display: none; + } + + #logo_opendaylight { + display: none !important; + } + + #logo_opendaylight_white { + display: inline !important; + } +} + +.opendaylight_logo { + background-image: url(images/logo_opendaylight_white.gif); + height: 34px; + width: 127px; + background-repeat: no-repeat; +} + + #logo_opendaylight_white { + display: none; + } + + #logo_opendaylight { + display: inline; + } + +.right-topbar { + margin-right: 5px; + margin-left: 5px; +} + +.select2-drop-active { +background-color: #58595B; +} + +#page-wrapper { + padding-left: 15px !important; + padding-right: 15px !important; +} + +.content-row { + background-color: #414042 !important; +} +.detail-page { + tr th, tr td { + color: white; + } +} + +.white-detail-page { + color: white; +} diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/less/main.less b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/less/main.less new file mode 100644 index 00000000..9fdfdd28 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/less/main.less @@ -0,0 +1,133 @@ +/**
+ * This is the main application stylesheet. It should include or import all
+ * stylesheets used throughout the application as this is the only stylesheet in
+ * the Grunt configuration that is automatically processed.
+ */
+
+
+/**
+ * First, we include the Twitter Bootstrap LESS files. Only the ones used in the
+ * project should be imported as the rest are just wasting space.
+ */
+@import '../../vendor/bootstrap/less/mixins.less';
+@import '../../vendor/bootstrap/less/bootstrap.less';
+
+
+@import 'mixins.less'; /** this one comes from the template */
+
+/**
+ * This is our main variables file. It in turn imports the `variables` file from
+ * Twitter Bootstrap. We must include it last so we can overwrite any variable
+ * definitions in our imported stylesheets.
+ */
+
+@import 'variables.less';
+
+
+/**
+ * Typography
+ */
+
+@font-face {
+ font-family: 'Roboto';
+ font-style: normal;
+ font-weight: 400;
+ src: local('Roboto Regular'), local('Roboto-Regular'), url(fonts/Roboto-Regular.woff) format('woff');
+}
+
+code, pre, .pre {
+ padding: 5px;
+ margin: 10px 0;
+ background-color: #EFEFEF;
+ border: 1px solid #DADADA;
+ // .border-radius(3px);
+}
+
+code {
+ padding: 0 3px;
+}
+
+pre {
+ margin: 10px 0;
+ padding: 5px;
+}
+
+.page-header {
+ margin-top: 60px;
+
+ &:first-child {
+ margin-top: 20px;
+ }
+}
+
+h2 {
+ margin: 20px 0;
+ color: #666;
+}
+
+.main {
+ position: relative;
+}
+
+/**
+ * Navigation
+ */
+
+
+
+/**
+ * Footer
+ */
+
+.footer {
+ margin-top: 80px;
+
+ .footer-inner {
+ padding: 40px 0;
+ border-top: 1px solid #DDD;
+ }
+
+ .social {
+ float: right;
+ margin: 0;
+ list-style: none;
+
+ li {
+ float: left;
+ margin-left: 20px;
+
+ a, a:visited {
+ // color: @grayLight;
+ text-decoration: none;
+ font-size: 40px;
+ .transition( 250ms ease-in-out );
+
+ &:hover {
+ // color: @gray;
+ }
+ }
+ }
+ }
+}
+
+.remove-padding {
+ padding: 0px !important;
+}
+
+
+/**
+ * Now that all app-wide styles have been applied, we can load the styles for
+ * all the submodules and components we are using.
+ *
+ * TODO: In a later version of this boilerplate, I'd like to automate this.
+ */
+
+@import 'design.less';
+@import 'other.less';
+@import '../common/navigation/navigation.less';
+@import '../common/login/login.less';
+@import '../common/topbar/topbar.less';
+@import '../assets/js/codemirror/lib/codemirror.less';
+@import '../assets/js/codemirror/theme/eclipse.less';
+@import '../assets/js/codemirror/theme/eclipse-disabled.less';
+@import '../assets/js/codemirror/addon/hint/show-hint.less';
diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/less/mixins.less b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/less/mixins.less new file mode 100644 index 00000000..b886f7ec --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/less/mixins.less @@ -0,0 +1,37 @@ +.border-radius(@r) { + border-radius: @r; +} + +//transform +.transform(@transformation) { + -moz-transform:@transformation; + -webkit-transform:@transformation; + -o-transform:@transformation; + -ms-transform:@transformation; + transform:@transformation; +} +.transform-origin(@origin) { + -moz-transform-origin:@origin; + -webkit-transform-origin:@origin; + -o-transform-origin:@origin; + -ms-transform-origin:@origin; + transform-origin:@origin; +} + + +//animation +.animation(@params) { + -moz-animation:@params; + -webkit-animation:@params; + -o-animation:@params; + -ms-animation:@params; + animation:@params; +} + +.animation-duration(@duration:1s) { + -moz-animation-duration:@duration; + -webkit-animation-duration:@duration; + -o-animation-duration:@duration; + -ms-animation-duration:@duration; + animation-duration:@duration; +} diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/less/other.less b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/less/other.less new file mode 100644 index 00000000..dd00239c --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/less/other.less @@ -0,0 +1,209 @@ +/* other page sections */ + + +.ace-settings-container { + position:absolute; + right:0; top:50px; + z-index:12; + + .breadcrumbs-fixed & { + top:50px - (@breadcrumb-height); + } +} +.btn.ace-settings-btn { + float:left; + display:inline-block; + width:42px !important; + text-align:center; + + .border-radius(~"6px 0 0 6px") !important; + .opacity(0.55); + + vertical-align:top; + margin:0; + + &:hover , &.open { + .opacity(1); + } + +} + +.ace-settings-box { + display:none; + float:left; + width:175px; padding:0 14px; + background-color:#FFF; + + border:2px solid @ace-settings-box-border; + + &.open { + display:inline-block; + } + + > div { + margin:6px 0; + color:#444; + max-height:24px; + > label { + font-size:13px; + } + } + +} + + + + + +.btn-scroll-up { + border:none; + position:absolute; + right:2px; + bottom:2px; + z-index:11; +} +@media (min-width: @screen-tablet) { + .main-container.container > .btn-scroll-up { + right: auto; + margin-left: @container-tablet - 36; + } +} +@media (min-width: @screen-desktop) { + .main-container.container > .btn-scroll-up { + right: auto; + margin-left: @container-desktop - 36; + } +} +@media (min-width: @screen-lg-desktop) { + .main-container.container > .btn-scroll-up { + right: auto; + margin-left: @container-lg-desktop - 36; + } +} + + + + + + +.grid2, .grid3, .grid4 { + .box-sizing(border-box); + display:block; + margin:0; + float:left; + + border-left:1px solid #E3E3E3; + &:first-child { + border-left:none; + } +} + +.grid2 { + width:48%; + padding:0 2%; +} + + +.grid3 { + width:33%; + padding:0 2%; +} + +.grid4 { + width:23%; + margin:0 1%; padding:0 1%; +} + + +.draggable-placeholder { /* for when dragging items around */ + border:2px dashed #D9D9D9 !important; + background-color:#F7F7F7 !important; +} + +/* scrollbar */ +.slimScrollBar { .border-radius(0) !important; } +.slimScrollRail { .border-radius(0) !important; } + + + +/* date & time picker */ +.datepicker , .daterangepicker { + td , th { .border-radius(0) !important; font-size: 13px; } + + td.active { + & , &:hover { background:@datepicker-active-bg !important; } + + &.disabled { + & , &:hover { background:@datepicker-disabled-bg !important; } + } + } +} +.datepicker { + td , th { min-width: 32px; } +} + +.datepicker-months .month , .datepicker-years .year { + border-radius:0 !important; +} +.datepicker-months .month.active , .datepicker-years .year.active { + & , &:hover , &:focus, &:active { + background-image:none !important; + background-color:@datepicker-active-bg !important; + } +} +.bootstrap-timepicker-widget table td input { + width:32px; +} + + + +.bootstrap-timepicker-widget table td a:hover { + .border-radius(0); +} + +.well .datepicker table tr td.day:hover { + background-color:@datepicker-active-bg2; + color:#FFF; +} + + + + + +/* a few small third party css files put here to reduce http file requests */ +/* jquery.easy-pie-chart.css */ +.easyPieChart { + position: relative; + text-align: center; + + canvas { + position: absolute; + top: 0; + left: 0; + } +} + +.knob-container { + direction:ltr; + text-align:left; +} + + + + + +/* ie8/9 specific */ +.navbar .navbar-inner , .navbar .btn-navbar { + filter:progid:DXImageTransform.Microsoft.gradient(enabled=false) !important; +} +.dropdown-menu li > a, +.dropdown-submenu > a { + filter:progid:DXImageTransform.Microsoft.gradient(enabled=false) !important; +} +.btn { + filter:progid:DXImageTransform.Microsoft.gradient(enabled=false) !important; +} +.progress , .progress .bar { + filter:progid:DXImageTransform.Microsoft.gradient(enabled=false) !important; +} + diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/less/variables.less b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/less/variables.less new file mode 100644 index 00000000..a5ccaeab --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/less/variables.less @@ -0,0 +1,442 @@ +/** + * These are the variables used throughout the application. This is where + * overwrites that are not specific to components should be maintained. + */ + +@import '../../vendor/bootstrap/less/variables.less'; + + +/** + * Typography-related. + */ + +@sansFontFamily: 'Roboto', sans-serif; + + + +/* + * Other variables + */ +@ace-settings-box-border:#FFB34B; +@datepicker-active-bg:#2283C5; +@datepicker-disabled-bg:#8B9AA3; +@datepicker-active-bg2:#7D8893;//inside .well + + +/** + * Breadcrumbs-related + */ +//some breadcrumbs variables +@breadcrumb-bg:#F5F5F5; +@breadcrumb-border:#E5E5E5; +@breadcrumb-text-color:#555; +@breadcrumb-link-color:#4C8FBD; + +@breadcrumb-separator:"\f105";//font awesome icon + + +/** +* Navigation-related +*/ +@sidebar-bg:#F2F2F2; +@sidebar-border-right:#CCC; + +//@menu-active-color:#0B6CBC; + +@menu-bg:#F9F9F9; +@menu-color:#585858; +@menu-hover-indicator:#3382AF; +@menu-subarrow-color:#666; +@menu-open-bg:#FAFAFA; +@menu-active-bg:#FFF; + +@submenu-border:#E5E5E5; +@submenu-bg:#FFF; +@submenu-item-color:#616161; +@submenu-item-border:#E4E4E4; +@submenu-item-hover:#4B88B7; +@submenu-item-active-icon:#C86139; + + +@3rd-level-icon-color:#6A7D87; +@submenu-left-border-style:dotted; + +//@submenu-left-border:#CCD7E2; +//@submenu-active-left-border:#BCCFE0; + + + +@menumin-btn-bg:#F3F3F3; +@menumin-btn-border:#E0E0E0; +@menumin-icon-color:#AAA; +@menumin-icon-border:#BBB; +@menumin-icon-bg:#FFF; +@menumin-bg:#F5F5F5; + +@menumin-text-border:#DDD; +@menumin-shadow:~"2px 1px 2px 0 rgba(0,0,0,0.2)"; + +@shortcuts-bg:#FAFAFA; +@shortcuts-border:#DDD; + + + + +//basic variables +@baseFontSize:13px; +@sansFontFamily:"Open Sans"; + +@screen-xs-min: (@screen-xs + 1);//!ignore +@screen-sm-min: (@screen-sm + 1);//!ignore +@screen-md-min: (@screen-md + 1);//!ignore +@screen-lg-min: (@screen-lg + 1);//!ignore +@screen-topbar-down: 460px;//The point to move top menu buttons down in default layout +@screen-topbar-down-min: (@screen-topbar-down + 1);//!ignore + +@screen-tiny: 320px;//!ignore + + +//general.less variables +@body-bg:#E4E6E9; +@text-color:#393939; + + +//ace top nav/bar +@navbar-mh:45px;//navbar's min-height +@navbar-bg:#438EB9;//navbar background color +@navbar-text-color:#FFF; +@brand-size:24px;//brand logo text size + +@ace-nav-default:#2E6589;//ace nav button default background color +@ace-nav-grey:#555;//ace nav button grey background color +@ace-nav-purple:#892E65;//ace nav button purple background color +@ace-nav-green:#2E8965; +@ace-nav-red:#B74635; +@ace-nav-light-green:#9ABC32; +@ace-nav-light-purple:#CB6FD7; +@ace-nav-light-orange:#F79263; +@ace-nav-light-blue:#62A8D1; +@ace-nav-light-blue2:#42A8E1; +@ace-nav-light-pink:#F4DAE5; +@ace-nav-dark:#404040; +@ace-nav-white-opaque:rgba(255,255,255,0.8); +@ace-nav-dark-opaque:rgba(0,0,0,0.2); + +@navbar-dropdown-width:240px; +@navbar-dropdown-shadow:~"0 2px 4px rgba(30, 30, 100, 0.25)"; + + + +//sidebar +@menu-button-text: "MENU"; + +@sidebar-width:190px;//sidebar width +@sidebar-min-width:43px;//sidebar minimum width +@menu-focus-color:#1963AA; +@menu-active-color:#2B7DBC; + +@submenu-left-border:mix(#BCCFE0 , #7EAACB); +@submenu-active-left-border:mix(mix(#BCCFE0 , #7EAACB) , #7EAACB); + +@menumin-border:#CCC; + + + +//breadcrumb +@breadcrumb-height:41px; +@breadcrumb-arrow-color:#B2B6BF; + + + +// heading font size +@h1-size: 32; +@h2-size: 26; +@h3-size: 22; +@h4-size: 18; +@h5-size: 15; +@h6-size: 13; + + + + +//some text colors +@ace-dark:#333; +@ace-white:#FFF; +@ace-red:#DD5A43; +@ace-light-red:#FF7777; +@ace-blue:#478FCA; +@ace-light-blue:#93CBF9; +@ace-green:#69AA46; +@ace-light-green:#B0D877; +@ace-orange:#FF892A; +@ace-orange2:#FEB902; +@ace-light-orange:#FCAC6F; +@ace-purple:#A069C3; +@ace-pink:#C6699F; +@ace-pink2:#D6487E; +@ace-brown:brown; +@ace-grey:#777; +@ace-light-grey:#BBB; + + + + +//button colors +@btn-default:#ABBAC3; +@btn-default-hover:#8B9AA3; + +@btn-primary:#428BCA; +@btn-primary-hover:#1B6AAA; + +@btn-info:#6FB3E0; +@btn-info-hover:#4F99C6; + +@btn-success:#87B87F; +@btn-success-hover:#629B58; + +@btn-warning:#FFB752; +@btn-warning-hover:#E59729; + +@btn-danger:#D15B47; +@btn-danger-hover:#B74635; + +@btn-inverse:#555555; +@btn-inverse-hover:#303030; + +@btn-pink:#D6487E; +@btn-pink-hover:#B73766; + +@btn-purple:#9585BF; +@btn-purple-hover:#7461AA; + +@btn-yellow:#FEE188; +@btn-yellow-hover:#F7D05B; +@btn-yellow-color:#996633; + +@btn-light:#E7E7E7; +@btn-light-hover:#D9D9D9; +@btn-light-color:#888; + +@btn-grey:#A0A0A0; +@btn-grey-hover:#888888; + +//active state: +@btn-active-color:#EFE5B5; +@btn-yellow-active-border:#C96338; + +@btn-link-color:#0088CC; + + + + +//application button colors +@btn-app-default-1:#BCC9D5; +@btn-app-default-2:#ABBAC3; + +@btn-app-primary-1:#3B98D6; +@btn-app-primary-2:#197EC1; + +@btn-app-info-1:#75B5E6; +@btn-app-info-2:#5BA4D5; + +@btn-app-success-1:#8EBF60; +@btn-app-success-2:#7DAA50; + +@btn-app-danger-1:#D55B52; +@btn-app-danger-2:#D12723; + +@btn-app-warning-1:#FFBF66; +@btn-app-warning-2:#FFA830; + +@btn-app-purple-1:#A696CE; +@btn-app-purple-2:#8A7CB4; + +@btn-app-pink-1:#DB5E8C; +@btn-app-pink-2:#CE3970; + +@btn-app-inverse-1:#555555; +@btn-app-inverse-2:#333333; + +@btn-app-grey-1:#898989; +@btn-app-grey-2:#696969; + +@btn-app-light-1:#F4F4F4; +@btn-app-light-2:#E6E6E6; + +@btn-app-yellow-1:#FFE8A5; +@btn-app-yellow-2:#FCD76A; + +@btn-app-active:#FFF; +@btn-app-yellow-color:#963; +@btn-app-yellow-border:#FEE188; +@btn-app-light-color:#5A5A5A; +@btn-app-light-active:#515151; + + + + +//label & badge colors +@label-default:#ABBAC3; +@label-primary:@btn-primary; +@label-info:#3A87AD; +@label-success:#82AF6F; +@label-danger:#D15B47; +@label-important:@label-danger;//!ignore +@label-warning:#F89406; +@label-inverse:#333333; +@label-pink:#D6487E; +@label-purple:#9585BF; +@label-yellow:#FEE188; +@label-light:#E7E7E7; +@label-grey:@btn-grey; + + + +//menu colors +@dropdown-menu:#4F99C6; +@dropdown-default:@btn-default; +@dropdown-primary:@btn-primary; +@dropdown-info:@btn-info; +@dropdown-success:@btn-success; +@dropdown-warning:#FFA24D; +@dropdown-danger:@btn-danger; +@dropdown-inverse:@btn-inverse; +@dropdown-pink:@btn-pink; +@dropdown-purple:@btn-purple; +@dropdown-grey:@btn-grey; +@dropdown-light:@btn-light; +@dropdown-lighter:#EFEFEF; +@dropdown-lightest:#F3F3F3; +@dropdown-yellow:@btn-yellow; +@dropdown-yellow2:#F9E8B3; +@dropdown-light-blue:#ECF3F9; + +//slider colors +@slider-color:#4AA4CE; +@slider-green:#8BBC67; +@slider-red:#D36E6E; +@slider-purple:#AC68BA; +@slider-orange:#EFAD62; +@slider-dark:#606060; +@slider-pink:@btn-pink; + + +//infobox colors +@infobox-purple:#6F3CC4; +@infobox-purple2:#5F47B0; +@infobox-pink:#CB6FD7; +@infobox-blue:#6FB3E0; +@infobox-blue2:#3983C2; +@infobox-blue3:#1144EB; +@infobox-red:#D53F40; +@infobox-brown:#C67A3E; +@infobox-light-brown:#CEBEA5; +@infobox-wood:#7B3F25; +@infobox-orange:#E8B110; +@infobox-orange2:#F79263; +@infobox-green:#9ABC32; +@infobox-green2:#0490A6; +@infobox-grey:#999999; +@infobox-black:#393939; + + +//widget colors +@widget-blue:#307ECC; +@widget-blue2:#5090C1; +@widget-blue3:#6379AA; +@widget-green:#82AF6F; +@widget-green2:#2E8965; +@widget-green3:#4EBC30; +@widget-red:#E2755F; +@widget-red2:#E04141; +@widget-red3:#D15B47; +@widget-purple:#7E6EB0; +@widget-pink:#CE6F9E; +@widget-dark:#404040; +@widget-grey:#848484; + +@widget-orange:#FFC657; +@widget-orange-txt:#855D10; +@widget-orange-border:#E8B10D; + + + + +//form +@help-button-bg:#65BCDA; +@input-border:#D5D5D5; +@input-bg:#FFF; +@input-color:#858585; + +@input-focus-border:#F59942; +@input-focus-bg:#FFF; +@input-focus-color:#696969; +//@input-focus-shadow:~"0px 0px 0px 2px rgba(245, 153, 66, 0.3)"; + + + +//tabs & accordion +@tab-border:#C5D0DC; +@tab-active-color:#576373; +@tab-active-border:#4C8FBD; +@tab-hover-color:#4C8FBD; + + + +//tooltip +@tooltip-color:#333; +@tooltip-error-color:#C94D32; +@tooltip-success-color:#629B58; +@tooltip-warning-color:#ED9421; +@tooltip-info-color:#4B89AA; + + +//progress bar +@progress-color:#2A91D8; +@progress-danger:#CA5952; +@progress-success:#59A84B; +@progress-warning:#F2BB46; +@progress-pink:#D6487E; +@progress-purple:#9585BF; +@progress-yellow:#FFD259; +@progress-inverse:#404040; +@progress-grey:#8A8A8A; + + + + + +//widget +@widget-header-color:#669FC7;//text color +@tag-bg:#91B8D0; + + + +//items +@item-list-orange-border:#E8B110; +@item-list-orange2-border:#F79263; +@item-list-red-border:#D53F40; +@item-list-red2-border:#D15B47; +@item-list-green-border:#9ABC32; +@item-list-green2-border:#0490A6; +@item-list-blue-border:@btn-info-hover; +@item-list-blue2-border:#3983C2; +@item-list-blue3-border:#1144EB; +@item-list-pink-border:#CB6FD7; +@item-list-purple-border:#6F3CC4; +@item-list-black-border:#505050; +@item-list-grey-border:#A0A0A0; +@item-list-brown-border:brown; +@item-list-default-border:@btn-default; + +// Container sizes +// -------------------------------------------------- + +// Small screen / tablet +@container-tablet: ((720px + @grid-gutter-width)); + +// Medium screen / desktop +@container-desktop: ((940px + @grid-gutter-width)); + +// Large screen / wide desktop +@container-lg-desktop: ((1140px + @grid-gutter-width)); diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/main.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/main.js new file mode 100644 index 00000000..a7f71998 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/main.js @@ -0,0 +1,96 @@ +require.config({ + baseUrl : 'src', + packages: [{ + name: 'codemirror', + location: '../assets/js/codemirror', + main: 'lib/codemirror', + }], + paths : { + 'angular' : '../vendor/angular/angular', + 'ui-bootstrap' : '../vendor/angular-bootstrap/ui-bootstrap-tpls.min', + 'Restangular' : '../vendor/restangular/dist/restangular.min', + 'underscore' : '../vendor/underscore/underscore', + 'angular-ui-router' : '../vendor/angular-ui-router/release/angular-ui-router', + 'angular-css-injector' : '../vendor/angular-css-injector/angular-css-injector', + 'angular-cookies' : '../vendor/angular-cookies/angular-cookies.min', + 'angular-translate' : '../vendor/angular-translate/angular-translate.min', + 'angular-sanitize' : '../vendor/angular-sanitize/angular-sanitize.min', + 'angular-translate-loader-static-files' : '../vendor/angular-translate-loader-static-files/angular-translate-loader-static-files.min', + 'jquery' : '../vendor/jquery/jquery.min', + 'jquery-ui' : '../vendor/jquery-ui/jquery-ui.min', + 'footable' : '../vendor/footable/dist/footable.min', + 'pixi': '../vendor/pixi/bin/pixi', + 'd3' : '../vendor/d3/d3.min', + 'ocLazyLoad' : '../vendor/ocLazyLoad/dist/ocLazyLoad', + 'vis' : '../vendor/vis/dist/vis.min', + 'sigma' : '../vendor/sigma/sigma.min', + 'sigma-parsers-gexf' : '../vendor/sigma/plugins/sigma.parsers.gexf.min', + 'sigma-forceAtlas2' : '../vendor/sigma/plugins/sigma.layout.forceAtlas2.min', + 'sigma-dragNodes' : '../vendor/sigma/plugins/sigma.plugins.dragNodes.min', + 'sigma-customShapes' : '../vendor/sigma/plugins/sigma.renderers.customShapes.min', + 'ngSlider' : '../vendor/ng-slider/dist/ng-slider.min', + 'ZeroClipboard' : '../vendor/zeroclipboard/dist/ZeroClipboard', + 'ngClip' : '../vendor/ng-clip/src/ngClip', + 'angular-translate-loader-partial' : '../vendor/angular-translate-loader-partial/angular-translate-loader-partial', + 'ngAnimate': '../vendor/angular-animate/angular-animate.min', + 'ngAria': '../vendor/angular-aria/angular-aria.min', + 'ngMaterial': '../vendor/angular-material/angular-material.min', + 'ngMessages': '../vendor/angular-messages/angular-messages.min', + 'codeMirror-showHint' : '../assets/js/codemirror/addon/hint/show-hint', + 'codeMirror-jsonParametersHint' : '../assets/js/codemirror/addon/hint/json-parameters-hint', + 'codeMirror-javascriptMode' : '../assets/js/codemirror/mode/javascript/javascript', + 'codeMirror-matchBrackets' : '../assets/js/codemirror/addon/edit/matchbrackets', + }, + map: { + '*': { + 'angularAMD': 'angular' + } + }, + shim : { + 'ocLazyLoad' : ['angular'], + 'Restangular' : ['angular', 'underscore'], + 'ui-bootstrap' : ['angular'], + 'angular-css-injector' : ['angular'], + 'angular-ui-router' : ['angular'], + 'angular-cookies' : ['angular'], + 'angular-translate': ['angular'], + 'angular-sanitize': ['angular'], + 'angular-translate-loader-static-files' : ['angular-translate'], + 'vis' : { + exports: 'vis' + }, + 'jquery' : { + exports : '$' + }, + 'jquery-ui' : ['jquery'], + 'angular' : { + deps: ['jquery','jquery-ui'], + exports: 'angular' + }, + 'footable' : ['jquery'], + 'undescore' : { + exports : '_' + }, + 'sticky' : ['jquery', 'angular'], + 'sigma-parsers-gexf' : ['sigma'], + 'sigma-forceAtlas2' : ['sigma'], + 'sigma-dragNodes' : ['sigma'], + 'sigma-customShapes' : ['sigma'], + 'ngSlider' : ['angular'], + 'ZeroClipboard': ['angular'], + 'ngClip' : ['angular','ZeroClipboard'], + 'angular-translate-loader-partial': ['angular-translate'], + 'ngAnimate': ['angular'], + 'ngAria': ['angular'], + 'ngMaterial': { + deps: ['ngAnimate', 'ngAria'] + }, + 'codeMirros_showHint': ['codemirror'], + 'codeMirros_javascriptHint': ['codemirror'], + 'codeMirror_javascriptMode': ['codemirror'], + 'codeMirror_matchBrackets': ['codemirror'], + }, + + deps : ['app/app.module'] + +}); diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/test-main.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/test-main.js new file mode 100644 index 00000000..9a4625a5 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/test-main.js @@ -0,0 +1,99 @@ +var allTestFiles = []; +var TEST_REGEXP = /spec\.js$/; + +var pathToModule = function (path) { + return path.replace(/^\/base\/src\//, '').replace(/\.js$/, ''); +}; + +Object.keys(window.__karma__.files).forEach(function (file) { + if (TEST_REGEXP.test(file)) { + if (file.indexOf('yang') < 0) { // yang spec are broken + allTestFiles.push(pathToModule(file)); + } + } +}); + +var run = function () { + test(allTestFiles, function () { + console.log('Starting Karma'); + window.__karma__.start(); + }); +}; + +var test = require.config({ + baseUrl: '/base/src', + paths: { + 'angular': '../vendor/angular/angular', + 'angular-mocks': '../vendor/angular-mocks/angular-mocks', + 'ui-bootstrap': '../vendor/angular-bootstrap/ui-bootstrap-tpls.min', + 'Restangular': '../vendor/restangular/dist/restangular.min', + 'underscore': '../vendor/underscore/underscore', + 'angular-ui-router': '../vendor/angular-ui-router/release/angular-ui-router', + 'angular-css-injector': '../vendor/angular-css-injector/angular-css-injector', + 'angular-cookies': '../vendor/angular-cookies/angular-cookies.min', + 'angular-translate': '../vendor/angular-translate/angular-translate.min', + 'angular-sanitize': '../vendor/angular-sanitize/angular-sanitize.min', + 'angular-translate-loader-static-files': '../vendor/angular-translate-loader-static-files/angular-translate-loader-static-files.min', + 'jquery': '../vendor/jquery/jquery.min', + 'jquery-ui': '../vendor/jquery-ui/jquery-ui.min', + 'footable': '../vendor/footable/dist/footable.min', + 'd3': '../vendor/d3/d3.min', + 'ocLazyLoad': '../vendor/ocLazyLoad/dist/ocLazyLoad', + 'vis': '../vendor/vis/dist/vis.min', + 'sigma': '../vendor/sigma/sigma.min', + 'sigma-parsers-gexf': '../vendor/sigma/plugins/sigma.parsers.gexf.min', + 'sigma-forceAtlas2': '../vendor/sigma/plugins/sigma.layout.forceAtlas2.min', + 'sigma-dragNodes': '../vendor/sigma/plugins/sigma.plugins.dragNodes.min', + 'sigma-customShapes': '../vendor/sigma/plugins/sigma.renderers.customShapes.min', + 'ngSlider': '../vendor/ng-slider/dist/ng-slider.min', + 'ZeroClipboard': '../vendor/zeroclipboard/dist/ZeroClipboard', + 'ngClip': '../vendor/ng-clip/src/ngClip', + 'angular-translate-loader-partial': '../vendor/angular-translate-loader-partial/angular-translate-loader-partial' + }, + map: { + '*': { + 'angularAMD': 'angular' + } + }, + shim: { + 'angular-mocks': ['angular'], + 'ocLazyLoad': ['angular'], + 'Restangular': ['angular', 'underscore'], + 'ui-bootstrap': ['angular'], + 'angular-css-injector': ['angular'], + 'angular-ui-router': ['angular'], + 'angular-cookies': ['angular'], + 'angular-translate': ['angular'], + 'angular-sanitize': ['angular'], + 'angular-translate-loader-static-files': ['angular-translate'], + 'vis': { + exports: 'vis' + }, + 'jquery': { + exports: '$' + }, + 'jquery-ui': ['jquery'], + 'angular': { + deps: ['jquery', 'jquery-ui'], + exports: 'angular' + }, + 'footable': ['jquery'], + 'undescore': { + exports: '_' + }, + 'sticky': ['jquery', 'angular'], + 'sigma-parsers-gexf': ['sigma'], + 'sigma-forceAtlas2': ['sigma'], + 'sigma-dragNodes': ['sigma'], + 'sigma-customShapes': ['sigma'], + 'ngSlider': ['angular'], + 'ZeroClipboard': ['angular'], + 'ngClip': ['angular', 'ZeroClipboard'], + 'angular-translate-loader-partial': ['angular-translate'] + }, + + + deps: ['angular', 'angular-mocks'], + + callback: run +}); |