瀏覽代碼

HUE-620 first attempt to restore the config check icon

Enrico Berti 13 年之前
父節點
當前提交
11ee89bb7d

+ 2 - 1
desktop/core/src/desktop/templates/common_header.html

@@ -62,6 +62,7 @@ limitations under the License.
 			}).change(function(){
 				$(this).closest("form").submit();
 			});
+			$("#checkConfig").load("/debug/check_config_ajax");
 		});
 	</script>
 
@@ -73,7 +74,6 @@ limitations under the License.
 				<a class="brand" href="#">jHue</a>
 				<ul class="nav">
 					<li {% is_selected section "beeswax" %}><a href="/beeswax">Beeswax</a></li>
-
 					<li {% is_selected section "filebrowser" %}><a href="/filebrowser/">File Browser</a></li>
 					<li {% is_selected section "jobsub" %}><a href="/jobsub/">Job Designer</a></li>
 					<li {% is_selected section "jobbrowser" %}><a href="/jobbrowser/jobs/">Job Browser</a></li>
@@ -81,6 +81,7 @@ limitations under the License.
 					<li {% is_selected section "shell" %}><a href="/shell/">Shell</a></li>
 					<li {% is_selected section "help" %}><a href="/help/">Help</a></li>
 					<li {% is_selected section "about" %}><a href="/about/">About</a></li>
+					<li id="checkConfig"><li>
 				</ul>
 				<p class="pull-right">Logged in as <strong><span id="username">xxx</span></strong> - <a href="/accounts/logout">Sign out</a></p>
 			</div>

+ 1 - 2
desktop/core/src/desktop/templates/config_alert_dock.mako

@@ -15,8 +15,7 @@
 ## limitations under the License.
 
 % if error_list:
-  <a class="dock_misconfig" target="_blank" href="${url('desktop.views.check_config')}"
-      title="Misconfiguration detected" alt="Misconfiguration detected">
+  <a href="${url('desktop.views.check_config')}" title="Misconfiguration detected" alt="Misconfiguration detected">
     <img src="/static/art/error.png"/>
   </a>
 % endif

+ 2 - 1
desktop/core/src/desktop/urls.py

@@ -52,7 +52,7 @@ dynamic_patterns = patterns('',
   (r'^accounts/login_form/?$', 'desktop.auth.views.login_form'),
   (r'^logs$','desktop.views.log_view'),
   (r'^dump_config$','desktop.views.dump_config'),
-  (r'^download_logs$','desktop.views.download_log_view'),                   
+  (r'^download_logs$','desktop.views.download_log_view'),
   (r'^bootstrap.js$', 'desktop.views.bootstrap'),
   (r'^profile$', 'desktop.auth.views.profile'),
   (r'^prefs/(?P<key>\w+)?$', 'desktop.views.prefs'),
@@ -62,6 +62,7 @@ dynamic_patterns = patterns('',
   (r'^debug/threads$', 'desktop.views.threads'),
   (r'^debug/who_am_i$', 'desktop.views.who_am_i'),
   (r'^debug/check_config$', 'desktop.views.check_config'),
+  (r'^debug/check_config_ajax$', 'desktop.views.check_config_ajax'),
   (r'^log_frontend_event$', 'desktop.views.log_frontend_event'),
   # Top level web page!
   (r'^$', 'desktop.views.index'),

+ 2 - 2
desktop/core/src/desktop/views.py

@@ -335,7 +335,7 @@ def check_config(request):
                     error_list=_get_config_errors(cache=False),
                     conf_dir=conf_dir))
 
-def status_bar_config_check(request):
+def check_config_ajax(request):
   """Alert administrators about configuration problems."""
   if not request.user.is_superuser:
     return HttpResponse('')
@@ -349,4 +349,4 @@ def status_bar_config_check(request):
                 dict(error_list=error_list),
                 force_template=True)
 
-register_status_bar_view(status_bar_config_check)
+register_status_bar_view(check_config_ajax)