Merge branch 'switches-styling' into mm-concurrent-builds-setting
This commit is contained in:
commit
4d7190012f
|
@ -55,7 +55,7 @@ unless window.TravisApplication
|
|||
|
||||
type = Ember.get(Travis, 'mappings')[name]
|
||||
|
||||
if event == 'build:started' && data.build.commit
|
||||
if name == 'build' && data.build.commit
|
||||
# TODO: commit should be a sideload record on build, not mixed with it
|
||||
build = data.build
|
||||
commit = {
|
||||
|
|
|
@ -64,6 +64,7 @@ window.Auth = Ember.Object.extend
|
|||
@set('state', 'signed-in')
|
||||
Travis.trigger('user:signed_in', data.user)
|
||||
@sendToApp('afterSignIn')
|
||||
@refreshUserData(data.user)
|
||||
|
||||
refreshUserData: (user) ->
|
||||
Travis.ajax.get "/users/#{user.id}", (data) =>
|
||||
|
@ -73,8 +74,8 @@ window.Auth = Ember.Object.extend
|
|||
data.user.token = user.token
|
||||
@storeData(data, Travis.sessionStorage)
|
||||
@storeData(data, Travis.storage)
|
||||
, (data, status, xhr) =>
|
||||
@signOut() if xhr.status == 401
|
||||
, (status, xhr) =>
|
||||
@signOut() if status == 403
|
||||
|
||||
signedIn: (->
|
||||
@get('state') == 'signed-in'
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
Travis.AccountController = Ember.ObjectController.extend
|
||||
allHooks: []
|
||||
needs: ['currentUser']
|
||||
userBinding: 'controllers.currentUser'
|
||||
|
||||
init: ->
|
||||
@_super.apply this, arguments
|
||||
|
@ -33,3 +35,8 @@ Travis.AccountController = Ember.ObjectController.extend
|
|||
showPublicReposHint: (->
|
||||
Travis.config.show_repos_hint == 'public'
|
||||
) .property()
|
||||
|
||||
actions:
|
||||
sync: ->
|
||||
@get('user').sync()
|
||||
|
||||
|
|
|
@ -5,9 +5,6 @@ Travis.ProfileController = Travis.Controller.extend
|
|||
userBinding: 'controllers.currentUser'
|
||||
accountBinding: 'controllers.account'
|
||||
|
||||
sync: ->
|
||||
@get('user').sync()
|
||||
|
||||
activate: (action, params) ->
|
||||
this["view#{$.camelize(action)}"]()
|
||||
|
||||
|
|
|
@ -10,8 +10,8 @@ require 'travis/model'
|
|||
message: Ember.attr('string')
|
||||
_duration: Ember.attr(Number, key: 'duration')
|
||||
_config: Ember.attr('object', key: 'config')
|
||||
startedAt: Ember.attr('string')
|
||||
finishedAt: Ember.attr('string')
|
||||
_startedAt: Ember.attr('string', key: 'started_at')
|
||||
_finishedAt: Ember.attr('string', key: 'finished_at')
|
||||
pullRequest: Ember.attr('boolean')
|
||||
pullRequestTitle: Ember.attr('string')
|
||||
pullRequestNumber: Ember.attr(Number)
|
||||
|
@ -36,6 +36,20 @@ require 'travis/model'
|
|||
@get('state') in ['passed', 'failed', 'errored', 'canceled']
|
||||
).property('state')
|
||||
|
||||
notStarted: (->
|
||||
@get('state') in ['queued', 'created']
|
||||
).property('state')
|
||||
|
||||
startedAt: (->
|
||||
unless @get('notStarted')
|
||||
@get('_startedAt')
|
||||
).property('_startedAt', 'notStarted')
|
||||
|
||||
finishedAt: (->
|
||||
unless @get('notStarted')
|
||||
@get('_finishedAt')
|
||||
).property('_finishedAt', 'notStarted')
|
||||
|
||||
requiredJobs: (->
|
||||
@get('jobs').filter (data) -> !data.get('allowFailure')
|
||||
).property('jobs.@each.allowFailure')
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
Travis.DurationCalculations = Ember.Mixin.create
|
||||
duration: (->
|
||||
if duration = @get('_duration')
|
||||
if @get('notStarted')
|
||||
null
|
||||
else if duration = @get('_duration')
|
||||
duration
|
||||
else
|
||||
Travis.Helpers.durationFrom(@get('startedAt'), @get('finishedAt'))
|
||||
).property('_duration', 'finishedAt', 'startedAt')
|
||||
|
||||
updateTimes: ->
|
||||
unless ['rootState.loaded.reloading', 'rootState.loading'].contains @get('stateManager.currentState.path') or @get('isFinished')
|
||||
unless @get('isFinished')
|
||||
@notifyPropertyChange '_duration'
|
||||
@notifyPropertyChange 'finished_at'
|
||||
|
|
|
@ -9,8 +9,8 @@ require 'travis/model'
|
|||
queue: Ember.attr('string')
|
||||
state: Ember.attr('string')
|
||||
number: Ember.attr('string')
|
||||
startedAt: Ember.attr('string')
|
||||
finishedAt: Ember.attr('string')
|
||||
_startedAt: Ember.attr('string', key: 'started_at')
|
||||
_finishedAt: Ember.attr('string', key: 'finished_at')
|
||||
allowFailure: Ember.attr('boolean')
|
||||
|
||||
repositorySlug: Ember.attr('string')
|
||||
|
@ -27,6 +27,16 @@ require 'travis/model'
|
|||
Travis.Log.create(job: this)
|
||||
).property()
|
||||
|
||||
startedAt: (->
|
||||
unless @get('notStarted')
|
||||
@get('_startedAt')
|
||||
).property('_startedAt', 'notStarted')
|
||||
|
||||
finishedAt: (->
|
||||
unless @get('notStarted')
|
||||
@get('_finishedAt')
|
||||
).property('_finishedAt', 'notStarted')
|
||||
|
||||
repoSlug: (->
|
||||
@get('repositorySlug')
|
||||
).property('repositorySlug')
|
||||
|
@ -39,6 +49,10 @@ require 'travis/model'
|
|||
@get('state') in ['passed', 'failed', 'errored', 'canceled']
|
||||
).property('state')
|
||||
|
||||
notStarted: (->
|
||||
@get('state') in ['queued', 'created']
|
||||
).property('state')
|
||||
|
||||
clearLog: ->
|
||||
# This is needed if we don't want to fetch log just to clear it
|
||||
if @get('isLogAccessed')
|
||||
|
|
|
@ -20,11 +20,10 @@ require 'travis/model'
|
|||
value
|
||||
).property('login', '_name')
|
||||
|
||||
init: ->
|
||||
@_super()
|
||||
|
||||
isSyncingDidChange: (->
|
||||
Ember.run.next this, ->
|
||||
@poll() if @get('isSyncing')
|
||||
).observes('isSyncing')
|
||||
|
||||
urlGithub: (->
|
||||
"https://github.com/#{@get('login')}"
|
||||
|
@ -66,7 +65,6 @@ require 'travis/model'
|
|||
self = this
|
||||
Travis.ajax.post('/users/sync', {}, ->
|
||||
self.setWithSession('isSyncing', true)
|
||||
self.poll()
|
||||
)
|
||||
|
||||
poll: ->
|
||||
|
|
|
@ -60,6 +60,9 @@ class @Travis.Tailing
|
|||
@tail().addClass('active')
|
||||
@run()
|
||||
|
||||
isActive: ->
|
||||
@tail().hasClass('active')
|
||||
|
||||
stop: ->
|
||||
@tail().removeClass('active')
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{{#if _active}}
|
||||
<span class="on">
|
||||
ON
|
||||
{{else}}
|
||||
</span>
|
||||
<span class="off">
|
||||
OFF
|
||||
{{/if}}
|
||||
</span>
|
||||
|
|
|
@ -46,12 +46,16 @@ Travis.reopen
|
|||
|
||||
createEngine: ->
|
||||
console.log 'log view: create engine' if Log.DEBUG
|
||||
@scroll = new Log.Scroll
|
||||
@scroll = new Log.Scroll beforeScroll: =>
|
||||
@unfoldHighlight()
|
||||
@engine = Log.create(limit: Log.LIMIT, listeners: [@scroll])
|
||||
@logFolder = new Travis.LogFolder(@$().find('#log'))
|
||||
@lineSelector = new Travis.LinesSelector(@$().find('#log'), @scroll, @logFolder)
|
||||
@observeParts()
|
||||
|
||||
unfoldHighlight: ->
|
||||
@lineSelector.unfoldLines()
|
||||
|
||||
observeParts: ->
|
||||
parts = @get('log.parts')
|
||||
parts.addArrayObserver(@, didChange: 'partsDidChange', willChange: 'noop')
|
||||
|
@ -76,6 +80,7 @@ Travis.reopen
|
|||
|
||||
toggleTailing: ->
|
||||
Travis.tailing.toggle()
|
||||
@engine.autoCloseFold = !Travis.tailing.isActive()
|
||||
event.preventDefault()
|
||||
|
||||
actions:
|
||||
|
@ -84,7 +89,10 @@ Travis.reopen
|
|||
|
||||
noop: -> # TODO required?
|
||||
|
||||
Log.Scroll = ->
|
||||
Log.Scroll = (options) ->
|
||||
options ||= {}
|
||||
@beforeScroll = options.beforeScroll
|
||||
this
|
||||
Log.Scroll.prototype = $.extend new Log.Listener,
|
||||
insert: (log, data, pos) ->
|
||||
@tryScroll() if @numbers
|
||||
|
@ -92,6 +100,8 @@ Log.Scroll.prototype = $.extend new Log.Listener,
|
|||
|
||||
tryScroll: ->
|
||||
if element = $("#log p:visible.highlight:first")
|
||||
if @beforeScroll
|
||||
@beforeScroll()
|
||||
$('#main').scrollTop(0)
|
||||
$('html, body').scrollTop(element.offset()?.top - (window.innerHeight / 3)) # weird, html works in chrome, body in firefox
|
||||
|
||||
|
|
3
assets/scripts/vendor/log.js
vendored
3
assets/scripts/vendor/log.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1,37 +1,60 @@
|
|||
.settings-row
|
||||
margin-top: 20px
|
||||
|
||||
a.travis-switch
|
||||
margin: 0 10px 0 0
|
||||
|
||||
p.settings-row
|
||||
line-height: 30px
|
||||
|
||||
.travis-switch
|
||||
position: relative
|
||||
display: inline-block
|
||||
float: left
|
||||
width: 60px
|
||||
height: 18px
|
||||
margin: 0 10px 0 15px
|
||||
padding: 0 10px 0 0
|
||||
border: 1px solid #bdbdbd
|
||||
margin: 20px 0 50px 0
|
||||
padding: 5px 18px 5px 18px
|
||||
background-color: #F5F5F5
|
||||
border: 1px solid #E3E1E1
|
||||
border-radius: 4px
|
||||
line-height: 19px
|
||||
font-size: 11px
|
||||
color: #999
|
||||
color: #999999
|
||||
cursor: pointer
|
||||
text-align: right
|
||||
&:before
|
||||
content: ""
|
||||
position: absolute
|
||||
top: -1px
|
||||
left: -1px
|
||||
width: 28px
|
||||
height: 18px
|
||||
top: 1px
|
||||
left: 1px
|
||||
width: 42px
|
||||
height: 24px
|
||||
background: #e9e9e7
|
||||
border: 1px solid #bdbdbd
|
||||
border: 1px solid #d7d4d4
|
||||
border-radius: 2px
|
||||
|
||||
.travis-switch.active
|
||||
width: 56px
|
||||
padding: 0 0 0 14px
|
||||
background: #40454f
|
||||
border: 1px solid #bdbdbd
|
||||
color: #fff
|
||||
width: 60px
|
||||
padding: 5px 18px 5px 18px
|
||||
background-color: #607A83
|
||||
border-radius: 4px
|
||||
color: #ffffff
|
||||
font-weight: 600
|
||||
text-align: left
|
||||
&:before
|
||||
left: auto
|
||||
right: -1px
|
||||
right: 1px
|
||||
width: 42px
|
||||
height: 24px
|
||||
border: 1px solid #9cafb5
|
||||
|
||||
span.on
|
||||
background-color: #607A83
|
||||
color: #fff
|
||||
font-weight: 800
|
||||
border-radius: 3px
|
||||
float: left
|
||||
|
||||
span.off
|
||||
float: right
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
@import "_mixins/all"
|
||||
|
||||
#annotations
|
||||
margin: 0 0 0 12px
|
||||
margin: 8px 0 25px 12px
|
||||
padding: 12px 0 0 0
|
||||
@include clearfix
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user