From 32fbbea4ada3251c8a84e0fd96fea356ebc5b4a4 Mon Sep 17 00:00:00 2001 From: tpetr Date: Tue, 19 Jan 2016 15:24:00 -0500 Subject: [PATCH 1/4] make row div fixed to get unified tail visible again --- .../aggregateTail/AggregateTail.cjsx | 2 +- SingularityUI/app/styles/tailer.styl | 26 +++++++++++++++++++ SingularityUI/bower.json | 1 - 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/SingularityUI/app/components/aggregateTail/AggregateTail.cjsx b/SingularityUI/app/components/aggregateTail/AggregateTail.cjsx index bd6a967e12..a45c9de5d9 100644 --- a/SingularityUI/app/components/aggregateTail/AggregateTail.cjsx +++ b/SingularityUI/app/components/aggregateTail/AggregateTail.cjsx @@ -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' diff --git a/SingularityUI/app/styles/tailer.styl b/SingularityUI/app/styles/tailer.styl index 8331735148..e685c3c490 100644 --- a/SingularityUI/app/styles/tailer.styl +++ b/SingularityUI/app/styles/tailer.styl @@ -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 diff --git a/SingularityUI/bower.json b/SingularityUI/bower.json index ef4ad66dd9..a0175ccbd8 100644 --- a/SingularityUI/bower.json +++ b/SingularityUI/bower.json @@ -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": "*" From 5d3e2ab674ca7196a0387b2a3aa2294f7e17ad8b Mon Sep 17 00:00:00 2001 From: tpetr Date: Wed, 20 Jan 2016 09:24:53 -0500 Subject: [PATCH 2/4] remove tooltip on log lines --- SingularityUI/app/components/aggregateTail/LogLine.cjsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SingularityUI/app/components/aggregateTail/LogLine.cjsx b/SingularityUI/app/components/aggregateTail/LogLine.cjsx index 395669d942..69e271734f 100644 --- a/SingularityUI/app/components/aggregateTail/LogLine.cjsx +++ b/SingularityUI/app/components/aggregateTail/LogLine.cjsx @@ -38,7 +38,7 @@ LogLine = React.createClass {s.text} render: -> -
+
From 1cf4c88831e055c8ff47999bf32fc02c7c2868f3 Mon Sep 17 00:00:00 2001 From: tpetr Date: Wed, 20 Jan 2016 11:05:56 -0500 Subject: [PATCH 3/4] fix scrolling to top while grepping a file --- .../components/aggregateTail/Contents.cjsx | 20 +++++++++++++++++-- .../aggregateTail/IndividualTail.cjsx | 4 +++- .../aggregateTail/InterleavedTail.cjsx | 1 + SingularityUI/app/styles/tailer.styl | 2 +- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/SingularityUI/app/components/aggregateTail/Contents.cjsx b/SingularityUI/app/components/aggregateTail/Contents.cjsx index 5e237cf5e1..b13c88b0b1 100644 --- a/SingularityUI/app/components/aggregateTail/Contents.cjsx +++ b/SingularityUI/app/components/aggregateTail/Contents.cjsx @@ -14,6 +14,7 @@ Contents = React.createClass isLoading: false loadingText: '' linesToRender: [] + loadingFromTop: false componentDidMount: -> @scrollNode = ReactDOM.findDOMNode(@refs.scrollContainer) @@ -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 @@ -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 @@ -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 | diff --git a/SingularityUI/app/components/aggregateTail/IndividualTail.cjsx b/SingularityUI/app/components/aggregateTail/IndividualTail.cjsx index 2570c1dfb1..c49fef05c0 100644 --- a/SingularityUI/app/components/aggregateTail/IndividualTail.cjsx +++ b/SingularityUI/app/components/aggregateTail/IndividualTail.cjsx @@ -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 diff --git a/SingularityUI/app/components/aggregateTail/InterleavedTail.cjsx b/SingularityUI/app/components/aggregateTail/InterleavedTail.cjsx index e86f7b330e..922efeb308 100644 --- a/SingularityUI/app/components/aggregateTail/InterleavedTail.cjsx +++ b/SingularityUI/app/components/aggregateTail/InterleavedTail.cjsx @@ -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) diff --git a/SingularityUI/app/styles/tailer.styl b/SingularityUI/app/styles/tailer.styl index e685c3c490..a8fbbed7f1 100644 --- a/SingularityUI/app/styles/tailer.styl +++ b/SingularityUI/app/styles/tailer.styl @@ -305,7 +305,7 @@ .loading color $green - width 55px + width 80px float left .loading:after From e25439075e2d8285ea2c7d387c5665c60b96f5dd Mon Sep 17 00:00:00 2001 From: tpetr Date: Wed, 20 Jan 2016 11:34:32 -0500 Subject: [PATCH 4/4] dont use aggregate tailer URL for task sandbox file link --- SingularityUI/app/templates/taskDetail/taskFileBrowser.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SingularityUI/app/templates/taskDetail/taskFileBrowser.hbs b/SingularityUI/app/templates/taskDetail/taskFileBrowser.hbs index f81b9179f0..600749f49f 100644 --- a/SingularityUI/app/templates/taskDetail/taskFileBrowser.hbs +++ b/SingularityUI/app/templates/taskDetail/taskFileBrowser.hbs @@ -42,7 +42,7 @@ {{else}} {{#if isTailable}} - + {{ name }} {{else}}