diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2015-02-06 15:32:18 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-02-10 23:07:48 +0000 |
commit | d81e5141c10a97bf5764892f9b20933b751c1da3 (patch) | |
tree | 64a82acb15fe06a8a23e9618ff6a8eb18f604513 /bitbake/lib/toaster | |
parent | da8110a86ad8b57b8c41873d40aeac346ee66b88 (diff) | |
download | poky-d81e5141c10a97bf5764892f9b20933b751c1da3.tar.gz |
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>
Diffstat (limited to 'bitbake/lib/toaster')
-rw-r--r-- | bitbake/lib/toaster/toastergui/static/css/default.css | 19 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastergui/templates/base.html | 6 | ||||
-rwxr-xr-x | bitbake/lib/toaster/toastergui/views.py | 8 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastermain/settings.py | 5 |
4 files changed, 34 insertions, 4 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/css/default.css b/bitbake/lib/toaster/toastergui/static/css/default.css index 10952547b4..a866773af6 100644 --- a/bitbake/lib/toaster/toastergui/static/css/default.css +++ b/bitbake/lib/toaster/toastergui/static/css/default.css | |||
@@ -2,6 +2,25 @@ | |||
2 | .logo img { height: 30px; width: auto !important; } | 2 | .logo img { height: 30px; width: auto !important; } |
3 | .logo { padding-top: 4px !important; padding-bottom:0px !important; } | 3 | .logo { padding-top: 4px !important; padding-bottom:0px !important; } |
4 | 4 | ||
5 | /* style the version text */ | ||
6 | .version-text { | ||
7 | color: #AAA; | ||
8 | font-size: 0.6em; | ||
9 | display: table-footer-group; | ||
10 | padding: 0px; | ||
11 | margin: 1px 1px 1px 1px; | ||
12 | } | ||
13 | |||
14 | .version-brand, .version-brand:hover, a.version-brand:focus { | ||
15 | color: #777; | ||
16 | display: block; | ||
17 | float: left; | ||
18 | font-size: 20px; | ||
19 | font-weight: 200; | ||
20 | padding: 00px 0px; | ||
21 | text-shadow: 0 1px 0 #fff; | ||
22 | } | ||
23 | |||
5 | /* Style the breadcrumb */ | 24 | /* Style the breadcrumb */ |
6 | .breadcrumb { display: inline-block; background-color: transparent; } | 25 | .breadcrumb { display: inline-block; background-color: transparent; } |
7 | .section { margin: 20px 0; } | 26 | .section { margin: 20px 0; } |
diff --git a/bitbake/lib/toaster/toastergui/templates/base.html b/bitbake/lib/toaster/toastergui/templates/base.html index e95b5e0cac..6f249bcf2d 100644 --- a/bitbake/lib/toaster/toastergui/templates/base.html +++ b/bitbake/lib/toaster/toastergui/templates/base.html | |||
@@ -59,6 +59,12 @@ | |||
59 | <div class="navbar-inner"> | 59 | <div class="navbar-inner"> |
60 | <a class="brand logo" href="#"><img src="{% static 'img/logo.png' %}" class="" alt="Yocto logo project"/></a> | 60 | <a class="brand logo" href="#"><img src="{% static 'img/logo.png' %}" class="" alt="Yocto logo project"/></a> |
61 | <a class="brand" href="/">Toaster</a> | 61 | <a class="brand" href="/">Toaster</a> |
62 | {% if DEBUG %} | ||
63 | <div style="display: inline;" class="version-brand"> | ||
64 | <p class="version-text">version {{TOASTER_VERSION}}</p> | ||
65 | <p class="version-text">{%if MANAGED%}managed{%else%}interactive{%endif%} mode</p> | ||
66 | </div> | ||
67 | {% endif %} | ||
62 | <a class="pull-right manual" target="_blank" href="http://www.yoctoproject.org/documentation/toaster-manual"> | 68 | <a class="pull-right manual" target="_blank" href="http://www.yoctoproject.org/documentation/toaster-manual"> |
63 | <i class="icon-book"></i> | 69 | <i class="icon-book"></i> |
64 | Toaster manual | 70 | Toaster manual |
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index b67a6767b3..4b770ff5db 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
@@ -1709,10 +1709,12 @@ if toastermain.settings.MANAGED: | |||
1709 | 1709 | ||
1710 | # the context processor that supplies data used across all the pages | 1710 | # the context processor that supplies data used across all the pages |
1711 | def managedcontextprocessor(request): | 1711 | def managedcontextprocessor(request): |
1712 | import subprocess | ||
1712 | ret = { | 1713 | ret = { |
1713 | "projects": Project.objects.all(), | 1714 | "projects": Project.objects.all(), |
1714 | "MANAGED" : toastermain.settings.MANAGED, | 1715 | "MANAGED" : toastermain.settings.MANAGED, |
1715 | "DEBUG" : toastermain.settings.DEBUG | 1716 | "DEBUG" : toastermain.settings.DEBUG, |
1717 | "TOASTER_VERSION": toastermain.settings.TOASTER_VERSION, | ||
1716 | } | 1718 | } |
1717 | if 'project_id' in request.session: | 1719 | if 'project_id' in request.session: |
1718 | try: | 1720 | try: |
@@ -3057,7 +3059,9 @@ else: | |||
3057 | return { | 3059 | return { |
3058 | "projects": [], | 3060 | "projects": [], |
3059 | "MANAGED" : toastermain.settings.MANAGED, | 3061 | "MANAGED" : toastermain.settings.MANAGED, |
3060 | "DEBUG" : toastermain.settings.DEBUG | 3062 | "DEBUG" : toastermain.settings.DEBUG, |
3063 | "TOASTER_VERSION": toastermain.settings.TOASTER_VERSION, | ||
3064 | |||
3061 | } | 3065 | } |
3062 | 3066 | ||
3063 | 3067 | ||
diff --git a/bitbake/lib/toaster/toastermain/settings.py b/bitbake/lib/toaster/toastermain/settings.py index ea7c3534da..b6a42c0626 100644 --- a/bitbake/lib/toaster/toastermain/settings.py +++ b/bitbake/lib/toaster/toastermain/settings.py | |||
@@ -211,8 +211,6 @@ MIDDLEWARE_CLASSES = ( | |||
211 | 'django.middleware.csrf.CsrfViewMiddleware', | 211 | 'django.middleware.csrf.CsrfViewMiddleware', |
212 | 'django.contrib.auth.middleware.AuthenticationMiddleware', | 212 | 'django.contrib.auth.middleware.AuthenticationMiddleware', |
213 | 'django.contrib.messages.middleware.MessageMiddleware', | 213 | 'django.contrib.messages.middleware.MessageMiddleware', |
214 | 'django.middleware.cache.UpdateCacheMiddleware', | ||
215 | 'django.middleware.cache.FetchFromCacheMiddleware', | ||
216 | # Uncomment the next line for simple clickjacking protection: | 214 | # Uncomment the next line for simple clickjacking protection: |
217 | # 'django.middleware.clickjacking.XFrameOptionsMiddleware', | 215 | # 'django.middleware.clickjacking.XFrameOptionsMiddleware', |
218 | ) | 216 | ) |
@@ -233,6 +231,9 @@ CACHES = { | |||
233 | from os.path import dirname as DN | 231 | from os.path import dirname as DN |
234 | SITE_ROOT=DN(DN(os.path.abspath(__file__))) | 232 | SITE_ROOT=DN(DN(os.path.abspath(__file__))) |
235 | 233 | ||
234 | import subprocess | ||
235 | TOASTER_VERSION = subprocess.Popen('cd %s; git branch | grep "^* " | tr -d "* "' % SITE_ROOT, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0] | ||
236 | |||
236 | ROOT_URLCONF = 'toastermain.urls' | 237 | ROOT_URLCONF = 'toastermain.urls' |
237 | 238 | ||
238 | # Python dotted path to the WSGI application used by Django's runserver. | 239 | # Python dotted path to the WSGI application used by Django's runserver. |