Advertisement
Guest User

Untitled

a guest
Jul 6th, 2015
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 KB | None | 0 0
  1. diff --git a/www/base/src/app/common/directives/buildsummary/buildsummary.directive.coffee b/www/base/src/app/common/directives/buildsummary/buildsummary.directive.coffee
  2. index c91373c..d26d66a 100644
  3. --- a/www/base/src/app/common/directives/buildsummary/buildsummary.directive.coffee
  4. +++ b/www/base/src/app/common/directives/buildsummary/buildsummary.directive.coffee
  5. @@ -11,6 +11,8 @@ class Buildsummary extends Directive('common')
  6.  
  7. class _buildsummary extends Controller('common')
  8. constructor: ($scope, buildbotService, resultsService, $urlMatcherFactory, $location) ->
  9. + data = new buildbotService()
  10. +
  11. baseurl = $location.absUrl().split("#")[0]
  12. buildrequestURLMatcher = $urlMatcherFactory.compile(
  13. "#{baseurl}#buildrequests/{buildrequestid:[0-9]+}")
  14. @@ -50,19 +52,22 @@ class _buildsummary extends Controller('common')
  15. $scope.isBuildURL = (url) ->
  16. return buildURLMatcher.exec(url) != null
  17.  
  18. + $scope.$on("$destroy", -> data.close())
  19.  
  20. $scope.$watch 'buildid', (buildid) ->
  21. $scope.buldid = buildid
  22.  
  23. - buildbotService.one('builds', $scope.buildid)
  24. - .bind($scope).then (build) ->
  25. - buildbotService.one('builders', build.builderid).bind($scope)
  26. - build.all('steps').bind $scope,
  27. - onchild: (step) ->
  28. + data.getBuild($scope.buildid)
  29. + .then (build) ->
  30. + $scope.build = build
  31. + data.getBuilder(build.builderid).then (builder) ->
  32. + $scope.builder = builder
  33. + data.getStepsForBuild().then (steps) ->
  34. + $scope.steps = steps
  35. + $scope.steps.onchild (step) ->
  36. $scope.$watch (-> step.complete), ->
  37. step.fulldisplay = step.complete == 0 || step.results > 0
  38. if step.complete
  39. step.duration = step.complete_at - step.started_at
  40. - logs = buildbotService.one("steps", step.stepid).all("logs")
  41. - logs.bind $scope,
  42. - dest: step
  43. + data.getLogsForStep(step.stepid).then (logs) ->
  44. + step.logs = logs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement