diff --git a/bitbake/lib/webhob/bldviewer/__init__.py b/bitbake/lib/webhob/bldviewer/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/bitbake/lib/webhob/bldviewer/templates/build.html b/bitbake/lib/webhob/bldviewer/templates/build.html new file mode 100644 index 0000000..9a2d412 --- /dev/null +++ b/bitbake/lib/webhob/bldviewer/templates/build.html @@ -0,0 +1,54 @@ + + + + WebHob Build page + + + +

WebHob Builds

+ + + + {% load projecttags %} + + + + + + + + + + + + + + + + + + {% for build in builds %} + + + + + + + + + + + + + + + + + + {% endfor %} + +
OutcomeStarted OnCompleted OnTargetMachineTimeErrorsWarningsCPU usageDisk I/OLogBitbake VersionBuild Name
{{build.get_outcome_display}}{{build.started_on}}{{build.completed_on}}{{build.target}}{{build.machine.name}}{% time_difference build.started_on build.completed_on %}{{build.errors_no}}{{build.warnings_no}}{{build.cpu_usage}}{{build.disk_io}}{{build.cooker_log_path}}{{build.bitbake_version}}{{build.build_name}}
+ + + + diff --git a/bitbake/lib/webhob/bldviewer/templatetags/__init__.py b/bitbake/lib/webhob/bldviewer/templatetags/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/bitbake/lib/webhob/bldviewer/templatetags/projecttags.py b/bitbake/lib/webhob/bldviewer/templatetags/projecttags.py new file mode 100644 index 0000000..9ae6214 --- /dev/null +++ b/bitbake/lib/webhob/bldviewer/templatetags/projecttags.py @@ -0,0 +1,8 @@ +from datetime import datetime +from django import template + +register = template.Library() + +@register.simple_tag +def time_difference(start_time, end_time): + return end_time - start_time diff --git a/bitbake/lib/webhob/bldviewer/urls.py b/bitbake/lib/webhob/bldviewer/urls.py new file mode 100644 index 0000000..3ec2a30 --- /dev/null +++ b/bitbake/lib/webhob/bldviewer/urls.py @@ -0,0 +1,6 @@ +from django.conf.urls import patterns, include, url + + +urlpatterns = patterns('bldviewer.views', + url(r'^$', 'build', name='build'), +) diff --git a/bitbake/lib/webhob/bldviewer/views.py b/bitbake/lib/webhob/bldviewer/views.py new file mode 100644 index 0000000..15a2d1d --- /dev/null +++ b/bitbake/lib/webhob/bldviewer/views.py @@ -0,0 +1,11 @@ +from django.shortcuts import render +from orm.models import Build + + +def build(request): + template = 'build.html' + build_info = Build.objects.all() + + context = {'builds': build_info} + + return render(request, template, context) diff --git a/bitbake/lib/webhob/whbmain/urls.py b/bitbake/lib/webhob/whbmain/urls.py index 04e0352..a15fc1b 100644 --- a/bitbake/lib/webhob/whbmain/urls.py +++ b/bitbake/lib/webhob/whbmain/urls.py @@ -5,8 +5,8 @@ from django.conf.urls import patterns, include, url # admin.autodiscover() urlpatterns = patterns('', + url(r'^build/$', include('bldviewer.urls')), # Examples: - # url(r'^$', 'webhob.views.home', name='home'), # url(r'^webhob/', include('webhob.foo.urls')), # Uncomment the admin/doc line below to enable admin documentation: