Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ AggregateTail = React.createClass

getRowType: ->
if !@state.splitView
return ''
return 'unified'

if @state.viewingInstances.length > 3 then 'tail-row-half' else 'tail-row'

Expand Down
20 changes: 18 additions & 2 deletions SingularityUI/app/components/aggregateTail/Contents.cjsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Contents = React.createClass
isLoading: false
loadingText: ''
linesToRender: []
loadingFromTop: false

componentDidMount: ->
@scrollNode = ReactDOM.findDOMNode(@refs.scrollContainer)
Expand All @@ -22,7 +23,7 @@ Contents = React.createClass
@startTailingPoll()

componentDidUpdate: (prevProps, prevState) ->
if @tailingPoll
if @tailingPoll and not @state.loadingFromTop
@scrollToBottom()

# Stop tailing if the task dies
Expand All @@ -47,7 +48,7 @@ Contents = React.createClass
if $(node).scrollTop() + $(node).innerHeight() >= node.scrollHeight - 20
if @props.moreToFetch()
@props.fetchNext()
else if @props.taskState not in Utils.TERMINAL_TASK_STATES and @props.logLines.length > 0
else if @props.taskState not in Utils.TERMINAL_TASK_STATES and @props.logLines.length > 0 and not @state.loadingFromTop
@startTailingPoll()
# Or the top?
else if $(node).scrollTop() is 0
Expand Down Expand Up @@ -89,6 +90,21 @@ Contents = React.createClass
@setState
isLoading: false
loadingText: ''
loadingFromTop: false

loadFromTop: ->
# Make sure there isn't one already running
@stopTailingPoll()
@setState
isLoading: true
loadingText: 'Loading'
loadingFromTop: true
@tailingPoll = setInterval =>
if @state.linesToRender and @refs.lines.getVisibleRange()[1] < @state.linesToRender.length * 2
@stopTailingPoll()
else
@props.fetchNext()
, 2000

# ============================================================================
# Rendering |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ IndividualTail = React.createClass
@refs.contents.scrollToTop()
else
@props.logLines.reset()
@props.logLines.fetchFromStart().done @refs.contents.scrollToTop
@props.logLines.fetchFromStart().done =>
@refs.contents.scrollToTop()
@refs.contents.loadFromTop()

scrollToBottom: ->
if @props.logLines.state.get('moreToFetch') is true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ InterleavedTail = React.createClass
Promise.all(promises).then =>
@resetMergedLines()
@refs.contents.scrollToTop()
@refs.contents.loadFromTop()

scrollToBottom: ->
if _.every(@props.logLines, (logLines) => logLines.state.get('moreToFetch') is true)
Expand Down
2 changes: 1 addition & 1 deletion SingularityUI/app/components/aggregateTail/LogLine.cjsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ LogLine = React.createClass
<span key={i} className={if s.match then 'search-match'}>{s.text}</span>

render: ->
<div className="#{@getClassNames()}" style={backgroundColor: @props.color} title={@props.taskId}>
<div className="#{@getClassNames()}" style={backgroundColor: @props.color}>
<a target="blank" href="#{@props.offsetLink}" className="offset-link" data-offset="#{@props.offset}">
<div className="pre-line">
<span className="glyphicon glyphicon-link" data-offset="#{@props.offset}"></span>
Expand Down
28 changes: 27 additions & 1 deletion SingularityUI/app/styles/tailer.styl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,32 @@
width 100vw
padding 0 20px 0 20px

.row.unified
position fixed
width 100%
bottom 0
top 130px

@media (max-width: 1522px)
.tail-root
.row.unified
top 160px

@media (max-width: 990px)
.tail-root
.row.unified
top 200px

@media (max-width: 862px)
.tail-root
.row.unified
top 250px

@media (max-width: 768px)
.tail-root
.row.unified
top 170px

.tail-row
height calc(100vh - 130px)
margin-bottom 0
Expand Down Expand Up @@ -279,7 +305,7 @@

.loading
color $green
width 55px
width 80px
float left

.loading:after
Expand Down
2 changes: 1 addition & 1 deletion SingularityUI/app/templates/taskDetail/taskFileBrowser.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</a>
{{else}}
{{#if isTailable}}
<a href="{{appRoot}}/request/{{ ../task.requestId }}/tail/{{ uiPath }}/?taskIds={{ taskId }}">
<a href="{{ appRoot }}/task/{{ ../task.taskId }}/tail/{{ substituteTaskId uiPath ../task.taskId }}">
<span class="glyphicon glyphicon-file"></span>{{ name }}
</a>
{{else}}
Expand Down
1 change: 0 additions & 1 deletion SingularityUI/bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"select2": "~3.5.2",
"react": "~0.14.2",
"react-list": "~0.7.3",
"react-dom": "git://github.com/EtienneLem/react-dom-util.git",
"fuzzy": "~0.1.1",
"fuse.js": "~1.2.2",
"juration": "*"
Expand Down