mirror of
https://git.yoctoproject.org/poky
synced 2026-03-19 13:49:41 +01:00
bitbake: toaster: display Toaster mode and version in debug mode
This patch displays the current running mode and checked-out git branch as Toaster version when running in debug mode. (Bitbake rev: 93e4f8c44273f4657c5be4c00b61db12aa875e31) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
da8110a86a
commit
d81e5141c1
@@ -2,6 +2,25 @@
|
||||
.logo img { height: 30px; width: auto !important; }
|
||||
.logo { padding-top: 4px !important; padding-bottom:0px !important; }
|
||||
|
||||
/* style the version text */
|
||||
.version-text {
|
||||
color: #AAA;
|
||||
font-size: 0.6em;
|
||||
display: table-footer-group;
|
||||
padding: 0px;
|
||||
margin: 1px 1px 1px 1px;
|
||||
}
|
||||
|
||||
.version-brand, .version-brand:hover, a.version-brand:focus {
|
||||
color: #777;
|
||||
display: block;
|
||||
float: left;
|
||||
font-size: 20px;
|
||||
font-weight: 200;
|
||||
padding: 00px 0px;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
}
|
||||
|
||||
/* Style the breadcrumb */
|
||||
.breadcrumb { display: inline-block; background-color: transparent; }
|
||||
.section { margin: 20px 0; }
|
||||
|
||||
@@ -59,6 +59,12 @@
|
||||
<div class="navbar-inner">
|
||||
<a class="brand logo" href="#"><img src="{% static 'img/logo.png' %}" class="" alt="Yocto logo project"/></a>
|
||||
<a class="brand" href="/">Toaster</a>
|
||||
{% if DEBUG %}
|
||||
<div style="display: inline;" class="version-brand">
|
||||
<p class="version-text">version {{TOASTER_VERSION}}</p>
|
||||
<p class="version-text">{%if MANAGED%}managed{%else%}interactive{%endif%} mode</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
<a class="pull-right manual" target="_blank" href="http://www.yoctoproject.org/documentation/toaster-manual">
|
||||
<i class="icon-book"></i>
|
||||
Toaster manual
|
||||
|
||||
@@ -1709,10 +1709,12 @@ if toastermain.settings.MANAGED:
|
||||
|
||||
# the context processor that supplies data used across all the pages
|
||||
def managedcontextprocessor(request):
|
||||
import subprocess
|
||||
ret = {
|
||||
"projects": Project.objects.all(),
|
||||
"MANAGED" : toastermain.settings.MANAGED,
|
||||
"DEBUG" : toastermain.settings.DEBUG
|
||||
"DEBUG" : toastermain.settings.DEBUG,
|
||||
"TOASTER_VERSION": toastermain.settings.TOASTER_VERSION,
|
||||
}
|
||||
if 'project_id' in request.session:
|
||||
try:
|
||||
@@ -3057,7 +3059,9 @@ else:
|
||||
return {
|
||||
"projects": [],
|
||||
"MANAGED" : toastermain.settings.MANAGED,
|
||||
"DEBUG" : toastermain.settings.DEBUG
|
||||
"DEBUG" : toastermain.settings.DEBUG,
|
||||
"TOASTER_VERSION": toastermain.settings.TOASTER_VERSION,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -211,8 +211,6 @@ MIDDLEWARE_CLASSES = (
|
||||
'django.middleware.csrf.CsrfViewMiddleware',
|
||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||
'django.contrib.messages.middleware.MessageMiddleware',
|
||||
'django.middleware.cache.UpdateCacheMiddleware',
|
||||
'django.middleware.cache.FetchFromCacheMiddleware',
|
||||
# Uncomment the next line for simple clickjacking protection:
|
||||
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||
)
|
||||
@@ -233,6 +231,9 @@ CACHES = {
|
||||
from os.path import dirname as DN
|
||||
SITE_ROOT=DN(DN(os.path.abspath(__file__)))
|
||||
|
||||
import subprocess
|
||||
TOASTER_VERSION = subprocess.Popen('cd %s; git branch | grep "^* " | tr -d "* "' % SITE_ROOT, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0]
|
||||
|
||||
ROOT_URLCONF = 'toastermain.urls'
|
||||
|
||||
# Python dotted path to the WSGI application used by Django's runserver.
|
||||
|
||||
Reference in New Issue
Block a user