Handling errors
diff --git a/views/ngXosViews/truckroll/env/default.js b/views/ngXosViews/truckroll/env/default.js
index 65d9e93..d1e41fd 100644
--- a/views/ngXosViews/truckroll/env/default.js
+++ b/views/ngXosViews/truckroll/env/default.js
@@ -8,6 +8,6 @@
module.exports = {
host: 'http://apt088.apt.emulab.net:9999/',
- xoscsrftoken: 'u5DXeMzOmHEQxrkhdJ1YuX3FefBv7Wtx',
- xossessionid: 'z8wjipgmf90l23bqvij6kuj0nhcbwfpx'
+ xoscsrftoken: 'AcDUMSMLenXesxkAmRRfuDrrcm0nfK2R',
+ xossessionid: 'vpfim02rcpr3fcp4uf37l4ffilavr6x7'
};
diff --git a/views/ngXosViews/truckroll/gulp/build.js b/views/ngXosViews/truckroll/gulp/build.js
index 9cba015..a8c04be 100644
--- a/views/ngXosViews/truckroll/gulp/build.js
+++ b/views/ngXosViews/truckroll/gulp/build.js
@@ -98,7 +98,8 @@
inject(
gulp.src([
options.static + 'js/vendor/xosTruckrollVendor.js',
- options.static + 'js/xosTruckroll.js'
+ options.static + 'js/xosTruckroll.js',
+ options.static + 'css/xosTruckroll.css'
]),
{ignorePath: '/../../../xos/core/xoslib'}
)
diff --git a/views/ngXosViews/truckroll/src/js/main.js b/views/ngXosViews/truckroll/src/js/main.js
index 69c0c4f..6d72b5b 100644
--- a/views/ngXosViews/truckroll/src/js/main.js
+++ b/views/ngXosViews/truckroll/src/js/main.js
@@ -43,6 +43,7 @@
// clean previous tests
delete this.truckroll.result;
delete this.truckroll.is_synced;
+ delete this.truckroll.result_code;
const test = new Truckroll(this.truckroll);
this.loader = true;
diff --git a/views/ngXosViews/truckroll/src/templates/truckroll.tpl.html b/views/ngXosViews/truckroll/src/templates/truckroll.tpl.html
index 9bbdb4c..8f22631 100644
--- a/views/ngXosViews/truckroll/src/templates/truckroll.tpl.html
+++ b/views/ngXosViews/truckroll/src/templates/truckroll.tpl.html
@@ -73,24 +73,22 @@
<div class="loader"></div>
</div>
</div>
- <section ng-hide="!vm.truckroll.is_synced">
- <div class="row" style="margin-top: 20px">
- <div class="col-xs-12" ng-hide="!vm.truckroll.result_code">
- <label>Result Code</label>
- </div>
- <div class="col-xs-12">
- <pre>{{vm.truckroll.result_code}}</pre>
- </div>
+ <div class="row" ng-hide="!vm.truckroll.result_code">
+ <div class="col-xs-12">
+ <label>Result Code</label>
</div>
- <div class="row">
- <div class="col-xs-12">
- <label>
- Result:
- </label>
- </div>
- <div class="col-xs-12" ng-hide="!vm.truckroll.result">
- <pre>{{vm.truckroll.result}}</pre>
- </div>
+ <div class="col-xs-12">
+ <pre>{{vm.truckroll.result_code}}</pre>
</div>
- </section>
+ </div>
+ <div class="row" ng-hide="!vm.truckroll.result">
+ <div class="col-xs-12">
+ <label>
+ Result:
+ </label>
+ </div>
+ <div class="col-xs-12">
+ <pre>{{vm.truckroll.result}}</pre>
+ </div>
+ </div>
</form>
\ No newline at end of file
diff --git a/xos/core/xoslib/static/js/xosTruckroll.js b/xos/core/xoslib/static/js/xosTruckroll.js
index 3c5149e..d080e63 100644
--- a/xos/core/xoslib/static/js/xosTruckroll.js
+++ b/xos/core/xoslib/static/js/xosTruckroll.js
@@ -1 +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,delete r.truckroll.is_synced;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.backend_status.indexOf("2")>=0||s.result_code&&s.result_code.indexOf("2")>=0?(r.truckroll=angular.copy(s),r.loader=!1):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 <section ng-hide="!vm.truckroll.is_synced">\n <div class="row" style="margin-top: 20px">\n <div class="col-xs-12" ng-hide="!vm.truckroll.result_code">\n <label>Result Code</label>\n </div>\n <div class="col-xs-12">\n <pre>{{vm.truckroll.result_code}}</pre>\n </div>\n </div>\n <div class="row">\n <div class="col-xs-12">\n <label>\n Result:\n </label>\n </div>\n <div class="col-xs-12" ng-hide="!vm.truckroll.result">\n <pre>{{vm.truckroll.result}}</pre>\n </div>\n </div>\n </section>\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
+"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,delete r.truckroll.is_synced,delete r.truckroll.result_code;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.backend_status.indexOf("2")>=0||s.result_code&&s.result_code.indexOf("2")>=0?(r.truckroll=angular.copy(s),r.loader=!1):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_code">\n <div class="col-xs-12">\n <label>Result Code</label>\n </div>\n <div class="col-xs-12">\n <pre>{{vm.truckroll.result_code}}</pre>\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