travis-web/app/components/travis-status.coffee
Piotr Sarnacki 9d46fc6712 Add footer to landing page and main layout
This commit also plugs statuspage.io status check to the footer's status
section.
2015-03-31 14:20:30 +02:00

23 lines
569 B
CoffeeScript

`import Ember from 'ember'`
`import Ajax from 'travis/utils/ajax'`
`import config from 'travis/config/environment'`
TravisStatusComponent = Ember.Component.extend
status: null
statusPageStatusUrl: (->
config.statusPageStatusUrl
).property()
didInsertElement: ->
if url = @get('statusPageStatusUrl')
self = this
@getStatus(url).then (response) ->
if response.status and response.status.indicator
self.set('status', response.status.indicator)
getStatus: (url) ->
$.ajax(url)
`export default TravisStatusComponent`