[CORD-1549] Updating GUI extension
Change-Id: Ie376fb8bd7eb321a8a2448d64e5f7e086b15328b
(cherry picked from commit 2b16ea1c3375697978339745ab7d1ced73cbd154)
diff --git a/.gitignore b/.gitignore
index b947077..b83deb0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,4 @@
node_modules/
dist/
+.tmp/
+.idea/
diff --git a/conf/browsersync.conf.js b/conf/browsersync.conf.js
index 49936d4..06cb51a 100755
--- a/conf/browsersync.conf.js
+++ b/conf/browsersync.conf.js
@@ -1,4 +1,5 @@
const conf = require('./gulp.conf');
+const proxy = require('./proxy');
module.exports = function () {
return {
@@ -6,7 +7,15 @@
baseDir: [
conf.paths.tmp,
conf.paths.src
- ]
+ ],
+ middleware: function (req, res, next) {
+ if (req.url.indexOf('xosapi') !== -1 || req.url.indexOf('xos') !== -1 || req.url.indexOf('socket') !== -1) {
+ proxy.api.web(req, res);
+ }
+ else {
+ next();
+ }
+ }
},
open: false
};
diff --git a/conf/proxy.js b/conf/proxy.js
new file mode 100644
index 0000000..311dbcd
--- /dev/null
+++ b/conf/proxy.js
@@ -0,0 +1,18 @@
+const httpProxy = require('http-proxy');
+
+const target = process.env.PROXY || '192.168.46.100';
+
+const apiProxy = httpProxy.createProxyServer({
+ target: `http://${target}`
+});
+
+apiProxy.on('error', (error, req, res) => {
+ res.writeHead(500, {
+ 'Content-Type': 'text/plain'
+ });
+ console.error('[Proxy]', error);
+});
+
+module.exports = {
+ api: apiProxy
+};
diff --git a/package.json b/package.json
index ec3e7fa..32a0676 100644
--- a/package.json
+++ b/package.json
@@ -1,82 +1,93 @@
{
- "version": "2.0.0",
+ "version": "3.0.0",
"dependencies": {
- "angular": "^1.5.0",
- "angular-animate": "^1.6.0",
- "angular-cookies": "^1.6.0",
- "angular-resource": "^1.6.0",
- "angular-toastr": "^2.1.1",
- "angular-ui-bootstrap": "^2.3.1",
+ "angular": "1.6.3",
+ "angular-animate": "1.6.3",
+ "angular-cookies": "1.6.3",
+ "angular-resource": "1.6.3",
+ "angular-toastr": "2.1.1",
+ "angular-ui-bootstrap": "2.5.0",
"angular-ui-router": "1.0.0-beta.1",
- "bootstrap": "^3.3.7",
- "jquery": "^3.1.1",
- "lodash": "^4.17.2",
- "pluralize": "^3.1.0",
- "rxjs": "^5.0.1",
- "socket.io-client": "^1.7.2"
+ "bootstrap": "3.3.7",
+ "bootstrap-sass": "3.3.7",
+ "d3": "3.5.17",
+ "jquery": "3.1.1",
+ "lodash": "4.17.4",
+ "ngprogress": "1.1.1",
+ "oclazyload": "1.1.0",
+ "pluralize": "3.1.0",
+ "rxjs": "5.2.0",
+ "socket.io-client": "1.7.3"
},
"devDependencies": {
- "angular-mocks": "^1.5.0-beta.2",
- "autoprefixer": "^6.2.2",
- "babel-eslint": "^6.0.2",
- "babel-loader": "^6.2.0",
- "babel-plugin-istanbul": "^2.0.1",
+ "angular-mocks": "1.6.4",
+ "autoprefixer": "6.7.7",
+ "babel-eslint": "6.1.2",
+ "babel-loader": "6.4.1",
+ "babel-plugin-istanbul": "2.0.3",
"base-href-webpack-plugin": "1.0.0",
- "browser-sync": "^2.9.11",
- "browser-sync-spa": "^1.0.3",
- "copy-webpack-plugin": "^4.0.1",
- "css-loader": "^0.23.1",
- "del": "^2.0.2",
- "es6-shim": "^0.35.0",
- "eslint": "^3.2.2",
- "eslint-config-angular": "^0.5.0",
- "eslint-config-xo-space": "^0.12.0",
- "eslint-loader": "^1.3.0",
- "eslint-plugin-angular": "^1.3.0",
- "eslint-plugin-babel": "^3.1.0",
+ "bluebird": "^3.5.0",
+ "browser-sync": "2.18.8",
+ "browser-sync-spa": "1.0.3",
+ "copy-webpack-plugin": "4.0.1",
+ "css-loader": "0.23.1",
+ "del": "2.2.2",
+ "es6-shim": "0.35.3",
+ "eslint": "3.19.0",
+ "eslint-config-angular": "0.5.0",
+ "eslint-config-xo-space": "0.12.0",
+ "eslint-loader": "1.7.1",
+ "eslint-plugin-angular": "1.6.4",
+ "eslint-plugin-babel": "3.3.0",
"extract-text-webpack-plugin": "2.0.0-beta.3",
- "file-loader": "^0.9.0",
+ "file-loader": "0.9.0",
+ "gitbook-cli": "^2.3.0",
"gulp": "gulpjs/gulp#4ed9a4a3275559c73a396eff7e1fde3824951ebb",
- "gulp-angular-filesort": "^1.1.1",
- "gulp-angular-templatecache": "^1.8.0",
- "gulp-filter": "^4.0.0",
- "gulp-htmlmin": "^1.3.0",
+ "gulp-angular-filesort": "1.1.1",
+ "gulp-angular-templatecache": "1.9.1",
+ "gulp-filter": "4.0.0",
+ "gulp-htmlmin": "1.3.0",
"gulp-hub": "frankwallis/gulp-hub#d461b9c700df9010d0a8694e4af1fb96d9f38bf4",
- "gulp-insert": "^0.5.0",
- "gulp-ng-annotate": "^1.1.0",
- "gulp-rename": "^1.2.2",
- "gulp-replace": "^0.5.4",
- "gulp-sass": "^2.1.1",
- "gulp-util": "^3.0.7",
- "html-loader": "^0.4.3",
- "html-webpack-plugin": "^2.9.0",
- "jasmine": "^2.4.1",
- "jasmine-jquery": "^2.1.1",
- "json-loader": "^0.5.4",
- "karma": "^1.3.0",
- "karma-angular-filesort": "^1.0.0",
- "karma-chrome-launcher": "^2.0.0",
- "karma-coverage": "^1.1.1",
- "karma-es6-shim": "^1.0.0",
- "karma-jasmine": "^1.0.2",
- "karma-junit-reporter": "^1.1.0",
- "karma-mocha-reporter": "^2.2.1",
- "karma-ng-html2js-preprocessor": "^0.2.0",
- "karma-phantomjs-launcher": "^1.0.0",
- "karma-phantomjs-shim": "^1.1.2",
- "karma-webpack": "^1.7.0",
- "ng-annotate-loader": "^0.0.10",
- "node-sass": "^3.4.2",
- "phantomjs-prebuilt": "^2.1.6",
- "postcss-loader": "^0.8.0",
- "sass-loader": "^3.1.2",
- "style-loader": "^0.13.0",
- "ts-loader": "^0.8.2",
- "tslint": "^3.15.1",
- "tslint-loader": "^2.1.0",
- "typescript": "^2.0.2",
- "typings": "^1.0.4",
- "url-loader": "^0.5.7",
+ "gulp-insert": "0.5.0",
+ "gulp-ng-annotate": "1.1.0",
+ "gulp-rename": "1.2.2",
+ "gulp-replace": "0.5.4",
+ "gulp-sass": "2.3.2",
+ "gulp-util": "3.0.8",
+ "html-loader": "0.4.5",
+ "html-webpack-plugin": "2.28.0",
+ "http-proxy": "1.16.2",
+ "istanbul-instrumenter-loader": "2.0.0",
+ "jasmine": "2.5.3",
+ "jasmine-jquery": "2.1.1",
+ "jasmine-spec-reporter": "^4.0.0",
+ "json-loader": "0.5.4",
+ "karma": "1.6.0",
+ "karma-angular-filesort": "1.0.2",
+ "karma-chrome-launcher": "2.0.0",
+ "karma-coverage": "1.1.1",
+ "karma-es6-shim": "1.0.0",
+ "karma-jasmine": "1.1.0",
+ "karma-junit-reporter": "1.2.0",
+ "karma-mocha-reporter": "2.2.3",
+ "karma-ng-html2js-preprocessor": "0.2.2",
+ "karma-phantomjs-launcher": "1.0.4",
+ "karma-phantomjs-shim": "1.4.0",
+ "karma-webpack": "1.8.1",
+ "ng-annotate-loader": "0.0.10",
+ "node-sass": "3.13.1",
+ "phantomjs-prebuilt": "2.1.14",
+ "postcss-loader": "0.8.2",
+ "remap-istanbul": "0.9.5",
+ "resolve-url-loader": "1.6.1",
+ "sass-loader": "3.2.3",
+ "style-loader": "0.13.2",
+ "ts-loader": "0.8.2",
+ "tslint": "3.15.1",
+ "tslint-loader": "2.1.5",
+ "typescript": "2.2.2",
+ "typings": "1.5.0",
+ "url-loader": "0.5.8",
"webpack": "2.1.0-beta.20"
},
"scripts": {
@@ -85,9 +96,10 @@
"start": "gulp serve",
"typings": "typings install",
"serve:dist": "gulp serve:dist",
- "pretest": "npm run lint",
+ "serve:dist:watch": "gulp serve:dist:watch",
"test": "gulp test",
"test:auto": "gulp test:auto",
+ "test:e2e": "protractor conf/protractor.conf.js",
"config": "gulp config",
"lint": "tslint -c ./tslint.json 'src/**/*.ts'"
},
@@ -104,4 +116,4 @@
"xo-space/esnext"
]
}
-}
+}
\ No newline at end of file
diff --git a/src/index.html b/src/index.html
index d8ac498..4c14a29 100644
--- a/src/index.html
+++ b/src/index.html
@@ -3,8 +3,15 @@
<head>
<meta charset="UTF-8">
<title>Document</title>
+ <link href="/xos/loader.css" rel="stylesheet">
+ <link href="/xos/app.css" rel="stylesheet">
</head>
<body>
<div ui-view></div>
+ <script src="/xos/vendor.js"></script>
+ <script src="/xos/app.js"></script>
+ <script src="/xos/loader.js"></script>
+ <script src="/xos/app.config.js"></script>
+ <script src="/xos/style.config.js"></script>
</body>
-</html>
\ No newline at end of file
+</html>
diff --git a/src/index.ts b/src/index.ts
index 417424f..cf6bbc4 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -12,7 +12,7 @@
angular.module('xos-sample-gui-extension', [
'ui.router',
- 'xosCore'
+ 'app'
])
.config(routesConfig)
.component('demo', xosDemoComponent)