Merge branch 'master' into lp-no-builds
This commit is contained in:
commit
a6f18ab19c
|
@ -11,7 +11,16 @@ LimitConcurrentBuildsComponent = Ember.Component.extend
|
||||||
description
|
description
|
||||||
).property('enabled')
|
).property('enabled')
|
||||||
|
|
||||||
|
limitChanged: ->
|
||||||
|
repo = @get('repo')
|
||||||
|
limit = parseInt(@get('value'))
|
||||||
|
if limit
|
||||||
|
@set('isSaving', true)
|
||||||
|
savingFinished = =>
|
||||||
|
@set('isSaving', false)
|
||||||
|
|
||||||
|
repo.saveSettings(maximum_number_of_builds: limit).
|
||||||
|
then(savingFinished, savingFinished)
|
||||||
actions:
|
actions:
|
||||||
toggle: ->
|
toggle: ->
|
||||||
unless @get('enabled')
|
unless @get('enabled')
|
||||||
|
@ -26,15 +35,6 @@ LimitConcurrentBuildsComponent = Ember.Component.extend
|
||||||
@set('value', 0)
|
@set('value', 0)
|
||||||
|
|
||||||
limitChanged: ->
|
limitChanged: ->
|
||||||
repo = @get('repo')
|
Ember.run.debounce(this, 'limitChanged', 1000)
|
||||||
limit = parseInt(@get('value'))
|
|
||||||
if limit
|
|
||||||
@set('isSaving', true)
|
|
||||||
savingFinished = =>
|
|
||||||
@set('isSaving', false)
|
|
||||||
|
|
||||||
repo.saveSettings(maximum_number_of_builds: limit).
|
|
||||||
then(savingFinished, savingFinished)
|
|
||||||
|
|
||||||
|
|
||||||
`export default LimitConcurrentBuildsComponent`
|
`export default LimitConcurrentBuildsComponent`
|
||||||
|
|
16
app/components/queued-jobs.coffee
Normal file
16
app/components/queued-jobs.coffee
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
`import Ember from 'ember'`
|
||||||
|
`import config from 'travis/config/environment'`
|
||||||
|
|
||||||
|
QueuedJobsComponent = Ember.Component.extend
|
||||||
|
store: Ember.inject.service()
|
||||||
|
|
||||||
|
init: ->
|
||||||
|
@_super.apply this, arguments
|
||||||
|
if !Ember.testing
|
||||||
|
Visibility.every config.intervals.updateTimes, @updateTimes.bind(this)
|
||||||
|
|
||||||
|
updateTimes: ->
|
||||||
|
if jobs = @get('jobs')
|
||||||
|
jobs.forEach (job) -> job.updateTimes()
|
||||||
|
|
||||||
|
`export default QueuedJobsComponent`
|
54
app/components/repo-show-tabs.coffee
Normal file
54
app/components/repo-show-tabs.coffee
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
`import Ember from 'ember'`
|
||||||
|
|
||||||
|
RepoShowTabsComponent = Ember.Component.extend
|
||||||
|
# hrm. how to parametrize bind-attr?
|
||||||
|
classCurrent: (->
|
||||||
|
'active' if @get('tab') == 'current'
|
||||||
|
).property('tab')
|
||||||
|
|
||||||
|
classBuilds: (->
|
||||||
|
'active' if @get('tab') == 'builds'
|
||||||
|
).property('tab')
|
||||||
|
|
||||||
|
classPullRequests: (->
|
||||||
|
'active' if @get('tab') == 'pull_requests'
|
||||||
|
).property('tab')
|
||||||
|
|
||||||
|
classBranches: (->
|
||||||
|
'active' if @get('tab') == 'branches'
|
||||||
|
).property('tab')
|
||||||
|
|
||||||
|
classEvents: (->
|
||||||
|
'active' if @get('tab') == 'events'
|
||||||
|
).property('tab')
|
||||||
|
|
||||||
|
classBuild: (->
|
||||||
|
tab = @get('tab')
|
||||||
|
classes = []
|
||||||
|
classes.push('active') if tab == 'build'
|
||||||
|
classes.push('display-inline') if tab == 'build' || tab == 'job'
|
||||||
|
classes.join(' ')
|
||||||
|
).property('tab')
|
||||||
|
|
||||||
|
# TODO: refactor tabs, most of the things here are not really DRY
|
||||||
|
classJob: (->
|
||||||
|
'active' if @get('tab') == 'job'
|
||||||
|
).property('tab')
|
||||||
|
|
||||||
|
classRequests: (->
|
||||||
|
'active' if @get('tab') == 'requests'
|
||||||
|
).property('tab')
|
||||||
|
|
||||||
|
classCaches: (->
|
||||||
|
'active' if @get('tab') == 'caches'
|
||||||
|
).property('tab')
|
||||||
|
|
||||||
|
classSettings: (->
|
||||||
|
'active' if @get('tab') == 'settings'
|
||||||
|
).property('tab')
|
||||||
|
|
||||||
|
classRequest: (->
|
||||||
|
'active' if @get('tab') == 'request'
|
||||||
|
).property('tab')
|
||||||
|
|
||||||
|
`export default RepoShowTabsComponent`
|
47
app/components/repo-show-tools.coffee
Normal file
47
app/components/repo-show-tools.coffee
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
`import Ember from 'ember'`
|
||||||
|
`import config from 'travis/config/environment'`
|
||||||
|
|
||||||
|
RepoShowToolsComponent = Ember.Component.extend
|
||||||
|
popup: Ember.inject.service()
|
||||||
|
|
||||||
|
click: (event) ->
|
||||||
|
if $(event.target).is('a') && $(event.target).parents('.dropdown-menu').length
|
||||||
|
@closeMenu()
|
||||||
|
|
||||||
|
closeMenu: ->
|
||||||
|
$('.menu').removeClass('display')
|
||||||
|
|
||||||
|
actions:
|
||||||
|
menu: ->
|
||||||
|
@get('popup').close()
|
||||||
|
$('#tools .menu').toggleClass('display')
|
||||||
|
return false
|
||||||
|
|
||||||
|
hasPermission: (->
|
||||||
|
if permissions = @get('currentUser.permissions')
|
||||||
|
permissions.contains parseInt(@get('repo.id'))
|
||||||
|
).property('currentUser.permissions.length', 'repo.id')
|
||||||
|
|
||||||
|
hasPushPermission: (->
|
||||||
|
if permissions = @get('currentUser.pushPermissions')
|
||||||
|
permissions.contains parseInt(@get('repo.id'))
|
||||||
|
).property('currentUser.pushPermissions.length', 'repo.id')
|
||||||
|
|
||||||
|
hasAdminPermission: (->
|
||||||
|
if permissions = @get('currentUser.adminPermissions')
|
||||||
|
permissions.contains parseInt(@get('repo.id'))
|
||||||
|
).property('currentUser.adminPermissions.length', 'repo.id')
|
||||||
|
|
||||||
|
displaySettingsLink: (->
|
||||||
|
@get('hasPushPermission')
|
||||||
|
).property('hasPushPermission')
|
||||||
|
|
||||||
|
displayCachesLink: (->
|
||||||
|
@get('hasPushPermission') && config.endpoints.caches
|
||||||
|
).property('hasPushPermission')
|
||||||
|
|
||||||
|
displayStatusImages: (->
|
||||||
|
@get('hasPermission')
|
||||||
|
).property('hasPermission')
|
||||||
|
|
||||||
|
`export default RepoShowToolsComponent`
|
31
app/components/repos-list-item.coffee
Normal file
31
app/components/repos-list-item.coffee
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
`import Ember from 'ember'`
|
||||||
|
`import Polling from 'travis/mixins/polling'`
|
||||||
|
`import { colorForState } from 'travis/utils/helpers'`
|
||||||
|
|
||||||
|
ReposListItemComponent = Ember.Component.extend Polling,
|
||||||
|
routing: Ember.inject.service('-routing')
|
||||||
|
|
||||||
|
tagName: 'li'
|
||||||
|
|
||||||
|
pollModels: 'repo'
|
||||||
|
|
||||||
|
classNames: ['repo']
|
||||||
|
classNameBindings: ['color', 'selected']
|
||||||
|
selected: (->
|
||||||
|
@get('repo') == @get('selectedRepo')
|
||||||
|
).property('selectedRepo')
|
||||||
|
|
||||||
|
color: (->
|
||||||
|
colorForState(@get('repo.lastBuildState'))
|
||||||
|
).property('repo.lastBuildState')
|
||||||
|
|
||||||
|
scrollTop: (->
|
||||||
|
if (window.scrollY > 0)
|
||||||
|
$('html, body').animate({scrollTop: 0}, 200)
|
||||||
|
)
|
||||||
|
|
||||||
|
click: ->
|
||||||
|
@scrollTop()
|
||||||
|
@get('routing').transitionTo('repo', @get('repo.slug').split('/'))
|
||||||
|
|
||||||
|
`export default ReposListItemComponent`
|
6
app/components/repos-list.coffee
Normal file
6
app/components/repos-list.coffee
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
`import Ember from 'ember'`
|
||||||
|
|
||||||
|
ReposListComponent = Ember.Component.extend
|
||||||
|
tagName: 'ul'
|
||||||
|
|
||||||
|
`export default ReposListComponent`
|
20
app/components/running-jobs.coffee
Normal file
20
app/components/running-jobs.coffee
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
`import Ember from 'ember'`
|
||||||
|
`import Polling from 'travis/mixins/polling'`
|
||||||
|
`import config from 'travis/config/environment'`
|
||||||
|
|
||||||
|
RunningJobsComponent = Ember.Component.extend Polling,
|
||||||
|
store: Ember.inject.service()
|
||||||
|
|
||||||
|
pollHook: (store) ->
|
||||||
|
@get('store').find('job', {})
|
||||||
|
|
||||||
|
init: ->
|
||||||
|
@_super.apply this, arguments
|
||||||
|
if !Ember.testing
|
||||||
|
Visibility.every config.intervals.updateTimes, @updateTimes.bind(this)
|
||||||
|
|
||||||
|
updateTimes: ->
|
||||||
|
if jobs = @get('jobs')
|
||||||
|
jobs.forEach (job) -> job.updateTimes()
|
||||||
|
|
||||||
|
`export default RunningJobsComponent`
|
|
@ -1,21 +1,19 @@
|
||||||
`import Ember from 'ember'`
|
`import Ember from 'ember'`
|
||||||
|
|
||||||
View = Ember.View.extend
|
ShowMoreButtonComponent = Ember.Component.extend
|
||||||
tagName: 'button'
|
tagName: 'button'
|
||||||
classNames: ['button button--grey button--showmore']
|
classNames: ['button button--grey button--showmore']
|
||||||
classNameBindings: ['isLoading', 'showMore']
|
classNameBindings: ['isLoading', 'showMore']
|
||||||
showMore: true
|
showMore: true
|
||||||
attributeBindings: ['disabled']
|
attributeBindings: ['disabled']
|
||||||
isLoadingBinding: 'controller.isLoading'
|
|
||||||
templateName: 'show-more-button'
|
|
||||||
|
|
||||||
disabledBinding: 'isLoading'
|
disabledBinding: 'isLoading'
|
||||||
|
|
||||||
label: (->
|
buttonLabel: (->
|
||||||
if @get('isLoading') then 'Loading' else 'Show more'
|
if @get('isLoading') then 'Loading' else 'Show more'
|
||||||
).property('isLoading')
|
).property('isLoading')
|
||||||
|
|
||||||
click: ->
|
click: ->
|
||||||
@get('controller').showMore()
|
this.attrs.showMore()
|
||||||
|
|
||||||
`export default View`
|
`export default ShowMoreButtonComponent`
|
|
@ -45,5 +45,9 @@ Controller = Ember.ArrayController.extend
|
||||||
|
|
||||||
@store.find('build', options)
|
@store.find('build', options)
|
||||||
|
|
||||||
|
actions:
|
||||||
|
showMoreBuilds: ->
|
||||||
|
@showMore()
|
||||||
|
|
||||||
|
|
||||||
`export default Controller`
|
`export default Controller`
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
`import Ember from 'ember'`
|
|
||||||
|
|
||||||
Controller = Ember.ArrayController.extend
|
|
||||||
isLoaded: false
|
|
||||||
content: (->
|
|
||||||
result = @store.filter('job', {}, (job) ->
|
|
||||||
['created', 'queued'].indexOf(job.get('state')) != -1
|
|
||||||
)
|
|
||||||
result.then =>
|
|
||||||
@set('isLoaded', true)
|
|
||||||
result
|
|
||||||
).property()
|
|
||||||
|
|
||||||
`export default Controller`
|
|
|
@ -2,7 +2,8 @@
|
||||||
`import limit from 'travis/utils/computed-limit'`
|
`import limit from 'travis/utils/computed-limit'`
|
||||||
`import Repo from 'travis/models/repo'`
|
`import Repo from 'travis/models/repo'`
|
||||||
|
|
||||||
Controller = Ember.ArrayController.extend
|
Controller = Ember.Controller.extend
|
||||||
|
contentBinding: 'repos'
|
||||||
actions:
|
actions:
|
||||||
activate: (name) ->
|
activate: (name) ->
|
||||||
@activate(name)
|
@activate(name)
|
||||||
|
@ -29,8 +30,8 @@ Controller = Ember.ArrayController.extend
|
||||||
if @get('tab') == 'owned' && @get('isLoaded') && @get('length') == 0
|
if @get('tab') == 'owned' && @get('isLoaded') && @get('length') == 0
|
||||||
@container.lookup('router:main').send('redirectToGettingStarted')
|
@container.lookup('router:main').send('redirectToGettingStarted')
|
||||||
|
|
||||||
isLoadedBinding: 'content.isLoaded'
|
isLoadedBinding: 'repos.isLoaded'
|
||||||
needs: ['currentUser', 'repo', 'runningJobs', 'queue']
|
needs: ['currentUser', 'repo']
|
||||||
currentUserBinding: 'controllers.currentUser.model'
|
currentUserBinding: 'controllers.currentUser.model'
|
||||||
selectedRepo: (->
|
selectedRepo: (->
|
||||||
# we need to observe also repo.content here, because we use
|
# we need to observe also repo.content here, because we use
|
||||||
|
@ -39,16 +40,37 @@ Controller = Ember.ArrayController.extend
|
||||||
@get('controllers.repo.repo.content') || @get('controllers.repo.repo')
|
@get('controllers.repo.repo.content') || @get('controllers.repo.repo')
|
||||||
).property('controllers.repo.repo', 'controllers.repo.repo.content')
|
).property('controllers.repo.repo', 'controllers.repo.repo.content')
|
||||||
|
|
||||||
startedJobsCount: Ember.computed.alias('controllers.runningJobs.length')
|
startedJobsCount: Ember.computed.alias('runningJobs.length')
|
||||||
allJobsCount: (->
|
allJobsCount: (->
|
||||||
@get('startedJobsCount') + @get('controllers.queue.length')
|
@get('startedJobsCount') + @get('queuedJobs.length')
|
||||||
).property('startedJobsCount', 'controllers.queue.length')
|
).property('startedJobsCount', 'queuedJobs.length')
|
||||||
|
|
||||||
init: ->
|
init: ->
|
||||||
@_super.apply this, arguments
|
@_super.apply this, arguments
|
||||||
if !Ember.testing
|
if !Ember.testing
|
||||||
Visibility.every @config.intervals.updateTimes, @updateTimes.bind(this)
|
Visibility.every @config.intervals.updateTimes, @updateTimes.bind(this)
|
||||||
|
|
||||||
|
runningJobs: (->
|
||||||
|
# TODO: this should also query for received jobs
|
||||||
|
result = @store.filter('job', {}, (job) ->
|
||||||
|
['started', 'received'].indexOf(job.get('state')) != -1
|
||||||
|
)
|
||||||
|
result.set('isLoaded', false)
|
||||||
|
result.then =>
|
||||||
|
result.set('isLoaded', true)
|
||||||
|
result
|
||||||
|
).property()
|
||||||
|
|
||||||
|
queuedJobs: (->
|
||||||
|
result = @get('store').filter('job', {}, (job) ->
|
||||||
|
['created', 'queued'].indexOf(job.get('state')) != -1
|
||||||
|
)
|
||||||
|
result.set('isLoaded', false)
|
||||||
|
result.then =>
|
||||||
|
result.set('isLoaded', true)
|
||||||
|
result
|
||||||
|
).property()
|
||||||
|
|
||||||
recentRepos: (->
|
recentRepos: (->
|
||||||
# I return an empty array here, because we're removing left sidebar, but
|
# I return an empty array here, because we're removing left sidebar, but
|
||||||
# I don't want to refactor too much code (it will be all changed anyway
|
# I don't want to refactor too much code (it will be all changed anyway
|
||||||
|
@ -57,8 +79,8 @@ Controller = Ember.ArrayController.extend
|
||||||
).property()
|
).property()
|
||||||
|
|
||||||
updateTimes: ->
|
updateTimes: ->
|
||||||
if content = @get('content')
|
if repos = @get('repos')
|
||||||
content.forEach (r) -> r.updateTimes()
|
repos.forEach (r) -> r.updateTimes()
|
||||||
|
|
||||||
activate: (tab, params) ->
|
activate: (tab, params) ->
|
||||||
@set('sortProperties', ['sortOrder'])
|
@set('sortProperties', ['sortOrder'])
|
||||||
|
@ -66,7 +88,7 @@ Controller = Ember.ArrayController.extend
|
||||||
this["view_#{tab}".camelize()](params)
|
this["view_#{tab}".camelize()](params)
|
||||||
|
|
||||||
viewOwned: ->
|
viewOwned: ->
|
||||||
@set('content', @get('userRepos'))
|
@set('repos', @get('userRepos'))
|
||||||
|
|
||||||
viewRunning: ->
|
viewRunning: ->
|
||||||
|
|
||||||
|
@ -79,7 +101,7 @@ Controller = Ember.ArrayController.extend
|
||||||
|
|
||||||
viewSearch: (phrase) ->
|
viewSearch: (phrase) ->
|
||||||
@set('search', phrase)
|
@set('search', phrase)
|
||||||
@set('content', Repo.search(@store, phrase))
|
@set('repos', Repo.search(@store, phrase))
|
||||||
|
|
||||||
searchObserver: (->
|
searchObserver: (->
|
||||||
search = @get('search')
|
search = @get('search')
|
||||||
|
|
|
@ -1,24 +0,0 @@
|
||||||
`import Ember from 'ember'`
|
|
||||||
|
|
||||||
Controller = Ember.ArrayController.extend
|
|
||||||
init: ->
|
|
||||||
@_super.apply this, arguments
|
|
||||||
if !Ember.testing
|
|
||||||
Visibility.every @config.intervals.updateTimes, @updateTimes.bind(this)
|
|
||||||
|
|
||||||
updateTimes: ->
|
|
||||||
if content = @get('content')
|
|
||||||
content.forEach (job) -> job.updateTimes()
|
|
||||||
|
|
||||||
isLoaded: false
|
|
||||||
content: (->
|
|
||||||
# TODO: this should also query for received jobs
|
|
||||||
result = @store.filter('job', {}, (job) ->
|
|
||||||
['started', 'received'].indexOf(job.get('state')) != -1
|
|
||||||
)
|
|
||||||
result.then =>
|
|
||||||
@set('isLoaded', true)
|
|
||||||
result
|
|
||||||
).property()
|
|
||||||
|
|
||||||
`export default Controller`
|
|
|
@ -12,15 +12,17 @@ Route = TravisRoute.extend
|
||||||
@controllerFor('repos').activate(@get('reposTabName'))
|
@controllerFor('repos').activate(@get('reposTabName'))
|
||||||
|
|
||||||
@currentRepoDidChange()
|
@currentRepoDidChange()
|
||||||
@controllerFor('repos').addObserver('firstObject', this, 'currentRepoDidChange')
|
if repos = @controllerFor('repos').get('repos')
|
||||||
|
repos.addObserver('firstObject', this, 'currentRepoDidChange')
|
||||||
|
|
||||||
deactivate: ->
|
deactivate: ->
|
||||||
@controllerFor('repos').removeObserver('firstObject', this, 'currentRepoDidChange')
|
if repos = @controllerFor('repos').get('repos')
|
||||||
|
repos.removeObserver('firstObject', this, 'currentRepoDidChange')
|
||||||
|
|
||||||
@_super.apply(this, arguments)
|
@_super.apply(this, arguments)
|
||||||
|
|
||||||
currentRepoDidChange: ->
|
currentRepoDidChange: ->
|
||||||
if repo = @controllerFor('repos').get('firstObject')
|
if repo = @controllerFor('repos').get('repos.firstObject')
|
||||||
@controllerFor('repo').set('repo', repo)
|
@controllerFor('repo').set('repo', repo)
|
||||||
|
|
||||||
actions:
|
actions:
|
||||||
|
|
|
@ -44,21 +44,9 @@ Route = TravisRoute.extend
|
||||||
|
|
||||||
hasPushAccess: ->
|
hasPushAccess: ->
|
||||||
repoId = parseInt @modelFor('repo').get('id')
|
repoId = parseInt @modelFor('repo').get('id')
|
||||||
pushAccess = true
|
|
||||||
|
|
||||||
Ajax.get '/users/permissions', (data) =>
|
@auth.get('currentUser').get('pushPermissions').filter (item) ->
|
||||||
|
item == repoId
|
||||||
admin = data.admin.filter (item) ->
|
|
||||||
return item == repoId
|
|
||||||
push = data.push.filter (item) ->
|
|
||||||
return item == repoId
|
|
||||||
pull = data.pull.filter (item) ->
|
|
||||||
return item == repoId
|
|
||||||
|
|
||||||
if Ember.isEmpty admin && Ember.isEmpty push && !Ember.isEmpty pull
|
|
||||||
pushAccess = false
|
|
||||||
|
|
||||||
pushAccess
|
|
||||||
|
|
||||||
model: () ->
|
model: () ->
|
||||||
return Ember.RSVP.hash({
|
return Ember.RSVP.hash({
|
||||||
|
|
15
app/services/popup.coffee
Normal file
15
app/services/popup.coffee
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
`import Ember from 'ember'`
|
||||||
|
|
||||||
|
PopupService = Ember.Service.extend
|
||||||
|
open: (name) ->
|
||||||
|
@closeAll()
|
||||||
|
name = event?.target?.name || name
|
||||||
|
$("##{name}").toggleClass('display')
|
||||||
|
close: ->
|
||||||
|
if view = Ember.View.currentPopupView
|
||||||
|
view.destroy()
|
||||||
|
Ember.View.currentPopupView = null
|
||||||
|
|
||||||
|
$('.popup').removeClass('display')
|
||||||
|
|
||||||
|
`export default PopupService`
|
|
@ -7,7 +7,7 @@
|
||||||
{{/each}}
|
{{/each}}
|
||||||
{{#if displayShowMoreButton}}
|
{{#if displayShowMoreButton}}
|
||||||
<p>
|
<p>
|
||||||
{{view 'show-more-button'}}
|
{{show-more-button isLoading=isLoading showMore=(action 'showMoreBuilds')}}
|
||||||
{{#if isLoading}}
|
{{#if isLoading}}
|
||||||
{{loading-indicator}}
|
{{loading-indicator}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{{#if isLoaded}}
|
{{#if jobs.isLoaded}}
|
||||||
{{#if length}}
|
{{#if jobs.length}}
|
||||||
{{#each job in controller}}
|
{{#each jobs as |job|}}
|
||||||
<div class="tile tile--sidebar {{job.state}}">
|
<div class="tile tile--sidebar {{job.state}}">
|
||||||
{{#if job.repo.slug}}
|
{{#if job.repo.slug}}
|
||||||
<span class="icon icon--job {{job.state}}"></span>
|
<span class="icon icon--job {{job.state}}"></span>
|
83
app/templates/components/repo-show-tabs.hbs
Normal file
83
app/templates/components/repo-show-tabs.hbs
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
<div class="tabnav" role="tablist">
|
||||||
|
<ul class="tab tabs--main">
|
||||||
|
<li id="tab_current" class={{classCurrent}}>
|
||||||
|
{{#if repo.slug}}
|
||||||
|
{{#link-to "repo" repo current-when="repo.index"}}
|
||||||
|
Current
|
||||||
|
{{/link-to}}
|
||||||
|
{{/if}}
|
||||||
|
</li>
|
||||||
|
<li id="tab_branches" class={{classBranches}}>
|
||||||
|
{{#if repo.slug}}
|
||||||
|
{{#link-to "branches" repo}}
|
||||||
|
Branches
|
||||||
|
{{/link-to}}
|
||||||
|
{{/if}}
|
||||||
|
</li>
|
||||||
|
<li id="tab_builds" class={{classBuilds}}>
|
||||||
|
{{#if repo.slug}}
|
||||||
|
{{#link-to "builds" repo}}
|
||||||
|
Build History
|
||||||
|
{{/link-to}}
|
||||||
|
{{/if}}
|
||||||
|
</li>
|
||||||
|
<li id="tab_pull_requests" class={{classPullRequests}}>
|
||||||
|
{{#if repo.slug}}
|
||||||
|
{{#link-to "pullRequests" repo}}
|
||||||
|
Pull Requests
|
||||||
|
{{/link-to}}
|
||||||
|
{{/if}}
|
||||||
|
</li>
|
||||||
|
<li id="tab_build" class={{classBuild}}>
|
||||||
|
{{#if build.id}}
|
||||||
|
{{#if repo.slug}}
|
||||||
|
{{#link-to "build" repo build}}
|
||||||
|
Build #{{build.number}}
|
||||||
|
{{/link-to}}
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
</li>
|
||||||
|
<li id="tab_job" class={{classJob}}>
|
||||||
|
{{#if job.id}}
|
||||||
|
{{#if repo.slug}}
|
||||||
|
{{#link-to "job" repo job}}
|
||||||
|
Job #{{job.number}}
|
||||||
|
{{/link-to}}
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
</li>
|
||||||
|
<li id="tab_settings" class={{classSettings}}>
|
||||||
|
{{#if repo.slug}}
|
||||||
|
{{#link-to "settings" repo}}
|
||||||
|
Settings
|
||||||
|
{{/link-to}}
|
||||||
|
{{/if}}
|
||||||
|
</li>
|
||||||
|
<li id="tab_requests" class="{{classRequests}}">
|
||||||
|
{{#if repo.slug}}
|
||||||
|
{{#link-to "requests" repo}}
|
||||||
|
Requests
|
||||||
|
{{/link-to}}
|
||||||
|
{{/if}}
|
||||||
|
</li>
|
||||||
|
{{#if config.caches_enabled}}
|
||||||
|
<li id="tab_caches" class={{classCaches}}>
|
||||||
|
{{#if repo.slug}}
|
||||||
|
{{#link-to "caches" repo}}
|
||||||
|
Caches
|
||||||
|
{{/link-to}}
|
||||||
|
{{/if}}
|
||||||
|
</li>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
<li id="tab_request" class={{classRequest}}>
|
||||||
|
{{#if request.id}}
|
||||||
|
{{#if repo.slug}}
|
||||||
|
{{#link-to "request" repo request}}
|
||||||
|
Request #{{request.id}}
|
||||||
|
{{/link-to}}
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
18
app/templates/components/repo-show-tools.hbs
Normal file
18
app/templates/components/repo-show-tools.hbs
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<div class="dropdown dropdown--classic" id="tools">
|
||||||
|
<a href="#" {{action "menu"}} class="menu-popup-button dropdown-button btn" type=""><span class="icon icon-cog-light"></span> Settings <span class="icon icon-arrow-down"></span></a>
|
||||||
|
<ul class="dropdown-menu menu">
|
||||||
|
{{#if displaySettingsLink}}
|
||||||
|
<li>
|
||||||
|
{{#link-to "settings" repo}}Settings{{/link-to}}
|
||||||
|
</li>
|
||||||
|
{{/if}}
|
||||||
|
<li>
|
||||||
|
{{#link-to "requests" repo}}Requests{{/link-to}}
|
||||||
|
</li>
|
||||||
|
{{#if displayCachesLink}}
|
||||||
|
<li>
|
||||||
|
{{#link-to "caches" repo}}Caches{{/link-to}}
|
||||||
|
</li>
|
||||||
|
{{/if}}
|
||||||
|
</ul>
|
||||||
|
</div>
|
35
app/templates/components/repos-list-item.hbs
Normal file
35
app/templates/components/repos-list-item.hbs
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
<div class="tile tile--sidebar {{repo.lastBuildState}}">
|
||||||
|
<h2 class="tile-title">
|
||||||
|
{{#if repo.slug}}
|
||||||
|
<span class="icon icon--job {{repo.lastBuildState}}"></span>
|
||||||
|
{{#link-to "repo" repo class="slug"}}{{repo.slug}}{{/link-to}}
|
||||||
|
{{/if}}
|
||||||
|
</h2>
|
||||||
|
{{#with repo.lastBuildHash as lastBuild}}
|
||||||
|
{{#if repo.slug}}
|
||||||
|
{{#if lastBuild.id}}
|
||||||
|
<p class="tile-title float-right">
|
||||||
|
<span class="icon icon--hash"></span>
|
||||||
|
{{#link-to "build" repo lastBuild.id
|
||||||
|
class="last_build"}}{{lastBuild.number}}{{/link-to}}
|
||||||
|
</p>
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
{{/with}}
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<span class="icon icon--clock"></span>
|
||||||
|
Duration:
|
||||||
|
<abbr class="duration" title={{lastBuildStartedAt}}>
|
||||||
|
{{format-duration repo.lastBuildDuration}}
|
||||||
|
</abbr>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<span class="icon icon--cal"></span>
|
||||||
|
Finished:
|
||||||
|
<abbr class="finished_at timeago" title={{lastBuildFinishedAt}}>
|
||||||
|
{{format-time repo.lastBuildFinishedAt}}
|
||||||
|
</abbr>
|
||||||
|
</p>
|
||||||
|
</div>
|
7
app/templates/components/repos-list.hbs
Normal file
7
app/templates/components/repos-list.hbs
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{{#each repos as |repo|}}
|
||||||
|
{{repos-list-item repo=repo selectedRepo=selectedRepo}}
|
||||||
|
{{else}}
|
||||||
|
<p class="empty">{{noReposMessage}}</p>
|
||||||
|
{{/each}}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{{#if isLoaded}}
|
{{#if jobs.isLoaded}}
|
||||||
{{#if controller.length}}
|
{{#if jobs.length}}
|
||||||
{{#each job in controller}}
|
{{#each jobs as |job| }}
|
||||||
<div class="tile tile--sidebar {{job.state}}">
|
<div class="tile tile--sidebar {{job.state}}">
|
||||||
{{#if job.repo.slug}}
|
{{#if job.repo.slug}}
|
||||||
<span class="icon icon--job {{job.state}}"></span>
|
<span class="icon icon--job {{job.state}}"></span>
|
1
app/templates/components/show-more-button.hbs
Normal file
1
app/templates/components/show-more-button.hbs
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<span class="icon icon--eye"></span>{{buttonLabel}}
|
|
@ -18,9 +18,9 @@
|
||||||
</header>
|
</header>
|
||||||
<div class="repo-menus">
|
<div class="repo-menus">
|
||||||
<div class="repo-menu-header">
|
<div class="repo-menu-header">
|
||||||
{{view 'repo-show-tools'}}
|
{{repo-show-tools repo=repo build=build job=job tab=tab currentUser=auth.currentUser}}
|
||||||
|
|
||||||
{{view 'repo-show-tabs'}}
|
{{repo-show-tabs repo=repo tab=tab}}
|
||||||
</div>
|
</div>
|
||||||
<div class="tabbody repo-main">
|
<div class="tabbody repo-main">
|
||||||
{{#if repo.active}}
|
{{#if repo.active}}
|
||||||
|
|
|
@ -9,60 +9,17 @@
|
||||||
{{#if showRunningJobs}}
|
{{#if showRunningJobs}}
|
||||||
<div class="tabbody sidebar-list">
|
<div class="tabbody sidebar-list">
|
||||||
<div>
|
<div>
|
||||||
{{render "runningJobs"}}
|
{{running-jobs jobs=runningJobs}}
|
||||||
</div>
|
</div>
|
||||||
<hr class="sidebar-seperator">
|
<hr class="sidebar-seperator">
|
||||||
<div>
|
<div>
|
||||||
{{render "queue"}}
|
{{queued-jobs jobs=queuedJobs}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
<div class="tabbody sidebar-list">
|
<div class="tabbody sidebar-list">
|
||||||
{{#if isLoaded}}
|
{{#if isLoaded}}
|
||||||
{{#collection 'repos-list' content=this}}
|
{{repos-list repos=repos selectedRepo=selectedRepo}}
|
||||||
|
|
||||||
{{#with view.repo as repo}}
|
|
||||||
<div class="tile tile--sidebar {{repo.lastBuildState}}">
|
|
||||||
<h2 class="tile-title">
|
|
||||||
{{#if repo.slug}}
|
|
||||||
<span class="icon icon--job {{repo.lastBuildState}}"></span>
|
|
||||||
{{#link-to "repo" repo class="slug"}}{{repo.slug}}{{/link-to}}
|
|
||||||
{{/if}}
|
|
||||||
</h2>
|
|
||||||
{{#with repo.lastBuildHash as lastBuild}}
|
|
||||||
{{#if repo.slug}}
|
|
||||||
{{#if lastBuild.id}}
|
|
||||||
<p class="tile-title float-right">
|
|
||||||
<span class="icon icon--hash"></span>
|
|
||||||
{{#link-to "build" repo lastBuild.id
|
|
||||||
class="last_build"}}{{lastBuild.number}}{{/link-to}}
|
|
||||||
</p>
|
|
||||||
{{/if}}
|
|
||||||
{{/if}}
|
|
||||||
{{/with}}
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<span class="icon icon--clock"></span>
|
|
||||||
Duration:
|
|
||||||
<abbr class="duration" title={{lastBuildStartedAt}}>
|
|
||||||
{{format-duration repo.lastBuildDuration}}
|
|
||||||
</abbr>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<span class="icon icon--cal"></span>
|
|
||||||
Finished:
|
|
||||||
<abbr class="finished_at timeago" title={{lastBuildFinishedAt}}>
|
|
||||||
{{format-time repo.lastBuildFinishedAt}}
|
|
||||||
</abbr>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
{{/with}}
|
|
||||||
|
|
||||||
{{else}}
|
|
||||||
<p class="empty">{{noReposMessage}}</p>
|
|
||||||
{{/collection}}
|
|
||||||
|
|
||||||
{{else}}
|
{{else}}
|
||||||
{{loading-indicator center=true}}
|
{{loading-indicator center=true}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
@ -1,83 +1 @@
|
||||||
<div class="tabnav" role="tablist">
|
|
||||||
<ul class="tab tabs--main">
|
|
||||||
<li id="tab_current" class={{view.classCurrent}}>
|
|
||||||
{{#if repo.slug}}
|
|
||||||
{{#link-to "repo" repo current-when="repo.index"}}
|
|
||||||
Current
|
|
||||||
{{/link-to}}
|
|
||||||
{{/if}}
|
|
||||||
</li>
|
|
||||||
<li id="tab_branches" class={{view.classBranches}}>
|
|
||||||
{{#if repo.slug}}
|
|
||||||
{{#link-to "branches" repo}}
|
|
||||||
Branches
|
|
||||||
{{/link-to}}
|
|
||||||
{{/if}}
|
|
||||||
</li>
|
|
||||||
<li id="tab_builds" class={{view.classBuilds}}>
|
|
||||||
{{#if repo.slug}}
|
|
||||||
{{#link-to "builds" repo}}
|
|
||||||
Build History
|
|
||||||
{{/link-to}}
|
|
||||||
{{/if}}
|
|
||||||
</li>
|
|
||||||
<li id="tab_pull_requests" class={{view.classPullRequests}}>
|
|
||||||
{{#if repo.slug}}
|
|
||||||
{{#link-to "pullRequests" repo}}
|
|
||||||
Pull Requests
|
|
||||||
{{/link-to}}
|
|
||||||
{{/if}}
|
|
||||||
</li>
|
|
||||||
<li id="tab_build" class={{view.classBuild}}>
|
|
||||||
{{#if build.id}}
|
|
||||||
{{#if repo.slug}}
|
|
||||||
{{#link-to "build" repo build}}
|
|
||||||
Build #{{build.number}}
|
|
||||||
{{/link-to}}
|
|
||||||
{{/if}}
|
|
||||||
{{/if}}
|
|
||||||
</li>
|
|
||||||
<li id="tab_job" class={{view.classJob}}>
|
|
||||||
{{#if job.id}}
|
|
||||||
{{#if repo.slug}}
|
|
||||||
{{#link-to "job" repo job}}
|
|
||||||
Job #{{job.number}}
|
|
||||||
{{/link-to}}
|
|
||||||
{{/if}}
|
|
||||||
{{/if}}
|
|
||||||
</li>
|
|
||||||
<li id="tab_settings" class={{view.classSettings}}>
|
|
||||||
{{#if repo.slug}}
|
|
||||||
{{#link-to "settings" repo}}
|
|
||||||
Settings
|
|
||||||
{{/link-to}}
|
|
||||||
{{/if}}
|
|
||||||
</li>
|
|
||||||
<li id="tab_requests" class="{{view.classRequests}}">
|
|
||||||
{{#if repo.slug}}
|
|
||||||
{{#link-to "requests" repo}}
|
|
||||||
Requests
|
|
||||||
{{/link-to}}
|
|
||||||
{{/if}}
|
|
||||||
</li>
|
|
||||||
{{#if config.caches_enabled}}
|
|
||||||
<li id="tab_caches" class={{view.classCaches}}>
|
|
||||||
{{#if repo.slug}}
|
|
||||||
{{#link-to "caches" repo}}
|
|
||||||
Caches
|
|
||||||
{{/link-to}}
|
|
||||||
{{/if}}
|
|
||||||
</li>
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
<li id="tab_request" class={{view.classRequest}}>
|
|
||||||
{{#if request.id}}
|
|
||||||
{{#if repo.slug}}
|
|
||||||
{{#link-to "request" repo request}}
|
|
||||||
Request #{{request.id}}
|
|
||||||
{{/link-to}}
|
|
||||||
{{/if}}
|
|
||||||
{{/if}}
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
|
@ -1,47 +1 @@
|
||||||
<div class="dropdown dropdown--classic" id="tools">
|
|
||||||
<a href="#" {{action "menu" target=view}} class="menu-popup-button dropdown-button btn" type=""><span class="icon icon-cog-light"></span> Settings <span class="icon icon-arrow-down"></span></a>
|
|
||||||
<ul class="dropdown-menu menu">
|
|
||||||
|
|
||||||
{{#if view.displaySettingsLink}}
|
|
||||||
<li>
|
|
||||||
{{#link-to "settings" view.repo}}Settings{{/link-to}}
|
|
||||||
</li>
|
|
||||||
{{/if}}
|
|
||||||
<li>
|
|
||||||
{{#link-to "requests" view.repo}}Requests{{/link-to}}
|
|
||||||
</li>
|
|
||||||
{{#if view.displayCachesLink}}
|
|
||||||
<li>
|
|
||||||
{{#link-to "caches" view.repo}}Caches{{/link-to}}
|
|
||||||
</li>
|
|
||||||
{{/if}}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="regenerate-key" class="popup">
|
|
||||||
<a href="#" class="close" {{action "popupClose" target=view}}></a>
|
|
||||||
<p>
|
|
||||||
Do you really want to regenerate ssl keys for this repository? Please note that
|
|
||||||
any data, which is encrypted, such as notification services credentials or secure
|
|
||||||
environment variables will not be accessible during the builds until you re-encrypt
|
|
||||||
it with the new key.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<a class="sync_now button" {{action "regenerateKey" target=view}}>Yes, do it!</a>
|
|
||||||
<span class="or">or</span>
|
|
||||||
<a href="#" class="cancel" {{action "popupClose" target=view}}>Cancel</a>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="regeneration-success" class="popup">
|
|
||||||
<a href="#" class="close" {{action "popupClose" target=view}}></a>
|
|
||||||
<p>
|
|
||||||
Key for this repository has been regenerated. If you used previous key
|
|
||||||
for encryption, you will need encrypt your data again with the new key.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
You can read more about encryption keys <a href="http://about.travis-ci.org/docs/user/encryption-keys/">in Travis documentation</a>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
<span class="icon icon--eye"></span>{{view.label}}
|
|
|
@ -12,13 +12,6 @@ TravisPusher.prototype.init = (config) ->
|
||||||
Pusher.host = config.host if config.host
|
Pusher.host = config.host if config.host
|
||||||
@pusher = new Pusher(config.key, encrypted: config.encrypted, disableStats: true)
|
@pusher = new Pusher(config.key, encrypted: config.encrypted, disableStats: true)
|
||||||
|
|
||||||
@callbacksToProcess = []
|
|
||||||
|
|
||||||
Visibility.change (e, state) =>
|
|
||||||
@processSavedCallbacks() if state == 'visible'
|
|
||||||
|
|
||||||
setInterval @processSavedCallbacks.bind(this), @processingIntervalWhenHidden
|
|
||||||
|
|
||||||
TravisPusher.prototype.subscribeAll = (channels) ->
|
TravisPusher.prototype.subscribeAll = (channels) ->
|
||||||
@subscribe(channel) for channel in channels
|
@subscribe(channel) for channel in channels
|
||||||
|
|
||||||
|
@ -44,35 +37,18 @@ TravisPusher.prototype.prefix = (channel) ->
|
||||||
else
|
else
|
||||||
channel
|
channel
|
||||||
|
|
||||||
# process pusher messages in batches every 5 minutes when the page is hidden
|
|
||||||
TravisPusher.prototype.processingIntervalWhenHidden = 1000 * 60 * 5
|
|
||||||
|
|
||||||
TravisPusher.prototype.receive = (event, data) ->
|
TravisPusher.prototype.receive = (event, data) ->
|
||||||
return if event.substr(0, 6) == 'pusher'
|
return if event.substr(0, 6) == 'pusher'
|
||||||
data = @normalize(event, data) if data.id
|
data = @normalize(event, data) if data.id
|
||||||
|
|
||||||
@processWhenVisible =>
|
# TODO remove job:requeued, once sf-restart-event has been merged
|
||||||
# TODO remove job:requeued, once sf-restart-event has been merged
|
# TODO this also needs to clear logs on build:created if matrix jobs are already loaded
|
||||||
# TODO this also needs to clear logs on build:created if matrix jobs are already loaded
|
if event == 'job:created' || event == 'job:requeued'
|
||||||
if event == 'job:created' || event == 'job:requeued'
|
if job = @store.getById('job', data.job.id)
|
||||||
if job = @store.getById('job', data.job.id)
|
job.clearLog()
|
||||||
job.clearLog()
|
|
||||||
|
|
||||||
Ember.run.next =>
|
Ember.run.next =>
|
||||||
@store.receivePusherEvent(event, data)
|
@store.receivePusherEvent(event, data)
|
||||||
|
|
||||||
TravisPusher.prototype.processSavedCallbacks = ->
|
|
||||||
while callback = @callbacksToProcess.shiftObject()
|
|
||||||
callback.call(this)
|
|
||||||
|
|
||||||
TravisPusher.prototype.processLater = (callback) ->
|
|
||||||
@callbacksToProcess.pushObject(callback)
|
|
||||||
|
|
||||||
TravisPusher.prototype.processWhenVisible = (callback) ->
|
|
||||||
if Visibility.hidden() && Visibility.isSupported()
|
|
||||||
@processLater(callback)
|
|
||||||
else
|
|
||||||
callback.call(this)
|
|
||||||
|
|
||||||
TravisPusher.prototype.normalize = (event, data) ->
|
TravisPusher.prototype.normalize = (event, data) ->
|
||||||
switch event
|
switch event
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
`import BasicView from 'travis/views/basic'`
|
`import BasicView from 'travis/views/basic'`
|
||||||
|
|
||||||
View = BasicView.extend
|
View = BasicView.extend
|
||||||
|
popup: Ember.inject.service()
|
||||||
|
|
||||||
classNames: ['application']
|
classNames: ['application']
|
||||||
click: (event) ->
|
click: (event) ->
|
||||||
# TODO: this solves the case of closing menus and popups,
|
# TODO: this solves the case of closing menus and popups,
|
||||||
|
@ -8,7 +10,7 @@ View = BasicView.extend
|
||||||
# yet, but this does not seem optimal
|
# yet, but this does not seem optimal
|
||||||
targetAndParents = $(event.target).parents().andSelf()
|
targetAndParents = $(event.target).parents().andSelf()
|
||||||
if ! ( targetAndParents.hasClass('open-popup') || targetAndParents.hasClass('popup') )
|
if ! ( targetAndParents.hasClass('open-popup') || targetAndParents.hasClass('popup') )
|
||||||
@popupCloseAll()
|
@get('popup').close()
|
||||||
|
|
||||||
# TODO: I needed to add second check to this conditional, because for some reason
|
# TODO: I needed to add second check to this conditional, because for some reason
|
||||||
# event.stopPropagation() in menu() function in RepoShowToolsView does
|
# event.stopPropagation() in menu() function in RepoShowToolsView does
|
||||||
|
|
|
@ -1,21 +1,5 @@
|
||||||
`import Ember from 'ember'`
|
`import Ember from 'ember'`
|
||||||
|
|
||||||
View = Ember.View.extend
|
View = Ember.View.extend()
|
||||||
actions:
|
|
||||||
popup: (name) -> @popup(name)
|
|
||||||
popupClose: -> @popupClose()
|
|
||||||
|
|
||||||
popup: (name) ->
|
|
||||||
@popupCloseAll()
|
|
||||||
name = event?.target?.name || name
|
|
||||||
$("##{name}").toggleClass('display')
|
|
||||||
popupClose: ->
|
|
||||||
$('.popup').removeClass('display')
|
|
||||||
popupCloseAll: ->
|
|
||||||
if view = Ember.View.currentPopupView
|
|
||||||
view.destroy()
|
|
||||||
Ember.View.currentPopupView = null
|
|
||||||
|
|
||||||
$('.popup').removeClass('display')
|
|
||||||
|
|
||||||
`export default View`
|
`export default View`
|
||||||
|
|
|
@ -42,6 +42,8 @@ Object.defineProperty Log.Limit.prototype, 'limited',
|
||||||
@count >= @max_lines
|
@count >= @max_lines
|
||||||
|
|
||||||
View = BasicView.extend
|
View = BasicView.extend
|
||||||
|
popup: Ember.inject.service()
|
||||||
|
|
||||||
templateName: 'jobs/pre'
|
templateName: 'jobs/pre'
|
||||||
currentUserBinding: 'controller.auth.currentUser'
|
currentUserBinding: 'controller.auth.currentUser'
|
||||||
|
|
||||||
|
@ -60,15 +62,18 @@ View = BasicView.extend
|
||||||
@teardownLog()
|
@teardownLog()
|
||||||
|
|
||||||
versionDidChange: (->
|
versionDidChange: (->
|
||||||
@rerender() if @get('_state') == 'inDOM'
|
this.$('#log').empty()
|
||||||
|
@teardownLog()
|
||||||
|
@createEngine()
|
||||||
).observes('log.version')
|
).observes('log.version')
|
||||||
|
|
||||||
logDidChange: (->
|
logDidChange: (->
|
||||||
console.log 'log view: log did change: rerender' if Log.DEBUG
|
console.log 'log view: log did change: rerender' if Log.DEBUG
|
||||||
|
|
||||||
|
this.$('#log').empty()
|
||||||
|
@teardownLog()
|
||||||
if @get('log')
|
if @get('log')
|
||||||
@createEngine()
|
@createEngine()
|
||||||
@rerender() if @get('_state') == 'inDOM'
|
|
||||||
).observes('log')
|
).observes('log')
|
||||||
|
|
||||||
teardownLog: ->
|
teardownLog: ->
|
||||||
|
@ -144,7 +149,7 @@ View = BasicView.extend
|
||||||
|
|
||||||
removeLogPopup: ->
|
removeLogPopup: ->
|
||||||
if @get('canRemoveLog')
|
if @get('canRemoveLog')
|
||||||
@popup('remove-log-popup')
|
@get('popup').open('remove-log-popup')
|
||||||
return false
|
return false
|
||||||
|
|
||||||
noop: -> # TODO required?
|
noop: -> # TODO required?
|
||||||
|
|
|
@ -1,84 +0,0 @@
|
||||||
`import Ember from 'ember'`
|
|
||||||
`import BasicView from 'travis/views/basic'`
|
|
||||||
`import config from 'travis/config/environment'`
|
|
||||||
|
|
||||||
View = BasicView.extend
|
|
||||||
templateName: 'repos/show/tools'
|
|
||||||
|
|
||||||
repoBinding: 'controller.repo'
|
|
||||||
buildBinding: 'controller.build'
|
|
||||||
jobBinding: 'controller.job'
|
|
||||||
tabBinding: 'controller.tab'
|
|
||||||
currentUserBinding: 'controller.auth.currentUser'
|
|
||||||
slugBinding: 'controller.repo.slug'
|
|
||||||
|
|
||||||
|
|
||||||
didInsertElement: ->
|
|
||||||
self = this
|
|
||||||
$('.menu a').on 'click', ->
|
|
||||||
self.closeMenu()
|
|
||||||
|
|
||||||
willRemoveElement: ->
|
|
||||||
$('.menu a').off 'click'
|
|
||||||
|
|
||||||
closeMenu: ->
|
|
||||||
$('.menu').removeClass('display')
|
|
||||||
|
|
||||||
actions:
|
|
||||||
menu: ->
|
|
||||||
@popupCloseAll()
|
|
||||||
$('#tools .menu').toggleClass('display')
|
|
||||||
return false
|
|
||||||
|
|
||||||
regenerateKeyPopup: ->
|
|
||||||
if @get('canRegenerateKey')
|
|
||||||
@set('active', true)
|
|
||||||
@closeMenu()
|
|
||||||
@popup('regenerate-key-popup')
|
|
||||||
return false
|
|
||||||
|
|
||||||
regenerateKey: ->
|
|
||||||
@popupCloseAll()
|
|
||||||
|
|
||||||
(@get('repo.content') || @get('repo')).regenerateKey
|
|
||||||
success: =>
|
|
||||||
@popup('regeneration-success')
|
|
||||||
error: ->
|
|
||||||
Travis.lookup('controller:flash').loadFlashes([{ error: 'Travis encountered an error while trying to regenerate the key, please try again.'}])
|
|
||||||
|
|
||||||
canRegenerateKey: (->
|
|
||||||
@get('hasAdminPermission')
|
|
||||||
).property('hasAdminPermission')
|
|
||||||
|
|
||||||
hasPermission: (->
|
|
||||||
if permissions = @get('currentUser.permissions')
|
|
||||||
permissions.contains parseInt(@get('repo.id'))
|
|
||||||
).property('currentUser.permissions.length', 'repo.id')
|
|
||||||
|
|
||||||
hasPushPermission: (->
|
|
||||||
if permissions = @get('currentUser.pushPermissions')
|
|
||||||
permissions.contains parseInt(@get('repo.id'))
|
|
||||||
).property('currentUser.pushPermissions.length', 'repo.id')
|
|
||||||
|
|
||||||
hasAdminPermission: (->
|
|
||||||
if permissions = @get('currentUser.adminPermissions')
|
|
||||||
permissions.contains parseInt(@get('repo.id'))
|
|
||||||
).property('currentUser.adminPermissions.length', 'repo.id')
|
|
||||||
|
|
||||||
displayRegenerateKey: (->
|
|
||||||
@get('canRegenerateKey')
|
|
||||||
).property('canRegenerateKey')
|
|
||||||
|
|
||||||
displaySettingsLink: (->
|
|
||||||
@get('hasPushPermission')
|
|
||||||
).property('hasPushPermission')
|
|
||||||
|
|
||||||
displayCachesLink: (->
|
|
||||||
@get('hasPushPermission') && config.endpoints.caches
|
|
||||||
).property('hasPushPermission')
|
|
||||||
|
|
||||||
displayStatusImages: (->
|
|
||||||
@get('hasPermission')
|
|
||||||
).property('hasPermission')
|
|
||||||
|
|
||||||
`export default View`
|
|
|
@ -5,6 +5,7 @@
|
||||||
`import Polling from 'travis/mixins/polling'`
|
`import Polling from 'travis/mixins/polling'`
|
||||||
|
|
||||||
View = BasicView.extend Polling,
|
View = BasicView.extend Polling,
|
||||||
|
popup: Ember.inject.service()
|
||||||
reposBinding: 'controllers.repos'
|
reposBinding: 'controllers.repos'
|
||||||
repoBinding: 'controller.repo'
|
repoBinding: 'controller.repo'
|
||||||
buildBinding: 'controller.build'
|
buildBinding: 'controller.build'
|
||||||
|
@ -25,7 +26,7 @@ View = BasicView.extend Polling,
|
||||||
|
|
||||||
actions:
|
actions:
|
||||||
statusImages: () ->
|
statusImages: () ->
|
||||||
@popupCloseAll()
|
@get('popup').close()
|
||||||
view = StatusImagesView.create(toolsView: this, container: @container)
|
view = StatusImagesView.create(toolsView: this, container: @container)
|
||||||
BasicView.currentPopupView = view
|
BasicView.currentPopupView = view
|
||||||
view.appendTo($('body'))
|
view.appendTo($('body'))
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
`import BasicView from 'travis/views/basic'`
|
|
||||||
`import Polling from 'travis/mixins/polling'`
|
|
||||||
|
|
||||||
View = BasicView.extend Polling,
|
|
||||||
pollHook: (store) ->
|
|
||||||
@get('controller.store').find('job', {})
|
|
||||||
|
|
||||||
`export default View`
|
|
|
@ -3,16 +3,16 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"handlebars": "2.0.0",
|
"handlebars": "2.0.0",
|
||||||
"jquery": "^1.11.1",
|
"jquery": "^1.11.1",
|
||||||
"ember": "1.13.3",
|
"ember": "1.13.6",
|
||||||
"ember-data": "1.0.0-beta.16.1",
|
"ember-data": "1.0.0-beta.16.1",
|
||||||
"ember-resolver": "~0.1.15",
|
"ember-resolver": "~0.1.15",
|
||||||
"loader.js": "ember-cli/loader.js#1.0.1",
|
"loader.js": "ember-cli/loader.js#1.0.1",
|
||||||
"ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3",
|
"ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3",
|
||||||
"ember-cli-test-loader": "ember-cli/ember-cli-test-loader#0.1.0",
|
"ember-cli-test-loader": "ember-cli/ember-cli-test-loader#0.1.0",
|
||||||
"ember-load-initializers": "ember-cli/ember-load-initializers#0.1.4",
|
"ember-load-initializers": "ember-cli/ember-load-initializers#0.1.4",
|
||||||
"ember-qunit": "0.4.0",
|
"ember-qunit": "0.4.9",
|
||||||
"ember-qunit-notifications": "0.0.5",
|
"ember-qunit-notifications": "0.0.5",
|
||||||
"qunit": "~1.17.1",
|
"qunit": "~1.18.0",
|
||||||
"visibilityjs": "~1.2.1",
|
"visibilityjs": "~1.2.1",
|
||||||
"JavaScript-MD5": "~1.1.0",
|
"JavaScript-MD5": "~1.1.0",
|
||||||
"moment": "~2.9.0",
|
"moment": "~2.9.0",
|
||||||
|
|
|
@ -14,14 +14,14 @@
|
||||||
},
|
},
|
||||||
"repository": "",
|
"repository": "",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "0.10.32"
|
"node": "0.12.x"
|
||||||
},
|
},
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"broccoli-asset-rev": "^2.0.2",
|
"broccoli-asset-rev": "^2.0.2",
|
||||||
"broccoli-sass": "0.6.5",
|
"broccoli-sass": "0.6.6",
|
||||||
"ember-cli": "^1.13.1",
|
"ember-cli": "1.13.7",
|
||||||
"ember-cli-app-version": "0.4.0",
|
"ember-cli-app-version": "0.4.0",
|
||||||
"ember-cli-autoprefixer": "^0.3.0",
|
"ember-cli-autoprefixer": "^0.3.0",
|
||||||
"ember-cli-babel": "5.0.0",
|
"ember-cli-babel": "5.0.0",
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
"ember-cli-inject-live-reload": "^1.3.0",
|
"ember-cli-inject-live-reload": "^1.3.0",
|
||||||
"ember-cli-inline-images": "^0.0.4",
|
"ember-cli-inline-images": "^0.0.4",
|
||||||
"ember-cli-pretender": "0.3.1",
|
"ember-cli-pretender": "0.3.1",
|
||||||
"ember-cli-qunit": "0.3.15",
|
"ember-cli-qunit": "0.3.20",
|
||||||
"ember-cli-release": "0.2.3",
|
"ember-cli-release": "0.2.3",
|
||||||
"ember-cli-sauce": "^1.1.0",
|
"ember-cli-sauce": "^1.1.0",
|
||||||
"ember-cli-uglify": "1.0.1",
|
"ember-cli-uglify": "1.0.1",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user