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/diagnostic/bower.json b/views/ngXosViews/diagnostic/bower.json
index 9279b8e..e5693ea 100644
--- a/views/ngXosViews/diagnostic/bower.json
+++ b/views/ngXosViews/diagnostic/bower.json
@@ -2,7 +2,7 @@
"name": "xos-diagnostic",
"version": "0.0.0",
"authors": [
- "Matteo Scandolo <teo@onlab.us>"
+ "Matteo Scandolo <matteo.scandolo@gmail.com>"
],
"description": "The diagnostic view",
"license": "MIT",
@@ -14,7 +14,8 @@
"test",
"tests"
],
- "dependencies": {},
+ "dependencies": {
+ },
"devDependencies": {
"jquery": "2.1.4",
"angular-mocks": "1.4.7",
@@ -26,9 +27,8 @@
"lodash": "~4.11.1",
"bootstrap-css": "3.3.6",
"angular-chart.js": "~0.10.2",
- "d3": "~3.5.17"
- },
- "resolutions": {
- "angular": "1.4.7"
+ "d3": "~3.5.17",
+ "angular-recursion": "~1.0.5",
+ "ng-xos-lib": "opencord/ng-xos-lib#~1.0.0"
}
}
diff --git a/views/ngXosViews/diagnostic/gulp/build.js b/views/ngXosViews/diagnostic/gulp/build.js
index 20bbc14..716d301 100644
--- a/views/ngXosViews/diagnostic/gulp/build.js
+++ b/views/ngXosViews/diagnostic/gulp/build.js
@@ -41,7 +41,9 @@
return del(
[
options.dashboards + 'xosDiagnostic.html',
- options.static + 'css/xosDiagnostic.css'
+ options.static + 'css/xosDiagnostic.css',
+ options.static + 'images/diagnostic-icon.png',
+ options.static + 'images/diagnostic-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}/diagnostic-icon.png`,`${options.icon}/diagnostic-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/xosDiagnosticVendor.js',
+ options.static + 'vendor/xosDiagnosticVendor.js',
options.static + 'js/xosDiagnostic.js',
options.static + 'css/xosDiagnostic.css'
]),
@@ -130,7 +138,7 @@
return gulp.src(bowerDeps)
.pipe(concat('xosDiagnosticVendor.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/diagnostic/gulp/server.js b/views/ngXosViews/diagnostic/gulp/server.js
index fbc605b..36fdded 100644
--- a/views/ngXosViews/diagnostic/gulp/server.js
+++ b/views/ngXosViews/diagnostic/gulp/server.js
@@ -52,12 +52,10 @@
server: {
baseDir: options.src,
routes: {
- '/xos/core/xoslib/static/js/vendor': options.helpers,
'/xos/core/static': options.static + '../../static/'
},
middleware: function(req, res, next){
if(
- req.url.indexOf('/?no_hyperlinks') !== -1 ||
req.url.indexOf('/api/') !== -1
){
if(conf.xoscsrftoken && conf.xossessionid){
@@ -116,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/diagnostic/gulpfile.js b/views/ngXosViews/diagnostic/gulpfile.js
index 08df554..c825df8 100644
--- a/views/ngXosViews/diagnostic/gulpfile.js
+++ b/views/ngXosViews/diagnostic/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/diagnostic/karma.conf.js b/views/ngXosViews/diagnostic/karma.conf.js
index 44283c8..e5abf39 100644
--- a/views/ngXosViews/diagnostic/karma.conf.js
+++ b/views/ngXosViews/diagnostic/karma.conf.js
@@ -26,8 +26,8 @@
// 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',
@@ -46,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/diagnostic/package.json b/views/ngXosViews/diagnostic/package.json
index e5437b9..d916ea0 100644
--- a/views/ngXosViews/diagnostic/package.json
+++ b/views/ngXosViews/diagnostic/package.json
@@ -1,5 +1,5 @@
{
- "name": "xos-serviceTopology",
+ "name": "xos-diagnostic",
"version": "1.0.0",
"description": "Angular Application for XOS, created with generator-xos",
"scripts": {
@@ -8,8 +8,10 @@
"dev": "NODE_ENV=mock gulp serve",
"local": "NODE_ENV=local gulp serve",
"server": "easy-mocker -c ./mocks/diagnostic.conf.json -d ./mocks/data",
+ "prebuild": "npm install && bower install",
"build": "gulp",
"test": "karma start",
+ "test:ci": "karma start --single-run",
"lint": "eslint src/js/"
},
"keywords": [
diff --git a/views/ngXosViews/diagnostic/src/css/dev.css b/views/ngXosViews/diagnostic/src/css/dev.css
new file mode 100644
index 0000000..45ce372
--- /dev/null
+++ b/views/ngXosViews/diagnostic/src/css/dev.css
@@ -0,0 +1,5 @@
+#xosDiagnostic{
+ position: absolute;
+ top: 100px;
+ left: 200px;
+}
\ No newline at end of file
diff --git a/views/ngXosViews/diagnostic/src/css/main.css b/views/ngXosViews/diagnostic/src/css/main.css
index 1cf0848..07fe951 100644
--- a/views/ngXosViews/diagnostic/src/css/main.css
+++ b/views/ngXosViews/diagnostic/src/css/main.css
@@ -1,5 +1,6 @@
/* CONTAINER */
#xosDiagnostic, [ui-view] {
+ height: 100%;
min-height: 700px;
position: relative; }
diff --git a/views/ngXosViews/diagnostic/src/icons/README.md b/views/ngXosViews/diagnostic/src/icons/README.md
new file mode 100644
index 0000000..0d5a787
--- /dev/null
+++ b/views/ngXosViews/diagnostic/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/diagnostic/src/index.html b/views/ngXosViews/diagnostic/src/index.html
index f91ebbb..b5c899e 100644
--- a/views/ngXosViews/diagnostic/src/index.html
+++ b/views/ngXosViews/diagnostic/src/index.html
@@ -4,6 +4,7 @@
<link rel="stylesheet" href="vendor/angular-chart.js/dist/angular-chart.css" />
<!-- 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,10 @@
<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>
<script src="/.tmp/subscriber-modal.js"></script>
<script src="/.tmp/serviceTopologyHelper.js"></script>