Builded Truckroll
diff --git a/views/ngXosViews/truckroll/gulp/build.js b/views/ngXosViews/truckroll/gulp/build.js
index 5544abf..9cba015 100644
--- a/views/ngXosViews/truckroll/gulp/build.js
+++ b/views/ngXosViews/truckroll/gulp/build.js
@@ -22,6 +22,10 @@
var inject = require('gulp-inject');
var rename = require('gulp-rename');
var replace = require('gulp-replace');
+var postcss = require('gulp-postcss');
+var autoprefixer = require('autoprefixer');
+var mqpacker = require('css-mqpacker');
+var csswring = require('csswring');
var TEMPLATE_FOOTER = `}]);
angular.module('xos.truckroll').run(function($location){$location.path('/')});
@@ -44,7 +48,7 @@
mqpacker,
csswring
];
- console.log(options.css);
+
gulp.src([
`${options.css}**/*.css`,
`!${options.css}dev.css`
@@ -55,7 +59,7 @@
gulp.task('copyCss', ['css'], function(){
return gulp.src([`${options.tmp}/css/*.css`])
- .pipe(concat('xosDiagnostic.css'))
+ .pipe(concat('xosTruckroll.css'))
.pipe(gulp.dest(options.static + 'css/'))
});
diff --git a/views/ngXosViews/truckroll/gulpfile.js b/views/ngXosViews/truckroll/gulpfile.js
index b2cdab8..a3523ee 100644
--- a/views/ngXosViews/truckroll/gulpfile.js
+++ b/views/ngXosViews/truckroll/gulpfile.js
@@ -5,6 +5,7 @@
var options = {
src: 'src/',
+ css: 'src/css/',
scripts: 'src/js/',
tmp: 'src/.tmp',
dist: 'dist/',
diff --git a/views/ngXosViews/truckroll/package.json b/views/ngXosViews/truckroll/package.json
index d40269f..9d8abe6 100644
--- a/views/ngXosViews/truckroll/package.json
+++ b/views/ngXosViews/truckroll/package.json
@@ -19,27 +19,31 @@
"license": "MIT",
"dependencies": {},
"devDependencies": {
+ "autoprefixer": "^6.3.3",
"browser-sync": "^2.9.11",
+ "css-mqpacker": "^4.0.0",
+ "csswring": "^4.2.1",
"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-postcss": "^6.1.0",
"gulp-rename": "^1.2.2",
"gulp-replace": "^0.5.4",
"gulp-uglify": "^1.4.2",
"http-proxy": "^1.12.0",
+ "lodash": "^3.10.1",
"proxy-middleware": "^0.15.0",
"run-sequence": "^1.1.4",
"wiredep": "^3.0.0-beta",
- "wrench": "^1.5.8",
- "gulp-ng-annotate": "^1.1.0",
- "lodash": "^3.10.1",
- "eslint": "^1.8.0",
- "eslint-plugin-angular": "linkmesrl/eslint-plugin-angular",
- "gulp-eslint": "^1.0.0"
+ "wrench": "^1.5.8"
}
}
diff --git a/xos/core/xoslib/dashboards/xosTruckroll.html b/xos/core/xoslib/dashboards/xosTruckroll.html
new file mode 100644
index 0000000..b777e17
--- /dev/null
+++ b/xos/core/xoslib/dashboards/xosTruckroll.html
@@ -0,0 +1,14 @@
+<!-- browserSync -->
+
+<!-- inject:css -->
+<link rel="stylesheet" href="/css/truckroll.css">
+<!-- endinject -->
+
+<div id="xosTruckroll">
+ <div ui-view></div>
+</div>
+
+
+<!-- inject:js -->
+<script src="/static/js/xosTruckroll.js"></script>
+<!-- endinject -->
diff --git a/xos/core/xoslib/static/css/xosTruckroll.css b/xos/core/xoslib/static/css/xosTruckroll.css
new file mode 100644
index 0000000..553215e
--- /dev/null
+++ b/xos/core/xoslib/static/css/xosTruckroll.css
@@ -0,0 +1 @@
+.row+.row{margin-top:20px}.loader{font-size:10px;margin:0 auto;text-indent:-9999em;width:11em;height:11em;border-radius:50%;background:#fff;background:linear-gradient(to right,#fff 10%,rgba(255,255,255,0) 42%);position:relative;animation:load3 1.4s infinite linear;transform:translateZ(0)}.loader:before{width:50%;height:50%;background:#105e9e;border-radius:100% 0 0;position:absolute;top:0;left:0;content:''}.loader:after{background:#fff;width:75%;height:75%;border-radius:50%;content:'';margin:auto;position:absolute;top:0;left:0;bottom:0;right:0}@keyframes load3{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}
\ No newline at end of file
diff --git a/xos/core/xoslib/static/js/xosTruckroll.js b/xos/core/xoslib/static/js/xosTruckroll.js
new file mode 100644
index 0000000..96d021d
--- /dev/null
+++ b/xos/core/xoslib/static/js/xosTruckroll.js
@@ -0,0 +1 @@
+"use strict";angular.module("xos.truckroll",["ngResource","ngCookies","ngLodash","ui.router","xos.helpers"]).config(["$stateProvider",function(l){l.state("user-list",{url:"/",template:"<truckroll></truckroll>"})}]).config(["$httpProvider",function(l){l.interceptors.push("NoHyperlinks")}]).service("Subscribers",["$resource",function(l){return l("/xos/subscribers/:id")}]).service("Truckroll",["$resource",function(l){return l("/xoslib/truckroll/:id")}]).directive("truckroll",function(){return{restrict:"E",scope:{},bindToController:!0,controllerAs:"vm",templateUrl:"templates/truckroll.tpl.html",controller:["$timeout","Subscribers","Truckroll",function(l,n,t){var r=this;n.query().$promise.then(function(l){r.subscribers=l}),this.loader=!1,this.runTest=function(){delete r.truckroll.result;var l=new t(r.truckroll);r.loader=!0,l.$save().then(function(l){r.waitForTest(l.id)})},this.waitForTest=function(n){t.get({id:n}).$promise.then(function(s){s.is_synced?(r.truckroll=angular.copy(s),t["delete"]({id:n}),r.loader=!1):l(function(){r.waitForTest(n)},2e3)})}}]}}),angular.module("xos.truckroll").run(["$templateCache",function(l){l.put("templates/truckroll.tpl.html",'<div class="row">\n <h2>Virtual Truck Roll</h2>\n <p>Use this page to run test against your subscriber</p>\n</div>\n<form ng-submit="vm.runTest()">\n <div class="row">\n <div class="col-xs-12">\n <label>Target:</label>\n </div>\n <div class="col-xs-12">\n <select class="form-control" ng-model="vm.truckroll.target_id" ng-options="s.id as s.humanReadableName for s in vm.subscribers"></select>\n </div>\n </div>\n <div class="row">\n <div class="col-xs-12">\n <label>Scope:</label>\n </div>\n <div class="col-xs-6">\n <a \n ng-click="vm.truckroll.scope = \'container\'"\n ng-class="{\'btn-default\': vm.truckroll.scope !== \'container\', \'btn-primary\': vm.truckroll.scope === \'container\'}"\n class="btn btn-block"\n >\n Container\n </a>\n </div>\n <div class="col-xs-6">\n <a \n ng-click="vm.truckroll.scope = \'vm\'"\n ng-class="{\'btn-default\': vm.truckroll.scope !== \'vm\', \'btn-primary\': vm.truckroll.scope === \'vm\'}"\n class="btn btn-block"\n >\n VM\n </a>\n </div>\n </div>\n <div class="row">\n <div class="col-xs-12">\n <label>Test:</label>\n </div>\n <div class="col-xs-4">\n <a \n ng-click="vm.truckroll.test = \'ping\'"\n ng-class="{\'btn-default\': vm.truckroll.test !== \'ping\', \'btn-primary\': vm.truckroll.test === \'ping\'}"\n class="btn btn-block">Ping</a>\n </div>\n <div class="col-xs-4">\n <a \n ng-click="vm.truckroll.test = \'traceroute\'"\n ng-class="{\'btn-default\': vm.truckroll.test !== \'traceroute\', \'btn-primary\': vm.truckroll.test === \'traceroute\'}"\n class="btn btn-block">Traceroute</a>\n </div>\n <div class="col-xs-4">\n <a \n ng-click="vm.truckroll.test = \'tcpdump\'"\n ng-class="{\'btn-default\': vm.truckroll.test !== \'tcpdump\', \'btn-primary\': vm.truckroll.test === \'tcpdump\'}"\n class="btn btn-block">Tcp Dump</a>\n </div>\n </div>\n <div class="row">\n <div class="col-xs-12">\n <label>Argument:</label>\n </div>\n <div class="col-xs-12">\n <input type="text" class="form-control" ng-model="vm.truckroll.argument"/>\n </div>\n </div>\n <div class="row">\n <div class="col-xs-12" ng-show="!vm.loader">\n <button class="btn btn-success btn-block">Run test</button>\n </div>\n <div class="col-xs-12" ng-show="vm.loader">\n <div class="loader"></div>\n </div>\n </div>\n <div class="row" ng-hide="!vm.truckroll.result">\n <div class="col-xs-12">\n <label>\n Result:\n </label>\n </div>\n <div class="col-xs-12">\n <pre>{{vm.truckroll.result}}</pre>\n </div>\n </div>\n</form>')}]),angular.module("xos.truckroll").run(["$location",function(l){l.path("/")}]),angular.bootstrap(angular.element("#xosTruckroll"),["xos.truckroll"]);
\ No newline at end of file