Browse Source

HUE-1641 [jb] Improve UX of non started job yet

Added a bit of love
Fixed log display for MR1
Enrico Berti 12 năm trước cách đây
mục cha
commit
fe7e160fe1

+ 8 - 4
apps/jobbrowser/src/jobbrowser/templates/job_not_assigned.mako

@@ -40,14 +40,18 @@ ${ comps.menubar() }
     </div>
     <div class="span10">
       <div class="card card-small">
-        <h1 class="card-heading simple"></h1>
+        <h1 class="card-heading simple">${_('Loading...')}</h1>
           <div class="card-body">
             <p>
 
-             ${ _('The application might not be running yet or there is no Node Manager or Container available.') }
+              ${ _('The application might not be running yet or there is no Node Manager or Container available.') }
+              <strong>${ _('This page will be automatically refreshed.') }</strong>
 
-             <!--[if !IE]><!--><i class="icon-spinner icon-spin loader-main"></i><!--<![endif]-->
-             <!--[if IE]><img src="/hbase/static/art/loader.gif" /><![endif]-->
+              <br/>
+              <br/>
+
+              <!--[if !IE]><!--><i class="icon-spinner icon-spin" style="font-size: 60px; color: #DDD"></i><!--<![endif]-->
+              <!--[if IE]><img src="/static/art/spinner.gif" /><![endif]-->
             </p>
       </div>
     </div>

+ 4 - 1
apps/jobbrowser/src/jobbrowser/views.py

@@ -262,7 +262,10 @@ def job_single_logs(request, job):
   if failed_tasks:
     task = failed_tasks[0]
   else:
-    recent_tasks = job.filter_tasks(task_states=('running', 'succeeded', 'scheduled'), task_types=('map', 'reduce',))
+    task_states = ['running', 'succeeded']
+    if job.is_mr2:
+      task_states.append('scheduled')
+    recent_tasks = job.filter_tasks(task_states=task_states, task_types=('map', 'reduce',))
     recent_tasks.sort(cmp_exec_time, reverse=True)
     if recent_tasks:
       task = recent_tasks[0]