aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-09-26 15:00:26 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-09-26 15:00:26 +0100
commit394e6929d85b80e511fde2790946b61822b09022 (patch)
treeddb02b7d524684778972f505b2548b852c600def
parent7ea2415383e7c6b9c5d5b19f8e3bf9df74233754 (diff)
downloadyocto-autobuilder2-394e6929d85b80e511fde2790946b61822b09022.tar.gz
yocto-autobuilder2-394e6929d85b80e511fde2790946b61822b09022.tar.bz2
yocto-autobuilder2-394e6929d85b80e511fde2790946b61822b09022.zip
yocto_console_vew: Add link to wiki log
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--yocto_console_view/src/module/main.module.coffee6
-rw-r--r--yocto_console_view/src/module/yoctochangedetails.tpl.jade2
-rw-r--r--yocto_console_view/yocto_console_view/static/scripts.js2
3 files changed, 9 insertions, 1 deletions
diff --git a/yocto_console_view/src/module/main.module.coffee b/yocto_console_view/src/module/main.module.coffee
index 41ea234..7c76c3a 100644
--- a/yocto_console_view/src/module/main.module.coffee
+++ b/yocto_console_view/src/module/main.module.coffee
@@ -316,6 +316,12 @@ class Console extends Controller
change.caption = @branchmapping[build.buildid]
change.revlink = "http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=" + rev
change.errorlink = "http://errors.yoctoproject.org/Errors/Latest/?filter=" + rev + "&type=commit&limit=150"
+ bid = build.buildid
+ if buildset? and buildset.parent_buildid?
+ bid = buildset.parent_buildid
+ if (change.bid? and bid > change.bid) or !change.bid?
+ change.bid = bid
+ change.loglink = "https://wiki.yoctoproject.org/wiki/BuildLog#" + bid
if build.properties?.reason?
change.reason = build.properties.reason[0]
else
diff --git a/yocto_console_view/src/module/yoctochangedetails.tpl.jade b/yocto_console_view/src/module/yoctochangedetails.tpl.jade
index f4e45d8..52befd7 100644
--- a/yocto_console_view/src/module/yoctochangedetails.tpl.jade
+++ b/yocto_console_view/src/module/yoctochangedetails.tpl.jade
@@ -4,6 +4,8 @@ div.yoctochangedetails(style="width:100%;")
| {{ change.caption }} &nbsp;
a(ng-if="change.errorlink", ng-href="{{change.errorlink}}")
| {{ "Errors" }} &nbsp;
+ a(ng-if="change.loglink", ng-href="{{change.loglink}}")
+ | {{ "WikiLog" }} &nbsp;
span(ng-if="!change.revlink", uib-tooltip="{{change.comments}}")
| {{ change.caption }} &nbsp;
span(ng-if="!compact" uib-tooltip="{{change.when_timestamp | dateformat:'LLL'}}")
diff --git a/yocto_console_view/yocto_console_view/static/scripts.js b/yocto_console_view/yocto_console_view/static/scripts.js
index 02aca46..3ce9ece 100644
--- a/yocto_console_view/yocto_console_view/static/scripts.js
+++ b/yocto_console_view/yocto_console_view/static/scripts.js
@@ -1 +1 @@
-BOWERDEPS="undefined"==typeof BOWERDEPS?{}:BOWERDEPS,function(){var e,t,i,n=function(e,t){return function(){return e.apply(t,arguments)}};e=function(){function e(){return["ui.router","ui.bootstrap","ngAnimate","guanlecoja.ui","bbData"]}return e}(),i=function(){function e(e,t,i){var n,l,s;l="console",t.addGroup({name:l,caption:"Yocto Console View",icon:"exclamation-circle",order:5}),n={group:l,caption:"Yocto Console View"},s={controller:l+"Controller",controllerAs:"c",templateUrl:"yocto_console_view/views/"+l+".html",name:l,url:"/"+l,data:n},e.state(s),i.addSettingsGroup({name:"Console",caption:"Console related settings",items:[{type:"integer",name:"buildLimit",caption:"Number of builds to fetch",default_value:200},{type:"integer",name:"changeLimit",caption:"Number of changes to fetch",default_value:30}]})}return e}(),t=function(){function e(e,t,i,l,s,o,a,r){var d,h;this.$scope=e,this.$window=i,this.$uibModal=a,this.$timeout=r,this.makeFakeChange=n(this.makeFakeChange,this),this.matchBuildWithChange=n(this.matchBuildWithChange,this),this._onChange=n(this._onChange,this),this.onChange=n(this.onChange,this),angular.extend(this,o),h=s.getSettingsGroup("Console"),this.buildLimit=h.buildLimit.value,this.changeLimit=h.changeLimit.value,this.dataAccessor=l.open().closeOnDestroy(this.$scope),this._infoIsExpanded={},this.$scope.all_builders=this.all_builders=this.dataAccessor.getBuilders(),this.$scope.builders=this.builders=[],"undefined"!=typeof Intl&&null!==Intl?(d=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"}),this.strcompare=d.compare):this.strcompare=function(e,t){return t>e?-1:e===t?0:1},this.$scope.revmapping=this.revmapping={},this.$scope.branchmapping=this.branchmapping={},this.$scope.builds=this.builds=this.dataAccessor.getBuilds({property:["yp_build_revision","yp_build_branch","reason"],limit:this.buildLimit,order:"-started_at"}),this.changes=this.dataAccessor.getChanges({limit:this.changeLimit,order:"-changeid"}),this.buildrequests=this.dataAccessor.getBuildrequests({limit:this.buildLimit,order:"-submitted_at"}),this.buildsets=this.dataAccessor.getBuildsets({limit:this.buildLimit,order:"-submitted_at"}),this.builds.onChange=this.changes.onChange=this.buildrequests.onChange=this.buildsets.onChange=this.onChange,this.builds.onNew=function(e){return function(t){return t.getProperties().onChange=function(t){var i,n,l,s;return l=!1,n=t.endpoint.split("/")[1],e.revmapping[n]||(s=e.getBuildProperty(t[0],"yp_build_revision"),null!=s&&(e.revmapping[n]=s,l=!0)),e.branchmapping[n]||(i=e.getBuildProperty(t[0],"yp_build_branch"),null!=i&&(e.branchmapping[n]=i,l=!0)),l&&null==e.onchange_debounce?e.onchange_debounce=e.$timeout(e._onChange,100):void 0}}}(this)}return e.prototype.getBuildProperty=function(e,t){var i;return i=e&&e.hasOwnProperty(t),i?e[t][0]:null},e.prototype.onChange=function(e){return 0!==this.builds.length&&0!==this.all_builders.length&&this.changes.$resolved&&0!==this.buildsets.length&&0!==this.buildrequests&&null==this.onchange_debounce?this.onchange_debounce=this.$timeout(this._onChange,100):void 0},e.prototype._onChange=function(){var e,t,i,n,l,s,o,a,r,d,h,c,u,g,p;for(this.onchange_debounce=void 0,d=this.builds,n=0,o=d.length;o>n;n++)e=d[n],this.all_builders.get(e.builderid).hasBuild=!0;for(this.sortBuildersByTags(this.all_builders),this.changesBySSID={},this.changesByRevision={},h=this.changes,l=0,a=h.length;a>l;l++)i=h[l],this.changesBySSID[i.sourcestamp.ssid]=i,this.changesByRevision[i.revision]=i,this.populateChange(i);for(c=this.builds,s=0,r=c.length;r>s;s++)e=c[s],this.matchBuildWithChange(e);this.filtered_changes=[],u=this.changesBySSID,g=[];for(p in u)i=u[p],i.comments&&(i.subject=i.comments.split("\n")[0]),g.push(function(){var e,n,l,s;for(l=i.builders,s=[],n=0,e=l.length;e>n;n++){if(t=l[n],t.builds.length>0){this.filtered_changes.push(i);break}s.push(void 0)}return s}.call(this));return g},e.prototype.sortBuildersByTags=function(e){var t,i,n,l,s,o,a,r,d,h,c,u,g,p,b,f;for(n=[],i="",l=0,a=e.length;a>l;l++)t=e[l],t.hasBuild&&(n.push(t),i+="."+t.builderid);if(i!==this.last_builderids_with_builds){for(p=this._sortBuildersByTags(n),b=[],u=[],c=function(e,t,i){var n,l;if(n=b[e],null==n)n=b[e]=[];else if(l=n[n.length-1],l.tag===t)return void(l.colspan+=i);return n.push({tag:t,colspan:i})},h=this,f=function(e,t){var i,n,l,s,o,a,r;c(t,e.tag,e.builders.length);{if(null!=e.tag_line&&0!==e.tag_line.length){for(a=e.tag_line,r=[],s=0,o=a.length;o>s;s++)i=a[s],r.push(f(i,t+1));return r}for(e.builders.sort(function(e,t){return h.strcompare(e.name,t.name)}),u=u.concat(e.builders),n=l=1;100>=l;n=++l)c(t+n,"",e.builders.length)}},s=0,r=p.length;r>s;s++)g=p[s],f(g,0);for(this.builders=u,this.tag_lines=[],o=0,d=b.length;d>o;o++)p=b[o],(1!==p.length||""!==p[0].tag)&&this.tag_lines.push(p);return this.last_builderids_with_builds=i}},e.prototype._sortBuildersByTags=function(e){var t,i,n,l,s,o,a,r,d,h,c,u,g,p,b,f,m,v,_,y,w,B,C,$,S,k;for(n={},o=0,d=e.length;d>o;o++)if(t=e[o],null!=t.tags)for(y=t.tags,a=0,h=y.length;h>a;a++)$=y[a],null==n[$]&&(n[$]=[]),n[$].push(t);k=[];for($ in n)i=n[$],i.length<e.length&&k.push({tag:$,builders:i});for(k.sort(function(e,t){return t.builders.length-e.builders.length}),S=[],l={},r=0,c=k.length;c>r;r++){for($=k[r],s=!1,w=$.builders,f=0,u=w.length;u>f;f++)if(t=w[f],l.hasOwnProperty(t.builderid)){s=!0;break}if(!s){for(B=$.builders,m=0,g=B.length;g>m;m++)t=B[m],l[t.builderid]=$.tag;S.push($)}}for(C=[],v=0,p=e.length;p>v;v++)t=e[v],l.hasOwnProperty(t.builderid)||C.push(t);if(C.length&&S.push({tag:"",builders:C}),S.length>1)for(_=0,b=S.length;b>_;_++)$=S[_],$.tag_line=this._sortBuildersByTags($.builders);return S},e.prototype.populateChange=function(e){var t,i,n,l,s;for(e.builders=[],e.buildersById={},l=this.builders,s=[],i=0,n=l.length;n>i;i++)t=l[i],t={builderid:t.builderid,name:t.name,builds:[]},e.builders.push(t),s.push(e.buildersById[t.builderid]=t);return s},e.prototype.matchBuildWithChange=function(e){var t,i,n,l,s,o,a,r,d,h,c,u,g;if(t=this.buildrequests.get(e.buildrequestid),null!=t&&(i=this.buildsets.get(t.buildsetid),null!=i)){if(null!=i&&null!=i.sourcestamps)for(a=i.sourcestamps,l=0,s=a.length;s>l;l++)g=a[l],n=this.changesBySSID[g.ssid];return null!=(null!=(r=e.properties)?r.yp_build_revision:void 0)||this.revmapping[e.buildid]?(u=null!=(null!=(d=e.properties)?d.yp_build_revision:void 0)?e.properties.yp_build_revision[0]:this.revmapping[e.buildid],n=this.changesByRevision[u],null==n&&(n=this.changesBySSID[u]),null==n&&(n=this.makeFakeChange(u,e.started_at,u)),null!=i&&null!=i.parent_buildid&&(o="Unresolved "+i.parent_buildid,delete this.changesBySSID[o]),o="Unresolved "+e.builderid+"-"+e.buildid,delete this.changesBySSID[o],n.caption="Commit",null!=(null!=(h=e.properties)?h.yp_build_branch:void 0)&&(n.caption=e.properties.yp_build_branch[0]),this.branchmapping[e.buildid]&&(n.caption=this.branchmapping[e.buildid]),n.revlink="http://git.yoctoproject.org/cgit.cgi/poky/commit/?id="+u,n.errorlink="http://errors.yoctoproject.org/Errors/Latest/?filter="+u+"&type=commit&limit=150",null!=(null!=(c=e.properties)?c.reason:void 0)&&(n.reason=e.properties.reason[0])):(null!=i&&null!=i.parent_buildid&&(u="Unresolved "+i.parent_buildid,null==n&&(n=this.changesBySSID[u]),null==n&&(o="Unresolved "+e.builderid+"-"+e.buildid,delete this.changesBySSID[o],n=this.makeFakeChange(u,e.started_at,u))),null==n&&(u="Unresolved "+e.builderid+"-"+e.buildid,null==n&&(n=this.changesBySSID[u]),null==n&&(n=this.makeFakeChange(u,e.started_at,u))),n.caption=u),n.buildersById[e.builderid].builds.push(e)}},e.prototype.makeFakeChange=function(e,t,i){var n;return n={revision:e,changeid:e,when_timestamp:t,comments:i},this.changesBySSID[e]=n,this.populateChange(n),n},e.prototype.openAll=function(){var e,t,i,n,l;for(n=this.filtered_changes,l=[],t=0,i=n.length;i>t;t++)e=n[t],l.push(e.show_details=!0);return l},e.prototype.closeAll=function(){var e,t,i,n,l;for(n=this.filtered_changes,l=[],t=0,i=n.length;i>t;t++)e=n[t],l.push(e.show_details=!1);return l},e.prototype.getRowHeaderWidth=function(){return this.hasExpanded()?400:200},e.prototype.getColHeaderHeight=function(){var e,t,i,n,l;for(n=0,l=this.builders,t=0,i=l.length;i>t;t++)e=l[t],n=Math.max(e.name.length,n);return Math.max(100,3*n)},e.prototype.isBigTable=function(){var e;return e=this.getRowHeaderWidth(),(this.$window.innerWidth-e)/this.builders.length<40?!0:!1},e.prototype.hasExpanded=function(){var e,t,i,n;for(n=this.changes,t=0,i=n.length;i>t;t++)if(e=n[t],this.infoIsExpanded(e))return!0;return!1},e.prototype.selectBuild=function(e){var t;return t=this.$uibModal.open({templateUrl:"yocto_console_view/views/modal.html",controller:"consoleModalController as modal",windowClass:"modal-big",resolve:{selectedBuild:function(){return e}}})},e.prototype.toggleInfo=function(e){return e.show_details=!e.show_details},e.prototype.infoIsExpanded=function(e){return e.show_details},e}(),angular.module("yocto_console_view",new e).config(["$stateProvider","glMenuServiceProvider","bbSettingsServiceProvider",i]).controller("consoleController",["$scope","$q","$window","dataService","bbSettingsService","resultsService","$uibModal","$timeout",t])}.call(this),function(){var e,t;e=function(){function e(){return{replace:!1,restrict:"E",scope:!1,templateUrl:"yocto_console_view/views/releaseselectorfield.html",controller:"_ReleaseselectorfieldController"}}return e}(),t=function(){function e(e,t){var i,n,l;for(l=e;null!=l&&null==l.rootfield;)l=l.$parent;return null==l?void console.log("rootfield not found!?!?"):(i={},n=function(e){var t,l,s,o;for(o=[],l=0,s=e.length;s>l;l++)t=e[l],null!=t.fields?o.push(n(t.fields)):o.push(i[t.fullName]=t);return o},n(l.rootfield.fields),console.log(i),void e.$watch("field.value",function(t,n){var l,s,o,a;if(o=e.field.selectors[t],null!=o){s=[];for(l in o)a=o[l],console.log(l),s.push(i[l].value=a);return s}}))}return e}(),angular.module("yocto_console_view").directive("releaseselectorfield",[e]).controller("_ReleaseselectorfieldController",["$scope","$http",t])}.call(this),function(){var e;e=function(){function e(){return{replace:!0,restrict:"E",scope:{change:"=",compact:"=?"},templateUrl:"yocto_console_view/views/yoctochangedetails.html"}}return e}(),angular.module("common").directive("yoctochangedetails",[e])}.call(this),function(){var e;e=function(){function e(e,t,i){this.$uibModalInstance=t,this.selectedBuild=i,e.$on("$stateChangeStart",function(e){return function(){return e.close()}}(this))}return e.prototype.close=function(){return this.$uibModalInstance.close()},e}(),angular.module("yocto_console_view").controller("consoleModalController",["$scope","$uibModalInstance","selectedBuild",e])}.call(this),angular.module("yocto_console_view").run(["$templateCache",function(e){e.put("yocto_console_view/views/console.html",'<div class="console no-select"><div class="load-indicator" ng-hide="c.builds.$resolved &amp;&amp; c.changes.$resolved &amp;&amp; c.buildrequests.$resolved &amp;&amp; c.buildsets.$resolved"><div class="spinner"><i class="fa fa-circle-o-notch fa-spin fa-2x"></i><p>loading</p></div></div><div ng-show="c.changes.$resolved &amp;&amp; c.filtered_changes.length==0"><p>No changes. Console view needs changesource to be setup, and<a href="#changes">changes</a>to be in the system.</p></div><table class="table table-striped table-bordered" ng-hide="c.filtered_changes.length==0" ng-class="{\'table-fixedwidth\': c.isBigTable()}"><tr class="first-row"><th class="row-header" ng-style="{\'width\': c.getRowHeaderWidth()}"><i class="fa fa-plus-circle pull-left" ng-click="c.openAll()" uib-tooltip="Open information for all changes" uib-tooltip-placement="right"></i><i class="fa fa-minus-circle pull-left" ng-click="c.closeAll()" uib-tooltip="Close information for all changes" uib-tooltip-placement="right"></i></th><th class="column" ng-repeat="builder in c.builders"><span class="builder" ng-style="{\'margin-top\': c.getColHeaderHeight()}"><a ng-href="#/builders/{{ builder.builderid }}" ng-bind="builder.name"></a></span></th></tr><tr class="tag_row" ng-repeat="tag_line in c.tag_lines"><td class="row-header"></td><td ng-repeat="tag in tag_line" colspan="{{tag.colspan}}"><span uib-tooltip="{{ tag.tag }}" ng-style="{width: tag.colspan*50}">{{tag.tag}}</span></td></tr><tr ng-repeat="change in c.filtered_changes | orderBy: [\'-when_timestamp\'] track by change.changeid"><td><yoctochangedetails change="change"></yoctochangedetails></td><td class="column" ng-repeat="builder in change.builders" title="{{builder.name}}"><a ng-repeat="build in builder.builds | orderBy: [\'number\']"><span class="badge-status" ng-if="build.buildid" ng-class="c.results2class(build, \'pulse\')" ng-click="c.selectBuild(build)">{{ build.number }}</span></a></td></tr></table></div>'),e.put("yocto_console_view/views/releaseselectorfield.html",'<basefield><label class="control-label col-sm-2" for="{{field.name}}">{{field.label}}</label><div class="col-sm-10"><select class="form-control" ng-model="field.value" ng-options="v for v in field.choices"></select></div></basefield>'),e.put("yocto_console_view/views/yoctochangedetails.html",'<div class="yoctochangedetails" style="width:100%;"><div style="width:100%;" ng-click="change.show_details = !change.show_details"><a ng-if="change.revlink" ng-href="{{change.revlink}}" uib-tooltip="{{change.comments}}">{{ change.caption }} &nbsp;</a><a ng-if="change.errorlink" ng-href="{{change.errorlink}}">{{ "Errors" }} &nbsp;</a><span ng-if="!change.revlink" uib-tooltip="{{change.comments}}">{{ change.caption }} &nbsp;</span><span ng-if="!compact" uib-tooltip="{{change.when_timestamp | dateformat:\'LLL\'}}">({{ change.when_timestamp | timeago }}) &nbsp;</span><i class="fa fa-chevron-circle-right rotate clickable" ng-class="{\'fa-rotate-90\':change.show_details}"></i></div><div class="anim-changedetails" ng-show="change.show_details"><table class="table table-striped table-condensed" ng-show="change.show_details"><tr ng-show="change.reason"><td>Reason</td><td>{{ change.reason }}</td></tr><tr ng-show="change.author"><td>Author</td><td>{{ change.author }}</td></tr><tr><td>Date</td><td>{{ change.when_timestamp | dateformat:\'LLL\'}} ({{ change.when_timestamp | timeago }})</td></tr><tr ng-show="change.repository"><td>Repository</td><td>{{ change.repository }}</td></tr><tr ng-show="change.branch"><td>Branch</td><td>{{ change.branch }}</td></tr><tr><td>Revision</td><td> <a ng-if="change.revlink" ng-href="{{change.revlink}}"> {{ change.revision }}</a></td></tr></table><h5>Comment</h5><pre>{{ change.comments }}</pre><h5>Changed files</h5><ul><li ng-repeat="file in change.files">{{file}}</li></ul><p ng-hide="change.files.length">No files</p></div></div>'),e.put("yocto_console_view/views/modal.html",'<!-- Show build summary for the selected build in a modal window--><div class="modal-header"><i class="fa fa-times pull-right" ng-click="modal.close()"></i><h4 class="modal-title">Build summary</h4></div><div class="modal-body"><buildsummary ng-if="modal.selectedBuild" buildid="modal.selectedBuild.buildid"></buildsummary></div>')}]); \ No newline at end of file
+BOWERDEPS="undefined"==typeof BOWERDEPS?{}:BOWERDEPS,function(){var e,t,i,n=function(e,t){return function(){return e.apply(t,arguments)}};e=function(){function e(){return["ui.router","ui.bootstrap","ngAnimate","guanlecoja.ui","bbData"]}return e}(),i=function(){function e(e,t,i){var n,l,s;l="console",t.addGroup({name:l,caption:"Yocto Console View",icon:"exclamation-circle",order:5}),n={group:l,caption:"Yocto Console View"},s={controller:l+"Controller",controllerAs:"c",templateUrl:"yocto_console_view/views/"+l+".html",name:l,url:"/"+l,data:n},e.state(s),i.addSettingsGroup({name:"Console",caption:"Console related settings",items:[{type:"integer",name:"buildLimit",caption:"Number of builds to fetch",default_value:200},{type:"integer",name:"changeLimit",caption:"Number of changes to fetch",default_value:30}]})}return e}(),t=function(){function e(e,t,i,l,s,o,a,r){var d,h;this.$scope=e,this.$window=i,this.$uibModal=a,this.$timeout=r,this.makeFakeChange=n(this.makeFakeChange,this),this.matchBuildWithChange=n(this.matchBuildWithChange,this),this._onChange=n(this._onChange,this),this.onChange=n(this.onChange,this),angular.extend(this,o),h=s.getSettingsGroup("Console"),this.buildLimit=h.buildLimit.value,this.changeLimit=h.changeLimit.value,this.dataAccessor=l.open().closeOnDestroy(this.$scope),this._infoIsExpanded={},this.$scope.all_builders=this.all_builders=this.dataAccessor.getBuilders(),this.$scope.builders=this.builders=[],"undefined"!=typeof Intl&&null!==Intl?(d=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"}),this.strcompare=d.compare):this.strcompare=function(e,t){return t>e?-1:e===t?0:1},this.$scope.revmapping=this.revmapping={},this.$scope.branchmapping=this.branchmapping={},this.$scope.builds=this.builds=this.dataAccessor.getBuilds({property:["yp_build_revision","yp_build_branch","reason"],limit:this.buildLimit,order:"-started_at"}),this.changes=this.dataAccessor.getChanges({limit:this.changeLimit,order:"-changeid"}),this.buildrequests=this.dataAccessor.getBuildrequests({limit:this.buildLimit,order:"-submitted_at"}),this.buildsets=this.dataAccessor.getBuildsets({limit:this.buildLimit,order:"-submitted_at"}),this.builds.onChange=this.changes.onChange=this.buildrequests.onChange=this.buildsets.onChange=this.onChange,this.builds.onNew=function(e){return function(t){return t.getProperties().onChange=function(t){var i,n,l,s;return l=!1,n=t.endpoint.split("/")[1],e.revmapping[n]||(s=e.getBuildProperty(t[0],"yp_build_revision"),null!=s&&(e.revmapping[n]=s,l=!0)),e.branchmapping[n]||(i=e.getBuildProperty(t[0],"yp_build_branch"),null!=i&&(e.branchmapping[n]=i,l=!0)),l&&null==e.onchange_debounce?e.onchange_debounce=e.$timeout(e._onChange,100):void 0}}}(this)}return e.prototype.getBuildProperty=function(e,t){var i;return i=e&&e.hasOwnProperty(t),i?e[t][0]:null},e.prototype.onChange=function(e){return 0!==this.builds.length&&0!==this.all_builders.length&&this.changes.$resolved&&0!==this.buildsets.length&&0!==this.buildrequests&&null==this.onchange_debounce?this.onchange_debounce=this.$timeout(this._onChange,100):void 0},e.prototype._onChange=function(){var e,t,i,n,l,s,o,a,r,d,h,c,u,g,p;for(this.onchange_debounce=void 0,d=this.builds,n=0,o=d.length;o>n;n++)e=d[n],this.all_builders.get(e.builderid).hasBuild=!0;for(this.sortBuildersByTags(this.all_builders),this.changesBySSID={},this.changesByRevision={},h=this.changes,l=0,a=h.length;a>l;l++)i=h[l],this.changesBySSID[i.sourcestamp.ssid]=i,this.changesByRevision[i.revision]=i,this.populateChange(i);for(c=this.builds,s=0,r=c.length;r>s;s++)e=c[s],this.matchBuildWithChange(e);this.filtered_changes=[],u=this.changesBySSID,g=[];for(p in u)i=u[p],i.comments&&(i.subject=i.comments.split("\n")[0]),g.push(function(){var e,n,l,s;for(l=i.builders,s=[],n=0,e=l.length;e>n;n++){if(t=l[n],t.builds.length>0){this.filtered_changes.push(i);break}s.push(void 0)}return s}.call(this));return g},e.prototype.sortBuildersByTags=function(e){var t,i,n,l,s,o,a,r,d,h,c,u,g,p,b,f;for(n=[],i="",l=0,a=e.length;a>l;l++)t=e[l],t.hasBuild&&(n.push(t),i+="."+t.builderid);if(i!==this.last_builderids_with_builds){for(p=this._sortBuildersByTags(n),b=[],u=[],c=function(e,t,i){var n,l;if(n=b[e],null==n)n=b[e]=[];else if(l=n[n.length-1],l.tag===t)return void(l.colspan+=i);return n.push({tag:t,colspan:i})},h=this,f=function(e,t){var i,n,l,s,o,a,r;c(t,e.tag,e.builders.length);{if(null!=e.tag_line&&0!==e.tag_line.length){for(a=e.tag_line,r=[],s=0,o=a.length;o>s;s++)i=a[s],r.push(f(i,t+1));return r}for(e.builders.sort(function(e,t){return h.strcompare(e.name,t.name)}),u=u.concat(e.builders),n=l=1;100>=l;n=++l)c(t+n,"",e.builders.length)}},s=0,r=p.length;r>s;s++)g=p[s],f(g,0);for(this.builders=u,this.tag_lines=[],o=0,d=b.length;d>o;o++)p=b[o],(1!==p.length||""!==p[0].tag)&&this.tag_lines.push(p);return this.last_builderids_with_builds=i}},e.prototype._sortBuildersByTags=function(e){var t,i,n,l,s,o,a,r,d,h,c,u,g,p,b,f,m,v,_,y,w,B,C,k,$,S;for(n={},o=0,d=e.length;d>o;o++)if(t=e[o],null!=t.tags)for(y=t.tags,a=0,h=y.length;h>a;a++)k=y[a],null==n[k]&&(n[k]=[]),n[k].push(t);S=[];for(k in n)i=n[k],i.length<e.length&&S.push({tag:k,builders:i});for(S.sort(function(e,t){return t.builders.length-e.builders.length}),$=[],l={},r=0,c=S.length;c>r;r++){for(k=S[r],s=!1,w=k.builders,f=0,u=w.length;u>f;f++)if(t=w[f],l.hasOwnProperty(t.builderid)){s=!0;break}if(!s){for(B=k.builders,m=0,g=B.length;g>m;m++)t=B[m],l[t.builderid]=k.tag;$.push(k)}}for(C=[],v=0,p=e.length;p>v;v++)t=e[v],l.hasOwnProperty(t.builderid)||C.push(t);if(C.length&&$.push({tag:"",builders:C}),$.length>1)for(_=0,b=$.length;b>_;_++)k=$[_],k.tag_line=this._sortBuildersByTags(k.builders);return $},e.prototype.populateChange=function(e){var t,i,n,l,s;for(e.builders=[],e.buildersById={},l=this.builders,s=[],i=0,n=l.length;n>i;i++)t=l[i],t={builderid:t.builderid,name:t.name,builds:[]},e.builders.push(t),s.push(e.buildersById[t.builderid]=t);return s},e.prototype.matchBuildWithChange=function(e){var t,i,n,l,s,o,a,r,d,h,c,u,g,p;if(i=this.buildrequests.get(e.buildrequestid),null!=i&&(n=this.buildsets.get(i.buildsetid),null!=n)){if(null!=n&&null!=n.sourcestamps)for(r=n.sourcestamps,s=0,o=r.length;o>s;s++)p=r[s],l=this.changesBySSID[p.ssid];return null!=(null!=(d=e.properties)?d.yp_build_revision:void 0)||this.revmapping[e.buildid]?(g=null!=(null!=(h=e.properties)?h.yp_build_revision:void 0)?e.properties.yp_build_revision[0]:this.revmapping[e.buildid],l=this.changesByRevision[g],null==l&&(l=this.changesBySSID[g]),null==l&&(l=this.makeFakeChange(g,e.started_at,g)),null!=n&&null!=n.parent_buildid&&(a="Unresolved "+n.parent_buildid,delete this.changesBySSID[a]),a="Unresolved "+e.builderid+"-"+e.buildid,delete this.changesBySSID[a],l.caption="Commit",null!=(null!=(c=e.properties)?c.yp_build_branch:void 0)&&(l.caption=e.properties.yp_build_branch[0]),this.branchmapping[e.buildid]&&(l.caption=this.branchmapping[e.buildid]),l.revlink="http://git.yoctoproject.org/cgit.cgi/poky/commit/?id="+g,l.errorlink="http://errors.yoctoproject.org/Errors/Latest/?filter="+g+"&type=commit&limit=150",t=e.buildid,null!=n&&null!=n.parent_buildid&&(t=n.parent_buildid),(null!=l.bid&&t>l.bid||null==l.bid)&&(l.bid=t,l.loglink="https://wiki.yoctoproject.org/wiki/BuildLog#"+t),null!=(null!=(u=e.properties)?u.reason:void 0)&&(l.reason=e.properties.reason[0])):(null!=n&&null!=n.parent_buildid&&(g="Unresolved "+n.parent_buildid,null==l&&(l=this.changesBySSID[g]),null==l&&(a="Unresolved "+e.builderid+"-"+e.buildid,delete this.changesBySSID[a],l=this.makeFakeChange(g,e.started_at,g))),null==l&&(g="Unresolved "+e.builderid+"-"+e.buildid,null==l&&(l=this.changesBySSID[g]),null==l&&(l=this.makeFakeChange(g,e.started_at,g))),l.caption=g),l.buildersById[e.builderid].builds.push(e)}},e.prototype.makeFakeChange=function(e,t,i){var n;return n={revision:e,changeid:e,when_timestamp:t,comments:i},this.changesBySSID[e]=n,this.populateChange(n),n},e.prototype.openAll=function(){var e,t,i,n,l;for(n=this.filtered_changes,l=[],t=0,i=n.length;i>t;t++)e=n[t],l.push(e.show_details=!0);return l},e.prototype.closeAll=function(){var e,t,i,n,l;for(n=this.filtered_changes,l=[],t=0,i=n.length;i>t;t++)e=n[t],l.push(e.show_details=!1);return l},e.prototype.getRowHeaderWidth=function(){return this.hasExpanded()?400:200},e.prototype.getColHeaderHeight=function(){var e,t,i,n,l;for(n=0,l=this.builders,t=0,i=l.length;i>t;t++)e=l[t],n=Math.max(e.name.length,n);return Math.max(100,3*n)},e.prototype.isBigTable=function(){var e;return e=this.getRowHeaderWidth(),(this.$window.innerWidth-e)/this.builders.length<40?!0:!1},e.prototype.hasExpanded=function(){var e,t,i,n;for(n=this.changes,t=0,i=n.length;i>t;t++)if(e=n[t],this.infoIsExpanded(e))return!0;return!1},e.prototype.selectBuild=function(e){var t;return t=this.$uibModal.open({templateUrl:"yocto_console_view/views/modal.html",controller:"consoleModalController as modal",windowClass:"modal-big",resolve:{selectedBuild:function(){return e}}})},e.prototype.toggleInfo=function(e){return e.show_details=!e.show_details},e.prototype.infoIsExpanded=function(e){return e.show_details},e}(),angular.module("yocto_console_view",new e).config(["$stateProvider","glMenuServiceProvider","bbSettingsServiceProvider",i]).controller("consoleController",["$scope","$q","$window","dataService","bbSettingsService","resultsService","$uibModal","$timeout",t])}.call(this),function(){var e,t;e=function(){function e(){return{replace:!1,restrict:"E",scope:!1,templateUrl:"yocto_console_view/views/releaseselectorfield.html",controller:"_ReleaseselectorfieldController"}}return e}(),t=function(){function e(e,t){var i,n,l;for(l=e;null!=l&&null==l.rootfield;)l=l.$parent;return null==l?void console.log("rootfield not found!?!?"):(i={},n=function(e){var t,l,s,o;for(o=[],l=0,s=e.length;s>l;l++)t=e[l],null!=t.fields?o.push(n(t.fields)):o.push(i[t.fullName]=t);return o},n(l.rootfield.fields),console.log(i),void e.$watch("field.value",function(t,n){var l,s,o,a;if(o=e.field.selectors[t],null!=o){s=[];for(l in o)a=o[l],console.log(l),s.push(i[l].value=a);return s}}))}return e}(),angular.module("yocto_console_view").directive("releaseselectorfield",[e]).controller("_ReleaseselectorfieldController",["$scope","$http",t])}.call(this),function(){var e;e=function(){function e(){return{replace:!0,restrict:"E",scope:{change:"=",compact:"=?"},templateUrl:"yocto_console_view/views/yoctochangedetails.html"}}return e}(),angular.module("common").directive("yoctochangedetails",[e])}.call(this),function(){var e;e=function(){function e(e,t,i){this.$uibModalInstance=t,this.selectedBuild=i,e.$on("$stateChangeStart",function(e){return function(){return e.close()}}(this))}return e.prototype.close=function(){return this.$uibModalInstance.close()},e}(),angular.module("yocto_console_view").controller("consoleModalController",["$scope","$uibModalInstance","selectedBuild",e])}.call(this),angular.module("yocto_console_view").run(["$templateCache",function(e){e.put("yocto_console_view/views/console.html",'<div class="console no-select"><div class="load-indicator" ng-hide="c.builds.$resolved &amp;&amp; c.changes.$resolved &amp;&amp; c.buildrequests.$resolved &amp;&amp; c.buildsets.$resolved"><div class="spinner"><i class="fa fa-circle-o-notch fa-spin fa-2x"></i><p>loading</p></div></div><div ng-show="c.changes.$resolved &amp;&amp; c.filtered_changes.length==0"><p>No changes. Console view needs changesource to be setup, and<a href="#changes">changes</a>to be in the system.</p></div><table class="table table-striped table-bordered" ng-hide="c.filtered_changes.length==0" ng-class="{\'table-fixedwidth\': c.isBigTable()}"><tr class="first-row"><th class="row-header" ng-style="{\'width\': c.getRowHeaderWidth()}"><i class="fa fa-plus-circle pull-left" ng-click="c.openAll()" uib-tooltip="Open information for all changes" uib-tooltip-placement="right"></i><i class="fa fa-minus-circle pull-left" ng-click="c.closeAll()" uib-tooltip="Close information for all changes" uib-tooltip-placement="right"></i></th><th class="column" ng-repeat="builder in c.builders"><span class="builder" ng-style="{\'margin-top\': c.getColHeaderHeight()}"><a ng-href="#/builders/{{ builder.builderid }}" ng-bind="builder.name"></a></span></th></tr><tr class="tag_row" ng-repeat="tag_line in c.tag_lines"><td class="row-header"></td><td ng-repeat="tag in tag_line" colspan="{{tag.colspan}}"><span uib-tooltip="{{ tag.tag }}" ng-style="{width: tag.colspan*50}">{{tag.tag}}</span></td></tr><tr ng-repeat="change in c.filtered_changes | orderBy: [\'-when_timestamp\'] track by change.changeid"><td><yoctochangedetails change="change"></yoctochangedetails></td><td class="column" ng-repeat="builder in change.builders" title="{{builder.name}}"><a ng-repeat="build in builder.builds | orderBy: [\'number\']"><span class="badge-status" ng-if="build.buildid" ng-class="c.results2class(build, \'pulse\')" ng-click="c.selectBuild(build)">{{ build.number }}</span></a></td></tr></table></div>'),e.put("yocto_console_view/views/releaseselectorfield.html",'<basefield><label class="control-label col-sm-2" for="{{field.name}}">{{field.label}}</label><div class="col-sm-10"><select class="form-control" ng-model="field.value" ng-options="v for v in field.choices"></select></div></basefield>'),e.put("yocto_console_view/views/yoctochangedetails.html",'<div class="yoctochangedetails" style="width:100%;"><div style="width:100%;" ng-click="change.show_details = !change.show_details"><a ng-if="change.revlink" ng-href="{{change.revlink}}" uib-tooltip="{{change.comments}}">{{ change.caption }} &nbsp;</a><a ng-if="change.errorlink" ng-href="{{change.errorlink}}">{{ "Errors" }} &nbsp;</a><a ng-if="change.loglink" ng-href="{{change.loglink}}">{{ "WikiLog" }} &nbsp;</a><span ng-if="!change.revlink" uib-tooltip="{{change.comments}}">{{ change.caption }} &nbsp;</span><span ng-if="!compact" uib-tooltip="{{change.when_timestamp | dateformat:\'LLL\'}}">({{ change.when_timestamp | timeago }}) &nbsp;</span><i class="fa fa-chevron-circle-right rotate clickable" ng-class="{\'fa-rotate-90\':change.show_details}"></i></div><div class="anim-changedetails" ng-show="change.show_details"><table class="table table-striped table-condensed" ng-show="change.show_details"><tr ng-show="change.reason"><td>Reason</td><td>{{ change.reason }}</td></tr><tr ng-show="change.author"><td>Author</td><td>{{ change.author }}</td></tr><tr><td>Date</td><td>{{ change.when_timestamp | dateformat:\'LLL\'}} ({{ change.when_timestamp | timeago }})</td></tr><tr ng-show="change.repository"><td>Repository</td><td>{{ change.repository }}</td></tr><tr ng-show="change.branch"><td>Branch</td><td>{{ change.branch }}</td></tr><tr><td>Revision</td><td> <a ng-if="change.revlink" ng-href="{{change.revlink}}"> {{ change.revision }}</a></td></tr></table><h5>Comment</h5><pre>{{ change.comments }}</pre><h5>Changed files</h5><ul><li ng-repeat="file in change.files">{{file}}</li></ul><p ng-hide="change.files.length">No files</p></div></div>'),e.put("yocto_console_view/views/modal.html",'<!-- Show build summary for the selected build in a modal window--><div class="modal-header"><i class="fa fa-times pull-right" ng-click="modal.close()"></i><h4 class="modal-title">Build summary</h4></div><div class="modal-body"><buildsummary ng-if="modal.selectedBuild" buildid="modal.selectedBuild.buildid"></buildsummary></div>')}]); \ No newline at end of file