Quellcode durchsuchen

HUE-70. Job Designer UI needs a little love (partial refresh, sizeTo scrolling)

Aaron Newton vor 15 Jahren
Ursprung
Commit
aee904419e

+ 72 - 0
apps/jframegallery/src/jframegallery/templates/fit.text.(table).mako

@@ -0,0 +1,72 @@
+## Licensed to Cloudera, Inc. under one
+## or more contributor license agreements.  See the NOTICE file
+## distributed with this work for additional information
+## regarding copyright ownership.  Cloudera, Inc. licenses this file
+## to you under the Apache License, Version 2.0 (the
+## "License"); you may not use this file except in compliance
+## with the License.  You may obtain a copy of the License at
+## 
+##     http://www.apache.org/licenses/LICENSE-2.0
+## 
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
+<html>
+	<head>
+		<title>FitText (table)</title>
+	</head>
+	<body>
+	<h1 class="ccs-hidden">FitText (table)</h1>
+	
+	<table data-filters="" class="noSelect" cellpadding="0" cellspacing="0">
+		<thead>
+			<tr>
+				<th>
+							ID
+				</th>
+				<th>
+							TimeZone
+				</th>
+				<th>
+							Name
+				</th>
+				<th>
+							GEO Latitude
+				</th>
+				<th>
+							GEO Longitude
+				</th>
+			</tr>
+		</thead>
+		<tbody>
+			% for i in range(10000):
+				<tr>
+					<td>
+						${i}
+					</td>
+					<td>
+						New York City
+					</td>
+					<td>
+						America/New_York
+						America/New_York
+						America/New_York
+						America/New_York
+					</td>
+					<td>
+						40.7255
+					</td>
+					<td>
+						-73.9983
+					</td>
+				</tr>
+			% endfor
+		</tbody>
+	</table>
+	
+	</body>
+</html>

+ 6 - 6
apps/jobsub/src/jobsub/templates/watch_submission.html

@@ -23,9 +23,9 @@ limitations under the License.
 	{% endif %}
 {% endblock %}
 {% block content %}
-	<div id="jobsub_output" class="view">
+	<div id="jobsub_output" class="view partial_refresh">
 		<h1>Job - {{ submission.name }}</h1>
-		<b class="state{% if completed %} complete {% endif %}">
+		<b class="state{% if completed %} complete {% endif %}" data-partial-id="0">
 			{% if completed %}
 				status: finished
 			{% else %}
@@ -34,19 +34,19 @@ limitations under the License.
 				<span class="jobsub_autorefresh_note">note: this view will auto refresh in <span class="sec_to_autorefresh"></span> seconds</span>
 			{% endif %}
 		</b>
-		<div class="jframe_padded">
+		<div class="jframe_padded" data-filters="SizeTo" data-size-to-height="-74">
 			<h2 class="jobsub_output_links_header">Launched Jobs</h2>
-			<ul class="jobsub_output_links">
+			<ul class="jobsub_output_links" data-partial-id="1">
 				{% for j in jobs %}
 					<li><a href="{% url single_job jobid=j %}" target="JobBrowser">{{ j }}</a>
 				{% endfor %}
 			</ul>
 
 			<h2 class="jobsub_output_stout_header">Last 10KB of stdout:</h2>
-			<pre class="jobsub_output_stout">{{ job_data.stdout_tail }}</pre>
+			<pre class="jobsub_output_stout" data-partial-id="2">{{ job_data.stdout_tail }}</pre>
 
 			<h2 class="jobsub_output_sterr_header">Last 10KB of stderr:</h2>
-			<pre class="jobsub_output_sterr">{{ job_data.stderr_tail }}</pre>
+			<pre class="jobsub_output_sterr" data-partial-id="3">{{ job_data.stderr_tail }}</pre>
 		</div>
 	</div>
 {% endblock %}

+ 2 - 2
desktop/core/static/js/Source/JFrameFilters/CCS.JFrame.AutoRefresh.js

@@ -43,9 +43,9 @@ CCS.JFrame.addGlobalFilters({
 			}, this);
 			if (!sec) return;
 			var end = new Date().increment('second', sec);
-			var span = container.getElement('span.sec_to_autorefresh');
-			var until, diff;
+			var until, diff, span;
 			var update = function() {
+				span = $(this).getElement('span.sec_to_autorefresh');
 				diff = ((end - new Date()) / Date.units['second']());
 				until = diff.toInt();
 				if (span) span.set('html', until);