Refactored topology to fit diagnostic
diff --git a/views/ngXosViews/diagnostic/.bowerrc b/views/ngXosViews/diagnostic/.bowerrc
new file mode 100644
index 0000000..e491038
--- /dev/null
+++ b/views/ngXosViews/diagnostic/.bowerrc
@@ -0,0 +1,3 @@
+{
+ "directory": "src/vendor/"
+}
\ No newline at end of file
diff --git a/views/ngXosViews/diagnostic/.eslintrc b/views/ngXosViews/diagnostic/.eslintrc
new file mode 100644
index 0000000..c852748
--- /dev/null
+++ b/views/ngXosViews/diagnostic/.eslintrc
@@ -0,0 +1,42 @@
+{
+ "ecmaFeatures": {
+ "blockBindings": true,
+ "forOf": true,
+ "destructuring": true,
+ "arrowFunctions": true,
+ "templateStrings": true
+ },
+ "env": {
+ "browser": true,
+ "node": true,
+ "es6": true
+ },
+ "plugins": [
+ //"angular"
+ ],
+ "rules": {
+ "quotes": [2, "single"],
+ "camelcase": [1, {"properties": "always"}],
+ "no-underscore-dangle": 1,
+ "eqeqeq": [2, "smart"],
+ "no-alert": 1,
+ "key-spacing": [1, { "beforeColon": false, "afterColon": true }],
+ "indent": [2, 2],
+ "no-irregular-whitespace": 1,
+ "eol-last": 0,
+ "max-nested-callbacks": [2, 4],
+ "comma-spacing": [1, {"before": false, "after": true}],
+ "no-trailing-spaces": [1, { skipBlankLines: true }],
+ "no-unused-vars": [1, {"vars": "all", "args": "after-used"}],
+ "new-cap": 0,
+
+ //"angular/ng_module_name": [2, '/^xos\.*[a-z]*$/'],
+ //"angular/ng_controller_name": [2, '/^[a-z].*Ctrl$/'],
+ //"angular/ng_service_name": [2, '/^[A-Z].*Service$/'],
+ //"angular/ng_directive_name": [2, '/^[a-z]+[[A-Z].*]*$/'],
+ //"angular/ng_di": [0, "function or array"]
+ },
+ "globals" :{
+ "angular": true
+ }
+}
\ No newline at end of file
diff --git a/views/ngXosViews/diagnostic/.gitignore b/views/ngXosViews/diagnostic/.gitignore
new file mode 100644
index 0000000..567aee4
--- /dev/null
+++ b/views/ngXosViews/diagnostic/.gitignore
@@ -0,0 +1,6 @@
+dist/
+src/vendor
+.tmp
+node_modules
+npm-debug.log
+dist/
\ No newline at end of file
diff --git a/views/ngXosViews/diagnostic/bower.json b/views/ngXosViews/diagnostic/bower.json
new file mode 100644
index 0000000..edf419d
--- /dev/null
+++ b/views/ngXosViews/diagnostic/bower.json
@@ -0,0 +1,32 @@
+{
+ "name": "xos-serviceTopology",
+ "version": "0.0.0",
+ "authors": [
+ "Matteo Scandolo <teo@onlab.us>"
+ ],
+ "description": "The serviceTopology view",
+ "license": "MIT",
+ "ignore": [
+ "**/.*",
+ "node_modules",
+ "bower_components",
+ "static/js/vendor/",
+ "test",
+ "tests"
+ ],
+ "dependencies": {
+ "d3": "~3.5.13",
+ "lodash": "~4.0.0",
+ "angular-animate": "~1.4.9"
+ },
+ "devDependencies": {
+ "jquery": "~2.1.4",
+ "angular-mocks": "~1.4.7",
+ "angular": "~1.4.7",
+ "angular-ui-router": "~0.2.15",
+ "angular-cookies": "~1.4.7",
+ "angular-resource": "~1.4.7",
+ "ng-lodash": "~0.3.0",
+ "bootstrap-css": "~3.3.6"
+ }
+}
diff --git a/views/ngXosViews/diagnostic/env/apt.js b/views/ngXosViews/diagnostic/env/apt.js
new file mode 100644
index 0000000..47c3e95
--- /dev/null
+++ b/views/ngXosViews/diagnostic/env/apt.js
@@ -0,0 +1,13 @@
+// This is a default configuration for your development environment.
+// You can duplicate this configuration for any of your Backend Environments.
+// Different configurations are loaded setting a NODE_ENV variable that contain the config file name.
+// `NODE_ENV=local npm start`
+//
+// If xoscsrftoken or xossessionid are not specified the browser value are used
+// (works only for local environment as both application are served on the same domain)
+
+module.exports = {
+ host: 'http://apt045.apt.emulab.net:9999/',
+ xoscsrftoken: '56kxBxMtXeSJavUkqhgaAEXuSmi2snMy',
+ xossessionid: 'pffs71hhko88moqpa7mjxz1jrh9bklpb '
+};
diff --git a/views/ngXosViews/diagnostic/env/default.js b/views/ngXosViews/diagnostic/env/default.js
new file mode 100644
index 0000000..94f3385
--- /dev/null
+++ b/views/ngXosViews/diagnostic/env/default.js
@@ -0,0 +1,13 @@
+// This is a default configuration for your development environment.
+// You can duplicate this configuration for any of your Backend Environments.
+// Different configurations are loaded setting a NODE_ENV variable that contain the config file name.
+// `NODE_ENV=local npm start`
+//
+// If xoscsrftoken or xossessionid are not specified the browser value are used
+// (works only for local environment as both application are served on the same domain)
+
+module.exports = {
+ host: 'http://clnode067.clemson.cloudlab.us:9999/',
+ xoscsrftoken: 'IZ52y2rmIxizNDeRfaHdmcRNQsSd9mDV',
+ xossessionid: 'tmsqxdnf8og252ydu94sbfr1u63lht50'
+};
diff --git a/views/ngXosViews/diagnostic/env/srikanth.js b/views/ngXosViews/diagnostic/env/srikanth.js
new file mode 100644
index 0000000..e79ab1d
--- /dev/null
+++ b/views/ngXosViews/diagnostic/env/srikanth.js
@@ -0,0 +1,13 @@
+// This is a default configuration for your development environment.
+// You can duplicate this configuration for any of your Backend Environments.
+// Different configurations are loaded setting a NODE_ENV variable that contain the config file name.
+// `NODE_ENV=local npm start`
+//
+// If xoscsrftoken or xossessionid are not specified the browser value are used
+// (works only for local environment as both application are served on the same domain)
+
+module.exports = {
+ host: 'http://130.127.133.41:9999',
+ xoscsrftoken: 'yxEhnmrR0GrRaAbTz3tiCEh1DzFDQ98v',
+ xossessionid: 'hgf01hgpsrw7g4mveuajuo6p7hezm1c5'
+};
diff --git a/views/ngXosViews/diagnostic/gulp/build.js b/views/ngXosViews/diagnostic/gulp/build.js
new file mode 100644
index 0000000..ecf9ed3
--- /dev/null
+++ b/views/ngXosViews/diagnostic/gulp/build.js
@@ -0,0 +1,118 @@
+'use strict';
+
+// BUILD
+//
+// The only purpose of this gulpfile is to build a XOS view and copy the correct files into
+// .html => dashboards
+// .js (minified and concat) => static/js
+//
+// The template are parsed and added to js with angular $templateCache
+
+var gulp = require('gulp');
+var ngAnnotate = require('gulp-ng-annotate');
+var uglify = require('gulp-uglify');
+var templateCache = require('gulp-angular-templatecache');
+var runSequence = require('run-sequence');
+var concat = require('gulp-concat');
+var del = require('del');
+var wiredep = require('wiredep');
+var angularFilesort = require('gulp-angular-filesort');
+var _ = require('lodash');
+var eslint = require('gulp-eslint');
+var inject = require('gulp-inject');
+var rename = require('gulp-rename');
+var replace = require('gulp-replace');
+
+var TEMPLATE_FOOTER = `}]);
+angular.module('xos.serviceTopology').run(function($location){$location.path('/')});
+angular.bootstrap(angular.element('#xosServiceTopology'), ['xos.serviceTopology']);`;
+
+module.exports = function(options){
+
+ // delete previous builded file
+ gulp.task('clean', function(){
+ return del(
+ [options.dashboards + 'xosServiceTopology.html'],
+ {force: true}
+ );
+ });
+
+ // compile and minify scripts
+ gulp.task('scripts', function() {
+ return gulp.src([
+ options.tmp + '**/*.js'
+ ])
+ .pipe(ngAnnotate())
+ .pipe(angularFilesort())
+ .pipe(concat('xosServiceTopology.js'))
+ .pipe(uglify())
+ .pipe(gulp.dest(options.static + 'js/'));
+ });
+
+ // set templates in cache
+ gulp.task('templates', function(){
+ return gulp.src('./src/templates/*.html')
+ .pipe(templateCache({
+ module: 'xos.serviceTopology',
+ root: 'templates/',
+ templateFooter: TEMPLATE_FOOTER
+ }))
+ .pipe(gulp.dest(options.tmp));
+ });
+
+ // copy html index to Django Folder
+ gulp.task('copyHtml', ['clean'], function(){
+ return gulp.src(options.src + 'index.html')
+ // remove dev dependencies from html
+ .pipe(replace(/<!-- bower:css -->(\n.*)*\n<!-- endbower --><!-- endcss -->/, ''))
+ .pipe(replace(/<!-- bower:js -->(\n.*)*\n<!-- endbower --><!-- endjs -->/, ''))
+ .pipe(replace(/ng-app=".*"\s/, ''))
+ // injecting minified files
+ .pipe(
+ inject(
+ gulp.src([
+ options.static + 'js/vendor/xosServiceTopologyVendor.js',
+ options.static + 'js/xosServiceTopology.js'
+ ])
+ )
+ )
+ .pipe(rename('xosServiceTopology.html'))
+ .pipe(gulp.dest(options.dashboards));
+ });
+
+ // minify vendor js files
+ gulp.task('wiredep', function(){
+ var bowerDeps = wiredep().js;
+ if(!bowerDeps){
+ return;
+ }
+
+ // remove angular (it's already loaded)
+ _.remove(bowerDeps, function(dep){
+ return dep.indexOf('angular/angular.js') !== -1;
+ });
+
+ return gulp.src(bowerDeps)
+ .pipe(concat('xosServiceTopologyVendor.js'))
+ .pipe(uglify())
+ .pipe(gulp.dest(options.static + 'js/vendor/'));
+ });
+
+ gulp.task('lint', function () {
+ return gulp.src(['src/js/**/*.js'])
+ .pipe(eslint())
+ .pipe(eslint.format())
+ .pipe(eslint.failAfterError());
+ });
+
+ gulp.task('build', function() {
+ runSequence(
+ 'templates',
+ 'babel',
+ 'scripts',
+ 'wiredep',
+ 'copyHtml',
+ 'cleanTmp'
+ );
+ });
+};
\ No newline at end of file
diff --git a/views/ngXosViews/diagnostic/gulp/server.js b/views/ngXosViews/diagnostic/gulp/server.js
new file mode 100644
index 0000000..7605294
--- /dev/null
+++ b/views/ngXosViews/diagnostic/gulp/server.js
@@ -0,0 +1,146 @@
+'use strict';
+
+var gulp = require('gulp');
+var browserSync = require('browser-sync').create();
+var inject = require('gulp-inject');
+var runSequence = require('run-sequence');
+var angularFilesort = require('gulp-angular-filesort');
+var babel = require('gulp-babel');
+var wiredep = require('wiredep').stream;
+var httpProxy = require('http-proxy');
+var del = require('del');
+
+const environment = process.env.NODE_ENV;
+
+if (environment){
+ var conf = require(`../env/${environment}.js`);
+}
+else{
+ var conf = require('../env/default.js')
+}
+
+var proxy = httpProxy.createProxyServer({
+ target: conf.host || 'http://0.0.0.0:9999'
+});
+
+
+proxy.on('error', function(error, req, res) {
+ res.writeHead(500, {
+ 'Content-Type': 'text/plain'
+ });
+
+ console.error('[Proxy]', error);
+});
+
+module.exports = function(options){
+
+ // open in browser with sync and proxy to 0.0.0.0
+ gulp.task('browser', function() {
+ browserSync.init({
+ // reloadDelay: 500,
+ // logLevel: 'debug',
+ // logConnections: true,
+ startPath: '#/',
+ snippetOptions: {
+ rule: {
+ match: /<!-- browserSync -->/i
+ }
+ },
+ server: {
+ baseDir: options.src,
+ routes: {
+ '/api': options.api,
+ '/xosHelpers/src': options.helpers
+ },
+ middleware: function(req, res, next){
+ if(
+ req.url.indexOf('/xos/') !== -1 ||
+ req.url.indexOf('/xoslib/') !== -1 ||
+ req.url.indexOf('/hpcapi/') !== -1
+ ){
+ if(conf.xoscsrftoken && conf.xossessionid){
+ req.headers.cookie = `xoscsrftoken=${conf.xoscsrftoken}; xossessionid=${conf.xossessionid}`;
+ req.headers['x-csrftoken'] = conf.xoscsrftoken;
+ }
+ proxy.web(req, res);
+ }
+ else{
+ next();
+ }
+ }
+ }
+ });
+
+ gulp.watch(options.src + 'js/**/*.js', ['js-watch']);
+ gulp.watch(options.src + 'vendor/**/*.js', ['bower'], function(){
+ browserSync.reload();
+ });
+ gulp.watch(options.src + '**/*.html', function(){
+ browserSync.reload();
+ });
+ });
+
+ // transpile js with sourceMaps
+ gulp.task('babel', function(){
+ return gulp.src(options.scripts + '**/*.js')
+ .pipe(babel({sourceMaps: true}))
+ .pipe(gulp.dest(options.tmp));
+ });
+
+ // inject scripts
+ gulp.task('injectScript', ['cleanTmp', 'babel'], function(){
+ return gulp.src(options.src + 'index.html')
+ .pipe(
+ inject(
+ gulp.src([
+ options.tmp + '**/*.js',
+ options.api + '*.js',
+ options.helpers + '**/*.js'
+ ])
+ .pipe(angularFilesort()),
+ {
+ ignorePath: [options.src, '/../../ngXosLib']
+ }
+ )
+ )
+ .pipe(gulp.dest(options.src));
+ });
+
+ // inject CSS
+ gulp.task('injectCss', function(){
+ return gulp.src(options.src + 'index.html')
+ .pipe(
+ inject(
+ gulp.src(options.src + 'css/*.css'),
+ {
+ ignorePath: [options.src]
+ }
+ )
+ )
+ .pipe(gulp.dest(options.src));
+ });
+
+ // inject bower dependencies with wiredep
+ gulp.task('bower', function () {
+ return gulp.src(options.src + 'index.html')
+ .pipe(wiredep({devDependencies: true}))
+ .pipe(gulp.dest(options.src));
+ });
+
+ gulp.task('js-watch', ['injectScript'], function(){
+ browserSync.reload();
+ });
+
+ gulp.task('cleanTmp', function(){
+ return del([options.tmp + '**/*']);
+ });
+
+ gulp.task('serve', function() {
+ runSequence(
+ 'bower',
+ 'injectScript',
+ 'injectCss',
+ ['browser']
+ );
+ });
+};
diff --git a/views/ngXosViews/diagnostic/gulpfile.js b/views/ngXosViews/diagnostic/gulpfile.js
new file mode 100644
index 0000000..b2cdab8
--- /dev/null
+++ b/views/ngXosViews/diagnostic/gulpfile.js
@@ -0,0 +1,24 @@
+'use strict';
+
+var gulp = require('gulp');
+var wrench = require('wrench');
+
+var options = {
+ src: 'src/',
+ scripts: 'src/js/',
+ tmp: 'src/.tmp',
+ dist: 'dist/',
+ api: '../../ngXosLib/api/',
+ helpers: '../../ngXosLib/xosHelpers/src/',
+ static: '../../../xos/core/xoslib/static/', // this is the django static folder
+ dashboards: '../../../xos/core/xoslib/dashboards/' // this is the django html folder
+};
+
+wrench.readdirSyncRecursive('./gulp')
+.map(function(file) {
+ require('./gulp/' + file)(options);
+});
+
+gulp.task('default', function () {
+ gulp.start('build');
+});
diff --git a/views/ngXosViews/diagnostic/karma.conf.js b/views/ngXosViews/diagnostic/karma.conf.js
new file mode 100644
index 0000000..5e312fa
--- /dev/null
+++ b/views/ngXosViews/diagnostic/karma.conf.js
@@ -0,0 +1,90 @@
+// Karma configuration
+// Generated on Tue Oct 06 2015 09:27:10 GMT+0000 (UTC)
+
+/* eslint indent: [2,2], quotes: [2, "single"]*/
+
+/*eslint-disable*/
+var wiredep = require('wiredep');
+var path = require('path');
+
+var bowerComponents = wiredep( {devDependencies: true} )[ 'js' ].map(function( file ){
+ return path.relative(process.cwd(), file);
+});
+
+module.exports = function(config) {
+/*eslint-enable*/
+ config.set({
+
+ // base path that will be used to resolve all patterns (eg. files, exclude)
+ basePath: '',
+
+
+ // frameworks to use
+ // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
+ frameworks: ['jasmine'],
+
+
+ // list of files / patterns to load in the browser
+ files: bowerComponents.concat([
+ '../../../xos/core/xoslib/static/js/vendor/ngXosVendor.js',
+ '../../../xos/core/xoslib/static/js/vendor/ngXosHelpers.js',
+ '../../../xos/core/xoslib/static/js/xosApi.js',
+ 'src/js/main.js',
+ 'src/js/**/*.js',
+ 'spec/**/*.mock.js',
+ 'spec/**/*.test.js',
+ 'src/**/*.html'
+ ]),
+
+
+ // list of files to exclude
+ exclude: [
+ ],
+
+
+ // preprocess matching files before serving them to the browser
+ // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
+ preprocessors: {
+ 'src/js/**/*.js': ['babel'],
+ 'spec/**/*.test.js': ['babel'],
+ 'src/**/*.html': ['ng-html2js']
+ },
+
+ ngHtml2JsPreprocessor: {
+ stripPrefix: 'src/', //strip the src path from template url (http://stackoverflow.com/questions/22869668/karma-unexpected-request-when-testing-angular-directive-even-with-ng-html2js)
+ moduleName: 'templates' // define the template module name
+ },
+
+ // test results reporter to use
+ // possible values: 'dots', 'progress'
+ // available reporters: https://npmjs.org/browse/keyword/karma-reporter
+ reporters: ['mocha'],
+
+
+ // web server port
+ port: 9876,
+
+
+ // enable / disable colors in the output (reporters and logs)
+ colors: true,
+
+
+ // level of logging
+ // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
+ logLevel: config.LOG_INFO,
+
+
+ // enable / disable watching file and executing tests whenever any file changes
+ autoWatch: true,
+
+
+ // start these browsers
+ // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
+ browsers: ['PhantomJS'],
+
+
+ // Continuous Integration mode
+ // if true, Karma captures browsers, runs the tests and exits
+ singleRun: false
+ });
+};
diff --git a/views/ngXosViews/diagnostic/package.json b/views/ngXosViews/diagnostic/package.json
new file mode 100644
index 0000000..f77d454
--- /dev/null
+++ b/views/ngXosViews/diagnostic/package.json
@@ -0,0 +1,57 @@
+{
+ "name": "xos-serviceTopology",
+ "version": "1.0.0",
+ "description": "Angular Application for XOS, created with generator-xos",
+ "scripts": {
+ "prestart": "npm install && bower install",
+ "start": "gulp serve",
+ "prebuild": "npm install && bower install",
+ "build": "gulp",
+ "test": "karma start",
+ "lint": "eslint src/js/"
+ },
+ "keywords": [
+ "XOS",
+ "Angular",
+ "XOSlib"
+ ],
+ "author": "Matteo Scandolo",
+ "license": "MIT",
+ "dependencies": {},
+ "devDependencies": {
+ "browser-sync": "^2.9.11",
+ "del": "^2.0.2",
+ "eslint": "^1.8.0",
+ "eslint-plugin-angular": "linkmesrl/eslint-plugin-angular",
+ "gulp": "^3.9.0",
+ "gulp-angular-filesort": "^1.1.1",
+ "gulp-angular-templatecache": "^1.8.0",
+ "gulp-babel": "^5.3.0",
+ "gulp-concat": "^2.6.0",
+ "gulp-eslint": "^1.0.0",
+ "gulp-inject": "^3.0.0",
+ "gulp-minify-html": "^1.0.4",
+ "gulp-ng-annotate": "^1.1.0",
+ "gulp-rename": "^1.2.2",
+ "gulp-replace": "^0.5.4",
+ "gulp-uglify": "^1.4.2",
+ "http-proxy": "^1.12.0",
+ "jasmine-core": "^2.4.1",
+ "karma-jasmine": "^0.3.6",
+ "lodash": "^3.10.1",
+ "proxy-middleware": "^0.15.0",
+ "run-sequence": "^1.1.4",
+ "wiredep": "^3.0.0-beta",
+ "wrench": "^1.5.8",
+ "phantomjs": "^1.9.19",
+ "ink-docstrap": "^0.5.2",
+ "jasmine-core": "~2.3.4",
+ "karma": "^0.13.14",
+ "karma-babel-preprocessor": "~5.2.2",
+ "karma-coverage": "^0.5.3",
+ "karma-jasmine": "~0.3.6",
+ "karma-mocha-reporter": "~1.1.1",
+ "karma-ng-html2js-preprocessor": "^0.2.0",
+ "karma-phantomjs-launcher": "~0.2.1"
+ }
+}
diff --git a/views/ngXosViews/diagnostic/spec/sample.test.js b/views/ngXosViews/diagnostic/spec/sample.test.js
new file mode 100644
index 0000000..e3d2052
--- /dev/null
+++ b/views/ngXosViews/diagnostic/spec/sample.test.js
@@ -0,0 +1,157 @@
+'use strict';
+
+describe('The Service Relation Service', () => {
+
+ var Service;
+
+ beforeEach(module('xos.serviceTopology'));
+ beforeEach(module('templates'));
+
+ // inject the cartService
+ beforeEach(inject(function (_ServiceRelation_) {
+ // The injector unwraps the underscores (_) from around the parameter names when matching
+ Service = _ServiceRelation_;
+ }));
+
+ describe('given a service', () => {
+
+ const levelRelations = [
+ {
+ subscriber_service: 1
+ },
+ {
+ subscriber_service: 1
+ },
+ {
+ subscriber_service: 2
+ }
+ ];
+
+ it('should find all involved relations', () => {
+ expect(typeof Service.findLevelRelation).toBe('function');
+ let levelRelation = Service.findLevelRelation(levelRelations, 1);
+ expect(levelRelation.length).toBe(2);
+ });
+ });
+
+ describe('given a set of relation', () => {
+
+ const levelRelations = [
+ {
+ provider_service: 1,
+ service_specific_attribute: '{"instance_id": "instance1"}',
+ subscriber_tenant: 2
+ },
+ {
+ provider_service: 2
+ }
+ ];
+
+ const services = [
+ {
+ id: 1
+ },
+ {
+ id: 2
+ },
+ {
+ id: 3
+ }
+ ];
+
+ it('should find all the provider service', () => {
+ expect(typeof Service.findLevelServices).toBe('function');
+ let levelServices = Service.findLevelServices(levelRelations, services);
+ expect(levelServices.length).toBe(2);
+ });
+
+ it('should retrieve all service specific information', () => {
+ let info = Service.findSpecificInformation(levelRelations, 1);
+ expect(info.instance_id).toBe('instance1');
+ });
+ });
+
+
+
+ describe('given a list of services and a list of relations', () => {
+
+ const services = [
+ {
+ id: 1,
+ humanReadableName: 'service-1'
+ },
+ {
+ id: 2,
+ humanReadableName: 'service-2'
+ },
+ {
+ id: 3,
+ humanReadableName: 'service-3'
+ },
+ {
+ id: 4,
+ humanReadableName: 'service-4'
+ }
+ ];
+
+ const relations = [
+ {
+ provider_service: 2,
+ subscriber_service: 1,
+ },
+ {
+ provider_service: 3,
+ subscriber_service: 2
+ },
+ {
+ provider_service: 4,
+ subscriber_service: 1
+ },
+ {
+ subscriber_root: 1,
+ provider_service: 1
+ }
+ ];
+
+ it('should return a tree ordered by relations', () => {
+ let tree = Service.buildServiceTree(services, relations);
+
+ expect(tree.name).toBe('fakeSubs');
+ expect(tree.parent).toBeNull();
+ expect(tree.children.length).toBe(1);
+
+ expect(tree.children[0].name).toBe('service-1');
+ expect(tree.children[0].parent).toBeNull();
+ expect(tree.children[0].children.length).toBe(2);
+
+ expect(tree.children[0].children[0].name).toBe('service-2');
+ expect(tree.children[0].children[0].children[0].name).toBe('service-3');
+ expect(tree.children[0].children[0].children[0].children[0].name).toBe('Internet');
+
+ expect(tree.children[0].children[1].name).toBe('service-4');
+ expect(tree.children[0].children[1].children[0].name).toBe('Internet');
+ });
+ });
+
+ describe('given an object', () => {
+
+ const sample = {
+ name: '1',
+ children: [
+ {
+ name: '2',
+ children: [
+ {
+ name: '3'
+ }
+ ]
+ }
+ ]
+ };
+
+ it('should return the depth', () => {
+ expect(Service.depthOf(sample)).toBe(3);
+ });
+ });
+
+});
\ No newline at end of file
diff --git a/views/ngXosViews/diagnostic/src/css/dev.css b/views/ngXosViews/diagnostic/src/css/dev.css
new file mode 100644
index 0000000..7ff2305
--- /dev/null
+++ b/views/ngXosViews/diagnostic/src/css/dev.css
@@ -0,0 +1,15 @@
+
+html, body {
+ margin: 0;
+ padding: 0;
+ max-height: 100%;
+ height: 100%;
+}
+
+#xosServiceTopology{
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+}
\ No newline at end of file
diff --git a/views/ngXosViews/diagnostic/src/css/serviceTopology.css b/views/ngXosViews/diagnostic/src/css/serviceTopology.css
new file mode 100644
index 0000000..54beba3
--- /dev/null
+++ b/views/ngXosViews/diagnostic/src/css/serviceTopology.css
@@ -0,0 +1,155 @@
+/* CONTAINER */
+diagnostic .half-height {
+ position: relative;
+ height: 50%;
+}
+
+service-topology {
+ height: 100%;
+ width: 100%;
+ display: block;
+}
+
+/* LEGEND */
+
+.legend {
+ fill: #fff;
+ stroke: #ccc;
+ stroke-width: 1px;
+ position: relative;
+}
+
+.legend text {
+ stroke: #000;
+}
+
+.node {
+ cursor: pointer;
+}
+
+.node circle,
+.node rect{
+ fill: #fff;
+ stroke: steelblue;
+ stroke-width: 1px;
+}
+
+.node.subscriber circle,
+.node.internet circle {
+ stroke: #05ffcb;
+}
+
+.node.slice rect {
+ stroke: #b01dff;
+}
+
+.node.instance rect {
+ stroke: #ccc;
+}
+
+.node.instance rect.active {
+ stroke: #ff8b00;
+}
+
+.node rect.slice-detail{
+ fill: #fff;
+ stroke: steelblue;
+ stroke-width: 3px;
+}
+
+.node text {
+ font: 12px sans-serif;
+}
+
+.link {
+ fill: none;
+ stroke: #ccc;
+ stroke-width: 2px;
+}
+
+.link.slice {
+ stroke: rgba(157, 4, 183, 0.29);
+}
+.link.instance{
+ stroke: #ccc;
+}
+
+.link.instance.active{
+ stroke: rgba(255, 138, 0, 0.65);
+}
+
+.service-details{
+ width: 200px;
+ position: absolute;
+ top: 20px;
+ right: 20px;
+}
+
+/* when showing the thing */
+
+.animate.ng-hide-remove {
+ animation:0.5s bounceInRight ease;
+}
+
+/* when hiding the picture */
+.animate.ng-hide-add {
+ animation:0.5s bounceOutRight ease;
+}
+
+/* ANIMATIONS */
+
+@keyframes bounceInRight {
+ from, 60%, 75%, 90%, to {
+ animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
+ }
+
+ from {
+ opacity: 0;
+ transform: translate3d(3000px, 0, 0);
+ }
+
+ 60% {
+ opacity: 1;
+ transform: translate3d(-25px, 0, 0);
+ }
+
+ 75% {
+ transform: translate3d(10px, 0, 0);
+ }
+
+ 90% {
+ transform: translate3d(-5px, 0, 0);
+ }
+
+ to {
+ transform: none;
+ }
+}
+
+@keyframes bounceInLeft {
+ from, 60%, 75%, 90%, to {
+ animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
+ }
+
+ 0% {
+ opacity: 0;
+ transform: translate3d(-3000px, 0, 0);
+ }
+
+ 60% {
+ opacity: 1;
+ transform: translate3d(25px, 0, 0);
+ }
+
+ 75% {
+ transform: translate3d(-10px, 0, 0);
+ }
+
+ 90% {
+ transform: translate3d(5px, 0, 0);
+ }
+
+ to {
+ transform: none;
+ }
+}
\ No newline at end of file
diff --git a/views/ngXosViews/diagnostic/src/index.html b/views/ngXosViews/diagnostic/src/index.html
new file mode 100644
index 0000000..f7282b9
--- /dev/null
+++ b/views/ngXosViews/diagnostic/src/index.html
@@ -0,0 +1,41 @@
+<!-- browserSync -->
+<!-- bower:css -->
+<link rel="stylesheet" href="vendor/bootstrap-css/css/bootstrap.min.css" />
+<!-- endbower --><!-- endcss -->
+<!-- inject:css -->
+<link rel="stylesheet" href="/css/dev.css">
+<link rel="stylesheet" href="/css/serviceTopology.css">
+<!-- endinject -->
+
+<div ng-app="xos.serviceTopology" id="xosServiceTopology">
+ <div ui-view></div>
+</div>
+
+<!-- bower:js -->
+<script src="vendor/d3/d3.js"></script>
+<script src="vendor/lodash/lodash.js"></script>
+<script src="vendor/angular/angular.js"></script>
+<script src="vendor/angular-animate/angular-animate.js"></script>
+<script src="vendor/jquery/dist/jquery.js"></script>
+<script src="vendor/angular-mocks/angular-mocks.js"></script>
+<script src="vendor/angular-ui-router/release/angular-ui-router.js"></script>
+<script src="vendor/angular-cookies/angular-cookies.js"></script>
+<script src="vendor/angular-resource/angular-resource.js"></script>
+<script src="vendor/ng-lodash/build/ng-lodash.js"></script>
+<script src="vendor/bootstrap-css/js/bootstrap.min.js"></script>
+<!-- endbower --><!-- endjs -->
+<!-- inject:js -->
+<script src="/xosHelpers/src/xosHelpers.module.js"></script>
+<script src="/xosHelpers/src/services/noHyperlinks.interceptor.js"></script>
+<script src="/xosHelpers/src/services/csrfToken.interceptor.js"></script>
+<script src="/xosHelpers/src/services/api.services.js"></script>
+<script src="/api/ng-xoslib.js"></script>
+<script src="/api/ng-xos.js"></script>
+<script src="/api/ng-hpcapi.js"></script>
+<script src="/.tmp/main.js"></script>
+<script src="/.tmp/services.js"></script>
+<script src="/.tmp/serviceTopology.js"></script>
+<script src="/.tmp/diagnostic.js"></script>
+<script src="/.tmp/d3.js"></script>
+<script src="/.tmp/config.js"></script>
+<!-- endinject -->
diff --git a/views/ngXosViews/diagnostic/src/js/config.js b/views/ngXosViews/diagnostic/src/js/config.js
new file mode 100644
index 0000000..91ea0c2
--- /dev/null
+++ b/views/ngXosViews/diagnostic/src/js/config.js
@@ -0,0 +1,21 @@
+(function () {
+ 'use strict';
+
+ angular.module('xos.serviceTopology')
+ .constant('serviceTopologyConfig', {
+ widthMargin: 20,
+ heightMargin: 30,
+ duration: 750,
+ circle: {
+ radius: 10,
+ selectedRadius: 15
+ },
+ square: {
+ width: 20,
+ height: 20,
+ x: -10,
+ y: -10
+ }
+ })
+
+}());
\ No newline at end of file
diff --git a/views/ngXosViews/diagnostic/src/js/d3.js b/views/ngXosViews/diagnostic/src/js/d3.js
new file mode 100644
index 0000000..027f08d
--- /dev/null
+++ b/views/ngXosViews/diagnostic/src/js/d3.js
@@ -0,0 +1,261 @@
+(function () {
+ 'use strict';
+
+ angular.module('xos.serviceTopology')
+ .factory('d3', function($window){
+ return $window.d3;
+ })
+ .service('TreeLayout', function($window, $log, lodash, ServiceRelation, serviceTopologyConfig){
+
+ const drawLegend = (svg) => {
+ const legendContainer = svg.append('g')
+ .attr({
+ class: 'legend'
+ });
+
+ legendContainer.append('rect')
+ .attr({
+ transform: d => `translate(10, 80)`,
+ width: 100,
+ height: 100
+ });
+
+ // service
+ const service = legendContainer.append('g')
+ .attr({
+ class: 'node service'
+ });
+
+ service.append('circle')
+ .attr({
+ r: serviceTopologyConfig.circle.radius,
+ transform: d => `translate(30, 100)`
+ });
+
+ service.append('text')
+ .attr({
+ transform: d => `translate(45, 100)`,
+ dy: '.35em'
+ })
+ .text('Service')
+ .style('fill-opacity', 1);
+
+ // slice
+ const slice = legendContainer.append('g')
+ .attr({
+ class: 'node slice'
+ });
+
+ slice.append('rect')
+ .attr({
+ width: 20,
+ height: 20,
+ x: -10,
+ y: -10,
+ transform: d => `translate(30, 130)`
+ });
+
+ slice.append('text')
+ .attr({
+ transform: d => `translate(45, 130)`,
+ dy: '.35em'
+ })
+ .text('Slices')
+ .style('fill-opacity', 1);
+
+ // instance
+ const instance = legendContainer.append('g')
+ .attr({
+ class: 'node instance'
+ });
+
+ instance.append('rect')
+ .attr({
+ width: 20,
+ height: 20,
+ x: -10,
+ y: -10,
+ transform: d => `translate(30, 160)`
+ });
+
+ instance.append('text')
+ .attr({
+ transform: d => `translate(45, 160)`,
+ dy: '.35em'
+ })
+ .text('Instances')
+ .style('fill-opacity', 1);
+ };
+
+ var _svg, _layout, _source;
+
+ var i = 0;
+
+ // given a canvas, a layout and a data source, draw a tree layout
+ const updateTree = (svg, layout, source) => {
+
+ //cache data
+ _svg = svg;
+ _layout = layout;
+ _source = source;
+
+ const maxDepth = ServiceRelation.depthOf(source);
+
+ const diagonal = d3.svg.diagonal()
+ .projection(d => [d.y, d.x]);
+
+ // Compute the new tree layout.
+ var nodes = layout.nodes(source).reverse(),
+ links = layout.links(nodes);
+
+ // Normalize for fixed-depth.
+ nodes.forEach(function(d) {
+ // position the child node horizontally
+ const step = (($window.innerWidth - (serviceTopologyConfig.widthMargin * 2)) / maxDepth);
+ d.y = d.depth * step;
+ });
+
+ // Update the nodes…
+ var node = svg.selectAll('g.node')
+ .data(nodes, function(d) { return d.id || (d.id = ++i); });
+
+ // Enter any new nodes at the parent's previous position.
+ var nodeEnter = node.enter().append('g')
+ .attr({
+ class: d => `node ${d.type}`,
+ transform: `translate(${source.y0}, ${source.x0})`
+ });
+
+ const subscriberNodes = nodeEnter.filter('.subscriber');
+ const internetNodes = nodeEnter.filter('.internet');
+ const serviceNodes = nodeEnter.filter('.service');
+ const instanceNodes = nodeEnter.filter('.instance');
+ const sliceNodes = nodeEnter.filter('.slice');
+
+ subscriberNodes.append('rect')
+ .attr(serviceTopologyConfig.square);
+
+ internetNodes.append('rect')
+ .attr(serviceTopologyConfig.square);
+
+ serviceNodes.append('circle')
+ .attr('r', 1e-6)
+ .style('fill', d => d._children ? 'lightsteelblue' : '#fff')
+ .on('click', serviceClick);
+
+ sliceNodes.append('rect')
+ .attr({
+ width: 20,
+ height: 20,
+ x: -10,
+ y: -10
+ });
+
+ instanceNodes.append('rect')
+ .attr({
+ width: 20,
+ height: 20,
+ x: -10,
+ y: -10,
+ class: d => d.active ?'' : 'active'
+ });
+
+ nodeEnter.append('text')
+ .attr({
+ x: d => d.children ? -serviceTopologyConfig.circle.selectedRadius -3 : serviceTopologyConfig.circle.selectedRadius + 3,
+ dy: '.35em',
+ transform: d => {
+ if (d.children && d.parent){
+ if(d.parent.x < d.x){
+ return 'rotate(-30)';
+ }
+ return 'rotate(30)';
+ }
+ },
+ 'text-anchor': d => d.children ? 'end' : 'start'
+ })
+ .text(d => d.name)
+ .style('fill-opacity', 1e-6);
+
+ // Transition nodes to their new position.
+ var nodeUpdate = node.transition()
+ .duration(serviceTopologyConfig.duration)
+ .attr({
+ 'transform': d => `translate(${d.y},${d.x})`
+ });
+
+ nodeUpdate.select('circle')
+ .attr('r', d => d.selected ? serviceTopologyConfig.circle.selectedRadius : serviceTopologyConfig.circle.radius)
+ .style('fill', d => d.selected ? 'lightsteelblue' : '#fff');
+
+ nodeUpdate.select('text')
+ .style('fill-opacity', 1);
+
+ // Transition exiting nodes to the parent's new position.
+ var nodeExit = node.exit().transition()
+ .duration(serviceTopologyConfig.duration)
+ .remove();
+
+ nodeExit.select('circle')
+ .attr('r', 1e-6);
+
+ nodeExit.select('text')
+ .style('fill-opacity', 1e-6);
+
+ // Update the links…
+ var link = svg.selectAll('path.link')
+ .data(links, function(d) { return d.target.id; });
+
+ // Enter any new links at the parent's previous position.
+ link.enter().insert('path', 'g')
+ .attr('class', d => `link ${d.target.type} ${d.target.active ? '' : 'active'}`)
+ .attr('d', function(d) {
+ var o = {x: source.x0, y: source.y0};
+ return diagonal({source: o, target: o});
+ });
+
+ // Transition links to their new position.
+ link.transition()
+ .duration(serviceTopologyConfig.duration)
+ .attr('d', diagonal);
+
+ // Transition exiting nodes to the parent's new position.
+ link.exit().transition()
+ .duration(serviceTopologyConfig.duration)
+ .attr('d', function(d) {
+ var o = {x: source.x, y: source.y};
+ return diagonal({source: o, target: o});
+ })
+ .remove();
+
+ // Stash the old positions for transition.
+ nodes.forEach(function(d) {
+ d.x0 = d.x;
+ d.y0 = d.y;
+ });
+ };
+
+ const serviceClick = function(d) {
+
+ $log.info('TODO emit an event to highlight VMs');
+
+ if(!d.service){
+ return;
+ }
+
+ // toggling selected status
+ d.selected = !d.selected;
+
+ var selectedNode = d3.select(this);
+
+ selectedNode
+ .transition()
+ .duration(serviceTopologyConfig.duration)
+ .attr('r', serviceTopologyConfig.circle.selectedRadius);
+ };
+
+ this.updateTree = updateTree;
+ this.drawLegend = drawLegend;
+ });
+
+}());
\ No newline at end of file
diff --git a/views/ngXosViews/diagnostic/src/js/diagnostic.js b/views/ngXosViews/diagnostic/src/js/diagnostic.js
new file mode 100644
index 0000000..7f433f6
--- /dev/null
+++ b/views/ngXosViews/diagnostic/src/js/diagnostic.js
@@ -0,0 +1,23 @@
+(function () {
+ 'use strict';
+
+ angular.module('xos.serviceTopology')
+ .directive('diagnostic', function(){
+ return {
+ restrict: 'E',
+ templateUrl: 'templates/diagnostic.tpl.html',
+ controllerAs: 'vm',
+ controller: function(Subscribers, ServiceRelation){
+ Subscribers.query().$promise
+ .then((subscribers) => {
+ this.subscribers = subscribers;
+ this.selectedSubscriber = subscribers[0];
+ return ServiceRelation.get(this.selectedSubscriber);
+ })
+ .then((serviceChain) => {
+ this.serviceChain = serviceChain;
+ });
+ }
+ }
+ });
+})();
\ No newline at end of file
diff --git a/views/ngXosViews/diagnostic/src/js/main.js b/views/ngXosViews/diagnostic/src/js/main.js
new file mode 100644
index 0000000..a6e79c5
--- /dev/null
+++ b/views/ngXosViews/diagnostic/src/js/main.js
@@ -0,0 +1,20 @@
+'use strict';
+
+angular.module('xos.serviceTopology', [
+ 'ngResource',
+ 'ngCookies',
+ 'ngLodash',
+ 'ngAnimate',
+ 'ui.router',
+ 'xos.helpers'
+])
+.config(($stateProvider) => {
+ $stateProvider
+ .state('home', {
+ url: '/',
+ template: '<diagnostic></diagnostic>'
+ });
+})
+.config(function($httpProvider){
+ $httpProvider.interceptors.push('NoHyperlinks');
+});
diff --git a/views/ngXosViews/diagnostic/src/js/serviceTopology.js b/views/ngXosViews/diagnostic/src/js/serviceTopology.js
new file mode 100644
index 0000000..d30122c
--- /dev/null
+++ b/views/ngXosViews/diagnostic/src/js/serviceTopology.js
@@ -0,0 +1,64 @@
+(function () {
+ 'use strict';
+
+ angular.module('xos.serviceTopology')
+ .directive('serviceTopology', function(){
+ return {
+ restrict: 'E',
+ scope: {
+ serviceChain: '='
+ },
+ bindToController: true,
+ controllerAs: 'vm',
+ template: '',
+ controller: function($element, $window, $scope, d3, serviceTopologyConfig, ServiceRelation, Slice, Instances, Subscribers, TreeLayout){
+
+ const el = $element[0];
+
+ this.instances = [];
+ this.slices = [];
+
+ const width = el.clientWidth - (serviceTopologyConfig.widthMargin * 2);
+ const height = el.clientHeight - (serviceTopologyConfig.heightMargin * 2);
+
+ const treeLayout = d3.layout.tree()
+ .size([height, width]);
+
+ const svg = d3.select($element[0])
+ .append('svg')
+ .style('width', `${el.clientWidth}px`)
+ .style('height', `${el.clientHeight}px`)
+
+ const treeContainer = svg.append('g')
+ .attr('transform', `translate(${serviceTopologyConfig.widthMargin * 4},${serviceTopologyConfig.heightMargin})`);
+
+ var root;
+
+ const draw = (tree) => {
+ root = tree;
+ root.x0 = height / 2;
+ root.y0 = width / 2;
+
+ TreeLayout.updateTree(treeContainer, treeLayout, root);
+ };
+
+ TreeLayout.drawLegend(svg);
+
+ this.getInstances = (slice) => {
+ Instances.query({slice: slice.id}).$promise
+ .then((instances) => {
+ this.selectedSlice = slice;
+ this.instances = instances;
+ })
+ };
+
+ $scope.$watch(() => this.serviceChain, (chain) => {
+ if(chain){
+ draw(chain);
+ }
+ });
+ }
+ }
+ });
+
+}());
\ No newline at end of file
diff --git a/views/ngXosViews/diagnostic/src/js/services.js b/views/ngXosViews/diagnostic/src/js/services.js
new file mode 100644
index 0000000..60a20d2
--- /dev/null
+++ b/views/ngXosViews/diagnostic/src/js/services.js
@@ -0,0 +1,160 @@
+(function () {
+ 'use strict';
+
+ angular.module('xos.serviceTopology')
+ .service('Services', function($resource){
+ return $resource('/xos/services/:id', {id: '@id'});
+ })
+ .service('Tenant', function($resource){
+ return $resource('/xos/tenants');
+ })
+ .service('Slice', function($resource){
+ return $resource('/xos/slices', {id: '@id'});
+ })
+ .service('Instances', function($resource){
+ return $resource('/xos/instances', {id: '@id'});
+ })
+ .service('Subscribers', function($resource){
+ return $resource('/xos/subscribers', {id: '@id'});
+ })
+ .service('ServiceRelation', function($q, lodash, Services, Tenant, Slice, Instances){
+
+ // count the mas depth of an object
+ const depthOf = (obj) => {
+ var depth = 0;
+ if (obj.children) {
+ obj.children.forEach(function (d) {
+ var tmpDepth = depthOf(d);
+ if (tmpDepth > depth) {
+ depth = tmpDepth
+ }
+ })
+ }
+ return 1 + depth
+ };
+
+ // find all the relation defined for a given root
+ const findLevelRelation = (tenants, rootId) => {
+ return lodash.filter(tenants, service => {
+ return service.subscriber_service === rootId;
+ });
+ };
+
+ const findSpecificInformation = (tenants, rootId) => {
+ var tenants = lodash.filter(tenants, service => {
+ return service.provider_service === rootId && service.subscriber_tenant;
+ });
+
+ var info;
+
+ tenants.forEach((tenant) => {
+ if(tenant.service_specific_attribute){
+ info = JSON.parse(tenant.service_specific_attribute);
+ }
+ });
+
+ return info;
+ };
+
+ // find all the service defined by a given array of relations
+ const findLevelServices = (relations, services) => {
+ const levelServices = [];
+ lodash.forEach(relations, (tenant) => {
+ var service = lodash.find(services, {id: tenant.provider_service});
+ levelServices.push(service);
+ });
+ return levelServices;
+ };
+
+ const buildLevel = (tenants, services, rootService, parentName = null) => {
+
+ // build an array of unlinked services
+ // these are the services that should still placed in the tree
+ var unlinkedServices = lodash.difference(services, [rootService]);
+
+ // find all relations relative to this rootElement
+ const levelRelation = findLevelRelation(tenants, rootService.id);
+
+ // find all items related to rootElement
+ const levelServices = findLevelServices(levelRelation, services);
+
+ // remove this item from the list (performance
+ unlinkedServices = lodash.difference(unlinkedServices, levelServices);
+
+ rootService.service_specific_attribute = findSpecificInformation(tenants, rootService.id);
+
+ const tree = {
+ name: rootService.humanReadableName,
+ parent: parentName,
+ type: 'service',
+ service: rootService,
+ children: []
+ };
+
+ lodash.forEach(levelServices, (service) => {
+ tree.children.push(buildLevel(tenants, unlinkedServices, service, rootService.humanReadableName));
+ });
+
+ // if it is the last element append internet
+ if(tree.children.length === 0){
+ tree.children.push({
+ name: 'Internet',
+ type: 'internet',
+ children: []
+ });
+ }
+
+ return tree;
+ };
+
+ const buildServiceTree = (services, tenants, subscriber = {id: 1, name: 'fakeSubs'}) => {
+
+ // find the root service
+ // it is the one attached to subsriber_root
+ // as now we have only one root so this can work
+ const rootServiceId = lodash.find(tenants, {subscriber_root: subscriber.id}).provider_service;
+ const rootService = lodash.find(services, {id: rootServiceId});
+
+ const serviceTree = buildLevel(tenants, services, rootService);
+
+ return {
+ name: subscriber.name,
+ parent: null,
+ type: 'subscriber',
+ children: [serviceTree]
+ };
+
+ };
+
+ const get = (subscriber) => {
+ var deferred = $q.defer();
+ var services, tenants;
+ Services.query().$promise
+ .then((res) => {
+ services = res;
+ return Tenant.query().$promise;
+ })
+ .then((res) => {
+ tenants = res;
+ deferred.resolve(buildServiceTree(services, tenants, subscriber));
+ })
+ .catch((e) => {
+ throw new Error(e);
+ });
+
+ return deferred.promise;
+ };
+
+ // export APIs
+ return {
+ get: get,
+ buildLevel: buildLevel,
+ buildServiceTree: buildServiceTree,
+ findLevelRelation: findLevelRelation,
+ findLevelServices: findLevelServices,
+ depthOf: depthOf,
+ findSpecificInformation: findSpecificInformation
+ }
+ });
+
+}());
\ No newline at end of file
diff --git a/views/ngXosViews/diagnostic/src/templates/diagnostic.tpl.html b/views/ngXosViews/diagnostic/src/templates/diagnostic.tpl.html
new file mode 100644
index 0000000..a8b2d3a
--- /dev/null
+++ b/views/ngXosViews/diagnostic/src/templates/diagnostic.tpl.html
@@ -0,0 +1,3 @@
+<div class="half-height">
+ <service-topology service-chain="vm.serviceChain"></service-topology>
+</div>