* [gentoo-commits] proj/tinderbox-cluster-www:master commit in: python/tbc_www/, python/templates/includes/frontpage/
@ 2015-07-23 14:57 Magnus Granberg
0 siblings, 0 replies; 2+ messages in thread
From: Magnus Granberg @ 2015-07-23 14:57 UTC (permalink / raw
To: gentoo-commits
commit: 84e661c69c15decbcc40d56939361169100d9b1d
Author: Magnus Granberg <zorry <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 23 14:56:39 2015 +0000
Commit: Magnus Granberg <zorry <AT> gentoo <DOT> org>
CommitDate: Thu Jul 23 14:56:39 2015 +0000
URL: https://gitweb.gentoo.org/proj/tinderbox-cluster-www.git/commit/?id=84e661c6
add the main new page
python/tbc_www/urls.py | 1 +
python/tbc_www/views.py | 5 +++--
python/templates/includes/frontpage/new_build_req | 9 ++++++++-
python/templates/includes/frontpage/new_packages | 2 +-
4 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/python/tbc_www/urls.py b/python/tbc_www/urls.py
index 82e9336..193443f 100644
--- a/python/tbc_www/urls.py
+++ b/python/tbc_www/urls.py
@@ -5,4 +5,5 @@ urlpatterns = patterns('tbc_www.views',
url(r'^packages/$', 'categories'),
url(r'^categories/(?P<category_id>\d+)/$', 'packages'),
url(r'^package/(?P<package_id>\d+)/$', 'ebuilds'),
+ url(r'^new/$', 'new_main'),
)
diff --git a/python/tbc_www/views.py b/python/tbc_www/views.py
index 84ff9e6..2559f8d 100644
--- a/python/tbc_www/views.py
+++ b/python/tbc_www/views.py
@@ -112,9 +112,9 @@ def ebuilds(request, package_id):
TmpDict['EK_tmp'] = EbuildsKeywords.objects.filter(EbuildId__Active = True).filter(EbuildId__PackageId__Package = P.PackageId.Package)
return render(request, 'pages/' + pagerequest + '/ebuilds/index.html', TmpDict)
-def new(request):
+def new_main(request):
pagerequest = 'new'
- Lines = 20
+ Lines = 30
adict = {}
TmpDict = default_TmpDict(pagerequest)
TmpDict['EM'] = EbuildsMetadata.objects.filter(Revision = '1.1').order_by('-Id')[:Lines]
@@ -127,6 +127,7 @@ def new(request):
adict2['P'] = BJ.EbuildId.PackageId.Package
adict2['V'] = BJ.EbuildId.Version
adict2['R'] = BJ.EbuildId.PackageId.RepoId.Repo
+ adict2['Status'] = BJ.Status
adict2['title'] = "Setup: " + BJ.SetupId.Setup + "\n" + "Profile: " + BJ.SetupId.Profile + "\n"
BJU = BuildJobsUse.objects.filter(BuildJobId = BJ.BuildJobId)
if not BJU == []:
diff --git a/python/templates/includes/frontpage/new_build_req b/python/templates/includes/frontpage/new_build_req
index 53a3fcb..3a47530 100644
--- a/python/templates/includes/frontpage/new_build_req
+++ b/python/templates/includes/frontpage/new_build_req
@@ -2,7 +2,14 @@
{% for k, v in BJ.items %}
<tr>
<td class="frontpage-table-package-atom"><a href="/new_build_req/{{ k }}" title="{{ v.C }}/{{ v.P }}-{{ v.V }}::{{ v.R }}">{{ v.C }}/{{ v.P }}-{{ v.V }}::{{ v.R }}</a></td>
- <td><p title="{{ v.title }}">{{ v.title|truncatewords:2}}</p></td>
+ <td><p title="{{ v.title }}">{{ v.title|truncatewords:2}}</p>
+ <td class="text-right">
+ {% if v.Status == 'Building' %}
+ <span class="label label-primary">{{ v.Status }}</span>
+ {% else %}
+ <span class="label label-default">{{ v.Status }}</span>
+ {% endif %}
+ </td></td>
</tr>
{% endfor %}
</table>
\ No newline at end of file
diff --git a/python/templates/includes/frontpage/new_packages b/python/templates/includes/frontpage/new_packages
index 7de11c0..6c845b7 100644
--- a/python/templates/includes/frontpage/new_packages
+++ b/python/templates/includes/frontpage/new_packages
@@ -4,7 +4,7 @@
<td class="frontpage-table-package-atom">
<a href="/packages/{{ E.EbuildId.PackageId.PackageId }}/" title="{{ E.EbuildId.PackageId.CategoryId.Category }}/{{ E.EbuildId.PackageId.Package }}-{{ E.EbuildId.Version }}::{{ E.EbuildId.PackageId.RepoId.Repo }}">
{{ E.EbuildId.PackageId.CategoryId.Category }}/{{ E.EbuildId.PackageId.Package }}-{{ E.EbuildId.Version }}::{{ E.EbuildId.PackageId.RepoId.Repo }}</a></td>
- <td><p>{{ E.Descriptions }}</p></td>
+ <td><p title="{{ E.Descriptions }}">{{ E.Descriptions }}</p></td>
</tr>
{% endfor %}
</table>
\ No newline at end of file
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] proj/tinderbox-cluster-www:master commit in: python/tbc_www/, python/templates/includes/frontpage/
@ 2015-07-24 0:18 Magnus Granberg
0 siblings, 0 replies; 2+ messages in thread
From: Magnus Granberg @ 2015-07-24 0:18 UTC (permalink / raw
To: gentoo-commits
commit: f1d51cfa2fe8f8a781dc31e3f6ca7ad6436b8563
Author: Magnus Granberg <zorry <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 24 00:17:26 2015 +0000
Commit: Magnus Granberg <zorry <AT> gentoo <DOT> org>
CommitDate: Fri Jul 24 00:17:26 2015 +0000
URL: https://gitweb.gentoo.org/proj/tinderbox-cluster-www.git/commit/?id=f1d51cfa
fix error, repoman, qa view in new logs
python/tbc_www/models.py | 22 +++++++++++++++---
python/tbc_www/views.py | 34 ++++++++++++++++++++++++----
python/templates/includes/frontpage/new_logs | 26 +++++++++++++++++----
3 files changed, 70 insertions(+), 12 deletions(-)
diff --git a/python/tbc_www/models.py b/python/tbc_www/models.py
index 9827583..621a7dc 100644
--- a/python/tbc_www/models.py
+++ b/python/tbc_www/models.py
@@ -80,8 +80,6 @@ class BuildLogs(models.Model):
BuildLogId = models.IntegerField(primary_key=True, db_column='build_log_id')
EbuildId = models.ForeignKey(Ebuilds, db_column='ebuild_id')
Fail = models.BooleanField(db_column='fail')
- RmQa = models.BooleanField(db_column='rmqa')
- Others = models.BooleanField(db_column='others')
SummeryText = models.TextField(db_column='summery_text')
LogHash = models.CharField(max_length=100, db_column='log_hash')
BugId = models.IntegerField( db_column='bug_id')
@@ -89,7 +87,7 @@ class BuildLogs(models.Model):
class Meta:
db_table = 'build_logs'
def __str__(self):
- return '%s %s %s %s %s %s %s %s %s' % (self.BuildLogId, self.EbuildId, self.Fail, self.RmQa, self.Others, self.SummeryText, self.LogHash, self.BugId, self.TimeStamp)
+ return '%s %s %s %s %s %s %s' % (self.BuildLogId, self.EbuildId, self.Fail, self.SummeryText, self.LogHash, self.BugId, self.TimeStamp)
class BuildLogsRepomanQa(models.Model):
Id = models.IntegerField(primary_key=True, db_column='id')
@@ -100,6 +98,24 @@ class BuildLogsRepomanQa(models.Model):
def __str__(self):
return '%s %s %s' % (self.Id, self.BuildLogId, self.SummeryText)
+class ErrorsInfo(models.Model):
+ ErrorId = models.IntegerField(primary_key=True, db_column='error_id')
+ ErrorName = models.CharField(max_length=20, db_column='error_name')
+ ErrorSearch = models.CharField(max_length=30, db_column='error_search')
+ class Meta:
+ db_table = 'errors_info'
+ def __str__(self):
+ return '%s %s %s' % (self.ErrorId, self.ErrorName, self.ErrorSearch)
+
+class BuildLogsErrors(models.Model):
+ Id = models.IntegerField(primary_key=True, db_column='id')
+ BuildLogId = models.ForeignKey(BuildLogs, db_column='build_log_id')
+ ErrorId = models.ForeignKey(ErrorsInfo, db_column='error_id')
+ class Meta:
+ db_table = 'build_logs_errors'
+ def __str__(self):
+ return '%s %s %s' % (self.Id, self.BuildLogId, self.ErrorId)
+
class Setups(models.Model):
SetupId = models.AutoField(primary_key=True, db_column='setup_id')
Setup = models.CharField(max_length=100, db_column='setup')
diff --git a/python/tbc_www/views.py b/python/tbc_www/views.py
index 2559f8d..f68a706 100644
--- a/python/tbc_www/views.py
+++ b/python/tbc_www/views.py
@@ -7,7 +7,7 @@ from django.conf import settings
from gentoo_www.models import SiteSettings, Layout, Pages, SubPages, Sponsors, Posts
from tbc_www.models import EbuildsMetadata, BuildLogs, BuildJobs, BuildLogsRepomanQa, \
BuildJobsUse, Categories, CategoriesMetadata, Packages, PackagesMetadata, Ebuilds, \
- Repos, EbuildsKeywords
+ Repos, EbuildsKeywords, BuildLogsErrors
import re
def default_TmpDict(pagerequest):
@@ -30,10 +30,22 @@ def default_TmpDict(pagerequest):
def home(request):
pagerequest = 'home'
Lines = 5
- adict = {}
TmpDict = default_TmpDict(pagerequest)
TmpDict['EM'] = EbuildsMetadata.objects.filter(Revision = '1.1').order_by('-Id')[:Lines]
- TmpDict['BL'] = BuildLogs.objects.order_by('-TimeStamp')[:Lines]
+ adict = {}
+ for BL in BuildLogs.objects.order_by('-TimeStamp')[:Lines]:
+ adict2 = {}
+ adict2['C'] = BL.EbuildId.PackageId.CategoryId.Category
+ adict2['P'] = BL.EbuildId.PackageId.Package
+ adict2['V'] = BL.EbuildId.Version
+ adict2['R'] = BL.EbuildId.PackageId.RepoId.Repo
+ adict2['Fail'] = BL.Fail
+ adict2['SummeryText'] = BL.SummeryText
+ if BL.Fail:
+ adict2['BE_tmp'] = BuildLogsErrors.objects.filter(BuildLogId = BL.BuildLogId)
+ adict[BL.BuildLogId] = adict2
+ TmpDict['BL'] = adict
+ adict = {}
BJ_Tmp = BuildJobs.objects.order_by('-TimeStamp')[:Lines]
for BJ in BJ_Tmp:
adict2 = {}
@@ -115,10 +127,22 @@ def ebuilds(request, package_id):
def new_main(request):
pagerequest = 'new'
Lines = 30
- adict = {}
TmpDict = default_TmpDict(pagerequest)
TmpDict['EM'] = EbuildsMetadata.objects.filter(Revision = '1.1').order_by('-Id')[:Lines]
- TmpDict['BL'] = BuildLogs.objects.order_by('-TimeStamp')[:Lines]
+ adict = {}
+ for BL in BuildLogs.objects.order_by('-TimeStamp')[:Lines]:
+ adict2 = {}
+ adict2['C'] = BL.EbuildId.PackageId.CategoryId.Category
+ adict2['P'] = BL.EbuildId.PackageId.Package
+ adict2['V'] = BL.EbuildId.Version
+ adict2['R'] = BL.EbuildId.PackageId.RepoId.Repo
+ adict2['Fail'] = BL.Fail
+ adict2['SummeryText'] = BL.SummeryText
+ if BL.Fail:
+ adict2['BE_tmp'] = BuildLogsErrors.objects.filter(BuildLogId = BL.BuildLogId)
+ adict[BL.BuildLogId] = adict2
+ TmpDict['BL'] = adict
+ adict = {}
BJ_Tmp = BuildJobs.objects.order_by('-TimeStamp')[:Lines]
for BJ in BJ_Tmp:
adict2 = {}
diff --git a/python/templates/includes/frontpage/new_logs b/python/templates/includes/frontpage/new_logs
index 6534201..afe190c 100644
--- a/python/templates/includes/frontpage/new_logs
+++ b/python/templates/includes/frontpage/new_logs
@@ -1,9 +1,27 @@
<table class="table table-striped frontpage-table">
- {% for B in BL %}
+ {% for BuildLogId, B in BL.items %}
<tr>
- <td class="frontpage-table-package-atom"><a href="/new_logs/{{ B.BuildLogId }}/" title="{{ B.EbuildId.PackageId.CategoryId.Category }}/{{ B.EbuildId.PackageId.Package }}-{{ B.EbuildId.Version }}::{{ B.EbuildId.PackageId.RepoId.Repo }}">
- {{ B.EbuildId.PackageId.CategoryId.Category }}/{{ B.EbuildId.PackageId.Package }}-{{ B.EbuildId.Version }}::{{ B.EbuildId.PackageId.RepoId.Repo }}</a></td>
- <td><p title="{{ B.SummeryText }}">{{ B.SummeryText|truncatewords:3 }}</p><td class="text-right">{% if B.Fail %}<span class="label label-danger">Fail</span>{% endif %}</td></td>
+ <td class="frontpage-table-package-atom"><a href="/new_logs/{{ BuildLogId }}/" title="{{ B.C }}/{{ B.P }}-{{ B.V }}::{{ B.R }}">
+ {{ B.C }}/{{ B.P }}-{{ B.V }}::{{ B.R }}</a></td>
+ <td><p title="{{ B.SummeryText }}">{{ B.SummeryText|truncatewords:3 }}</p>
+ <td class="text-right">
+ {% if B.Fail %}
+ {% for BE in B.BE_tmp %}
+ {% if BE.BuildLogId.BuildLogId == BuildLogId %}
+ {% if BE.ErrorId.ErrorId == 1 or BE.ErrorId.ErrorId == 2 %}
+ <span class="label label-warning">{{ BE.ErrorId.ErrorName|upper }}</span>
+ {% elif BE.ErrorId.ErrorId == 3 %}
+ <span class="label label-info">OTHERS</span>
+ {% else %}
+ <span class="label label-danger">{{ BE.ErrorId.ErrorName|upper}}</span>
+ {% endif %}
+ {% endif %}
+ {% endfor %}
+ {% else %}
+ <span class="label label-success">OK</span>
+ {% endif %}
+ </td>
+ </td>
</tr>
{% endfor %}
</table>
\ No newline at end of file
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-07-24 0:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-23 14:57 [gentoo-commits] proj/tinderbox-cluster-www:master commit in: python/tbc_www/, python/templates/includes/frontpage/ Magnus Granberg
-- strict thread matches above, loose matches on Subject: below --
2015-07-24 0:18 Magnus Granberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox