Updated yeoman generator to support external ng-xos-lib
Updateding Custom Views:
- ceilometerDashboard
- contentProvider
- dashboardManager
- developer
- diagnostic
- hpc
- mCordTopology
- openVPN
- serviceGrid
- subscribers
- syncNotifier
- tenant
- truckroll
Change-Id: I8bdebf70d3b72ceca8ec04565213efa60bc0b8d3
diff --git a/views/ngXosViews/developer/bower.json b/views/ngXosViews/developer/bower.json
index da4d6b3..1d82b4a 100644
--- a/views/ngXosViews/developer/bower.json
+++ b/views/ngXosViews/developer/bower.json
@@ -2,7 +2,7 @@
"name": "xos-developer",
"version": "0.0.0",
"authors": [
- "Matteo Scandolo <teo@onlab.us>"
+ "Matteo Scandolo <matteo.scandolo@gmail.com>"
],
"description": "The developer view",
"license": "MIT",
@@ -26,6 +26,9 @@
"angular-resource": "1.4.7",
"lodash": "~4.11.1",
"bootstrap-css": "3.3.6",
- "angular-chart.js": "~0.10.2"
+ "angular-chart.js": "~0.10.2",
+ "d3": "~3.5.17",
+ "angular-recursion": "~1.0.5",
+ "ng-xos-lib": "opencord/ng-xos-lib#~1.0.0"
}
}
diff --git a/views/ngXosViews/developer/gulp/build.js b/views/ngXosViews/developer/gulp/build.js
index 87e68d8..4ad71d4 100644
--- a/views/ngXosViews/developer/gulp/build.js
+++ b/views/ngXosViews/developer/gulp/build.js
@@ -41,7 +41,9 @@
return del(
[
options.dashboards + 'xosDeveloper.html',
- options.static + 'css/xosDeveloper.css'
+ options.static + 'css/xosDeveloper.css',
+ options.static + 'images/developer-icon.png',
+ options.static + 'images/developer-icon-active.png'
],
{force: true}
);
@@ -70,6 +72,12 @@
.pipe(gulp.dest(options.static + 'css/'))
});
+ // copy images in correct folder
+ gulp.task('copyImages', ['wait'], function(){
+ return gulp.src([`${options.icon}/developer-icon.png`,`${options.icon}/developer-icon-active.png`])
+ .pipe(gulp.dest(options.static + 'images/'))
+ });
+
// compile and minify scripts
gulp.task('scripts', function() {
return gulp.src([
@@ -104,7 +112,7 @@
.pipe(
inject(
gulp.src([
- options.static + 'js/vendor/xosDeveloperVendor.js',
+ options.static + 'vendor/xosDeveloperVendor.js',
options.static + 'js/xosDeveloper.js',
options.static + 'css/xosDeveloper.css'
]),
@@ -130,7 +138,7 @@
return gulp.src(bowerDeps)
.pipe(concat('xosDeveloperVendor.js'))
.pipe(uglify())
- .pipe(gulp.dest(options.static + 'js/vendor/'));
+ .pipe(gulp.dest(options.static + 'vendor/'));
});
gulp.task('lint', function () {
@@ -157,6 +165,7 @@
'wiredep',
'css',
'copyCss',
+ 'copyImages',
'copyHtml',
'cleanTmp'
);
diff --git a/views/ngXosViews/developer/gulp/server.js b/views/ngXosViews/developer/gulp/server.js
index 1e40a34..36fdded 100644
--- a/views/ngXosViews/developer/gulp/server.js
+++ b/views/ngXosViews/developer/gulp/server.js
@@ -52,7 +52,6 @@
server: {
baseDir: options.src,
routes: {
- '/xos/core/xoslib/static/js/vendor': options.helpers,
'/xos/core/static': options.static + '../../static/'
},
middleware: function(req, res, next){
@@ -115,7 +114,7 @@
inject(
gulp.src([
options.tmp + '**/*.js',
- options.helpers + 'ngXosHelpers.js'
+ options.helpers + 'ngXosHelpers.min.js'
])
.pipe(angularFilesort()),
{
diff --git a/views/ngXosViews/developer/gulpfile.js b/views/ngXosViews/developer/gulpfile.js
index 08df554..c825df8 100644
--- a/views/ngXosViews/developer/gulpfile.js
+++ b/views/ngXosViews/developer/gulpfile.js
@@ -6,12 +6,13 @@
var options = {
src: 'src/',
css: 'src/css/',
+ icon: 'src/icons',
sass: 'src/sass/',
scripts: 'src/js/',
tmp: 'src/.tmp',
dist: 'dist/',
api: '../../ngXosLib/api/',
- helpers: '../../../xos/core/xoslib/static/js/vendor/',
+ helpers: './src/vendor/ng-xos-lib/dist/',
static: '../../../xos/core/xoslib/static/', // this is the django static folder
dashboards: '../../../xos/core/xoslib/dashboards/' // this is the django html folder
};
diff --git a/views/ngXosViews/developer/karma.conf.js b/views/ngXosViews/developer/karma.conf.js
index 4123be9..e5abf39 100644
--- a/views/ngXosViews/developer/karma.conf.js
+++ b/views/ngXosViews/developer/karma.conf.js
@@ -26,8 +26,9 @@
// 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',
+ './src/vendor/ng-xos-lib/dist/ngXosVendor.min.js',
+ './src/vendor/ng-xos-lib/dist/ngXosHelpers.min.js',
+ 'src/js/main.js',
'src/js/**/*.js',
'spec/**/*.mock.js',
'spec/**/*.test.js',
@@ -45,6 +46,7 @@
preprocessors: {
'src/js/**/*.js': ['babel'],
'spec/**/*.test.js': ['babel'],
+ 'spec/**/*.mock.js': ['babel'],
'src/**/*.html': ['ng-html2js']
},
diff --git a/views/ngXosViews/developer/package.json b/views/ngXosViews/developer/package.json
index f28682f..9a6eff2 100644
--- a/views/ngXosViews/developer/package.json
+++ b/views/ngXosViews/developer/package.json
@@ -9,9 +9,7 @@
"build": "gulp",
"test": "karma start",
"test:ci": "karma start --single-run",
- "lint": "eslint src/js/",
- "single-site": "easy-mocker -c ./mocks/config.json -d ./mocks/single-site",
- "multi-site": "easy-mocker -c ./mocks/config.json -d ./mocks/multi-site"
+ "lint": "eslint src/js/"
},
"keywords": [
"XOS",
@@ -27,7 +25,7 @@
"css-mqpacker": "^4.0.0",
"csswring": "^4.2.1",
"del": "^2.0.2",
- "easy-mocker": "^1.3.0",
+ "easy-mocker": "^1.2.0",
"eslint": "^1.8.0",
"eslint-plugin-angular": "linkmesrl/eslint-plugin-angular",
"gulp": "^3.9.0",
diff --git a/views/ngXosViews/developer/src/css/dev.css b/views/ngXosViews/developer/src/css/dev.css
new file mode 100644
index 0000000..ca9b692
--- /dev/null
+++ b/views/ngXosViews/developer/src/css/dev.css
@@ -0,0 +1,5 @@
+#xosDeveloper{
+ position: absolute;
+ top: 100px;
+ left: 200px;
+}
\ No newline at end of file
diff --git a/views/ngXosViews/developer/src/icons/README.md b/views/ngXosViews/developer/src/icons/README.md
new file mode 100644
index 0000000..0d5a787
--- /dev/null
+++ b/views/ngXosViews/developer/src/icons/README.md
@@ -0,0 +1,18 @@
+# Set icon for custom dashboard
+
+## Path to add images : <dashboard-name>/src/icons
+
+### Add two images with name in following format
+ <dashboard-name>-icon.png
+ <dashboard-name>-icon-active.png
+
+Examples:
+ If your dashboard name is `slice`
+ then you will add the images with the name as
+ `slice-icon.png`
+ `slice-icon-active.png`
+
+
+
+
+Note: If you don't add the custom images, then dashboard will use the default images stored at `/xos/core/xoslib/static/images`
\ No newline at end of file
diff --git a/views/ngXosViews/developer/src/index.html b/views/ngXosViews/developer/src/index.html
index f8946e9..e2dd2d0 100644
--- a/views/ngXosViews/developer/src/index.html
+++ b/views/ngXosViews/developer/src/index.html
@@ -5,6 +5,7 @@
<!-- endbower -->
<!-- endcss -->
<!-- inject:css -->
+<link rel="stylesheet" href="/css/dev.css">
<link rel="stylesheet" href="/css/main.css">
<link rel="stylesheet" href="/../../../xos/core/static/xosNgLib.css">
<!-- endinject -->
@@ -25,9 +26,11 @@
<script src="vendor/bootstrap-css/js/bootstrap.min.js"></script>
<script src="vendor/Chart.js/Chart.js"></script>
<script src="vendor/angular-chart.js/dist/angular-chart.js"></script>
+<script src="vendor/d3/d3.js"></script>
+<script src="vendor/angular-recursion/angular-recursion.js"></script>
<!-- endbower -->
<!-- endjs -->
<!-- inject:js -->
-<script src="/../../../xos/core/xoslib/static/js/vendor/ngXosHelpers.js"></script>
+<script src="/vendor/ng-xos-lib/dist/ngXosHelpers.min.js"></script>
<script src="/.tmp/main.js"></script>
<!-- endinject -->
\ No newline at end of file