From f0eb8cf08c7e0e5202b57b31f6c186eeda92a167 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 17 Nov 2008 23:59:20 +0000 Subject: [PATCH] --- .../lib/HydraFrontend/Controller/Root.pm | 14 +++++ src/HydraFrontend/lib/HydraFrontend/Schema.pm | 4 +- .../lib/HydraFrontend/Schema/Buildinputs.pm | 4 +- .../lib/HydraFrontend/Schema/Buildlogs.pm | 4 +- .../lib/HydraFrontend/Schema/Buildproducts.pm | 4 +- .../HydraFrontend/Schema/Buildresultinfo.pm | 4 +- .../lib/HydraFrontend/Schema/Builds.pm | 4 +- .../Schema/Buildschedulinginfo.pm | 4 +- .../lib/HydraFrontend/Schema/Buildsteps.pm | 4 +- .../HydraFrontend/Schema/Jobsetinputalts.pm | 4 +- .../lib/HydraFrontend/Schema/Jobsetinputs.pm | 4 +- .../lib/HydraFrontend/Schema/Jobsets.pm | 4 +- .../lib/HydraFrontend/Schema/Projects.pm | 6 +- src/HydraFrontend/root/build.tt | 12 +++- src/HydraFrontend/root/common.tt | 9 +++ src/HydraFrontend/root/hydra.css | 12 +++- src/HydraFrontend/root/project.tt | 54 ++++++++---------- .../root/static/images/document.png | Bin 0 -> 2035 bytes .../root/static/images/nix-build.png | Bin 0 -> 2652 bytes .../root/static/images/report.png | Bin 0 -> 1740 bytes src/HydraFrontend/root/static/images/rpm.png | Bin 0 -> 1783 bytes .../root/static/images/source-dist.png | Bin 534 -> 2214 bytes src/hydra.sql | 3 +- 23 files changed, 94 insertions(+), 60 deletions(-) create mode 100644 src/HydraFrontend/root/common.tt create mode 100644 src/HydraFrontend/root/static/images/document.png create mode 100644 src/HydraFrontend/root/static/images/nix-build.png create mode 100644 src/HydraFrontend/root/static/images/report.png create mode 100644 src/HydraFrontend/root/static/images/rpm.png diff --git a/src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm b/src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm index 22e7f12c..ce1fc183 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm @@ -66,6 +66,7 @@ sub updateProject { $project->name($projectName); $project->displayname($displayName); $project->description($c->request->params->{description}); + $project->enabled($c->request->params->{enabled} eq "1" ? 1 : 0); $project->update; @@ -372,6 +373,19 @@ sub download :Local { $c->serve_static_file($path); } + + +sub closure :Local { + my ( $self, $c, $buildId, $productnr ) = @_; + + my $build = getBuild($c, $buildId); + return error($c, "Build with ID $buildId doesn't exist.") if !defined $build; + + my $product = $build->buildproducts->find({productnr => $productnr}); + return error($c, "Build $buildId doesn't have a product $productnr.") if !defined $product; + + return error($c, "Not yet implemented."); +} sub end : ActionClass('RenderView') {} diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema.pm b/src/HydraFrontend/lib/HydraFrontend/Schema.pm index 8485c5a3..293ffb87 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Schema.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Schema.pm @@ -8,8 +8,8 @@ use base 'DBIx::Class::Schema'; __PACKAGE__->load_classes; -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 12:36:40 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KEl9aBHuDTOb+pkc2Wde0A +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 17:09:46 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uZCNqZeWS46Z2RdysLEDaA # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildinputs.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildinputs.pm index 65bad866..f9bffe5a 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildinputs.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildinputs.pm @@ -40,8 +40,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 12:36:40 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:wkxzzlIrlNAnzUlBQMkx/A +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 17:09:46 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:96p2HKZ/6kk0zZKq3JuvDg # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildlogs.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildlogs.pm index 4767ff8e..96df0cb8 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildlogs.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildlogs.pm @@ -21,8 +21,8 @@ __PACKAGE__->set_primary_key("build", "logphase"); __PACKAGE__->belongs_to("build", "HydraFrontend::Schema::Builds", { id => "build" }); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 12:36:40 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:q7krNxyxcF4PlLGT8dmkLQ +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 17:09:46 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zWuDHHMl7eWUWU238D5MWg # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildproducts.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildproducts.pm index 3e33bcf2..429b348e 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildproducts.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildproducts.pm @@ -33,8 +33,8 @@ __PACKAGE__->set_primary_key("build", "productnr"); __PACKAGE__->belongs_to("build", "HydraFrontend::Schema::Builds", { id => "build" }); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 12:36:40 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:60iPYEFvRtct6aHFChM8Eg +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 17:09:46 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kiP5lQxpuaZUZiqHigHYxQ # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildresultinfo.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildresultinfo.pm index 031e5d12..2f6cf7de 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildresultinfo.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildresultinfo.pm @@ -25,8 +25,8 @@ __PACKAGE__->set_primary_key("id"); __PACKAGE__->belongs_to("id", "HydraFrontend::Schema::Builds", { id => "id" }); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 12:36:40 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:twJAkSC32lJGcGItKegomg +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 17:09:46 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:MqQ972Qn6sjoWbbbzmE1cg # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Builds.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Builds.pm index b4520229..45322303 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Schema/Builds.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Builds.pm @@ -79,8 +79,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 12:36:40 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kTvNLSNfUxIbzFQ82v+AHg +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 17:09:46 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:yYcxVJ1KnjD3KKWt4XQFMg __PACKAGE__->has_many(dependents => 'HydraFrontend::Schema::Buildinputs', 'dependency'); diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildschedulinginfo.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildschedulinginfo.pm index 7fda16a5..fdb72a93 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildschedulinginfo.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildschedulinginfo.pm @@ -23,8 +23,8 @@ __PACKAGE__->set_primary_key("id"); __PACKAGE__->belongs_to("id", "HydraFrontend::Schema::Builds", { id => "id" }); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 12:36:40 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:a9oTOE0Aw1nHAamSOf+AVw +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 17:09:46 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uAs9z69gMZRAQSzvOGsqEQ # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildsteps.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildsteps.pm index 9b3cab72..63275c67 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildsteps.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildsteps.pm @@ -35,8 +35,8 @@ __PACKAGE__->set_primary_key("id", "stepnr"); __PACKAGE__->belongs_to("id", "HydraFrontend::Schema::Builds", { id => "id" }); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 12:36:40 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:8JPNCq31oRo9w3tQGPpwMw +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 17:09:46 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mM/rt5x2l2wMZn+EnctifQ # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsetinputalts.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsetinputalts.pm index 6653ee41..233437b6 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsetinputalts.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsetinputalts.pm @@ -31,8 +31,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 12:36:40 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:EVQbKQiSBV7xXLVym+lUxQ +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 17:09:46 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xj0LojYsbdSMWCv+KUH8sw # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsetinputs.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsetinputs.pm index 0e643ff8..e238f358 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsetinputs.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsetinputs.pm @@ -43,8 +43,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 12:36:40 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:DcDEOgQY24GPqdhDlleLsQ +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 17:09:46 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:VO/SU4tv5UxNAmiwsqn6UA # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsets.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsets.pm index fc7bb8f7..ff423bba 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsets.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsets.pm @@ -48,8 +48,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 12:36:40 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:nsVTqxR1wQaamEpy5nNOTQ +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 17:09:46 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jZ0kG9EzEJn5mJFSp2WFpw # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Projects.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Projects.pm index 2e59a536..b392e2f2 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Schema/Projects.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Projects.pm @@ -14,6 +14,8 @@ __PACKAGE__->add_columns( { data_type => "text", is_nullable => 0, size => undef }, "description", { data_type => "VARCHAR", is_nullable => 0, size => undef }, + "enabled", + { data_type => "integer", is_nullable => 0, size => undef }, ); __PACKAGE__->set_primary_key("name"); __PACKAGE__->has_many( @@ -28,8 +30,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 12:36:40 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:TNoQBA0pY/OwfunCJ+/9Gw +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-17 17:09:46 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:XkQtF1ABmLxvxND62rBlCw # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/HydraFrontend/root/build.tt b/src/HydraFrontend/root/build.tt index 7a85c182..082c24f2 100644 --- a/src/HydraFrontend/root/build.tt +++ b/src/HydraFrontend/root/build.tt @@ -1,4 +1,5 @@ [% WRAPPER layout.tt title="Hydra Overview" %] +[% PROCESS common.tt %] [% USE date %] [% USE mibs=format("%.2f") %] @@ -122,7 +123,7 @@ [% FOREACH input IN build.inputs -%] [% input.name %] - [% input.type %] + [% type = input.type; inputTypes.$type %] [% IF input.type == "build" %] Job [% input.dependency.project.name %]:[% input.dependency.attrname %] build [% input.dependency.id %] @@ -200,7 +201,10 @@ [% SWITCH product.type %] [% CASE "nix-build" %] - Nix build of path [% product.path %] + + Source + Nix build of path [% product.path %] + [% CASE "file" %] @@ -208,7 +212,7 @@ [% CASE "source-dist" %] Source Source distribution [% product.name %] [% CASE "rpm" %] - RPM RPM package [% product.name %] + RPM RPM package [% product.name %] [% CASE DEFAULT %] File [% product.name %] of type [% product.subtype %] [% END %] @@ -234,6 +238,7 @@ [% CASE "report" %] + Report [% SWITCH product.subtype %] [% CASE "coverage" %] Code coverage analysis report @@ -245,6 +250,7 @@ [% CASE "doc" %] + Document [% SWITCH product.subtype %] [% CASE "readme" %] “README” file diff --git a/src/HydraFrontend/root/common.tt b/src/HydraFrontend/root/common.tt new file mode 100644 index 00000000..49601ff7 --- /dev/null +++ b/src/HydraFrontend/root/common.tt @@ -0,0 +1,9 @@ +[% inputTypes = + { "svn" = "Subversion checkout" + , "cvs" = "CVS checkout" + , "tarball" = "Download of a tarball" + , "string" = "String value" + , "path" = "Local path" + , "build" = "Build output" + } +%] diff --git a/src/HydraFrontend/root/hydra.css b/src/HydraFrontend/root/hydra.css index eb2fdede..2c610fab 100644 --- a/src/HydraFrontend/root/hydra.css +++ b/src/HydraFrontend/root/hydra.css @@ -360,9 +360,17 @@ input.string { font-family: sans-serif; font-size: 100%; background-color: #fffff0; - width: 30em; + width: 13em; } input.shortString { - width: 10em; + width: 7em; } + +select { + background-color: #fffff0; +} + +button { + background-color: #f0f0e0; +} \ No newline at end of file diff --git a/src/HydraFrontend/root/project.tt b/src/HydraFrontend/root/project.tt index 4ac0b3fa..e10c0ed1 100644 --- a/src/HydraFrontend/root/project.tt +++ b/src/HydraFrontend/root/project.tt @@ -1,7 +1,21 @@ [% WRAPPER layout.tt title="Hydra Overview" %] +[% PROCESS common.tt %] [% USE HTML %] +[% BLOCK renderSelection %] + [% IF edit %] + + [% ELSE %] + [% options.$curValue %] + [% END %] +[% END %] + + [% BLOCK maybeEditString %] [% IF edit %] param, name => param, value => value) %] /> @@ -11,22 +25,6 @@ [% END %] -[% BLOCK renderInputType %] - [% SWITCH type %] - [% CASE "svn" %]Subversion checkout - [% CASE "cvs" %]CVS checkout - [% CASE "tarball" %]Download of a tarball - [% CASE "string" %]String value - [% CASE "path" %]Local path - [% END %] -[% END %] - - -[% BLOCK renderInputTypeOption %] - -[% END %] - - [% BLOCK renderInput %] @@ -39,17 +37,7 @@ [% INCLUDE maybeEditString param="$baseName-name" value=input.name extraClass="shortString" %] - [% IF edit %] - - [% ELSE %] - [% INCLUDE renderInputType type=input.type %] - [% END %] + [% INCLUDE renderSelection curValue=input.type param="$baseName-type" options=inputTypes %] [% FOREACH alt IN input.jobsetinputalts -%] @@ -58,7 +46,7 @@ "[% HTML.escape(alt.value) %]" [% ELSE %] [% INCLUDE maybeEditString param="$baseName-values" value=alt.value %] - [% IF edit %][X][% END %] + [% IF edit %][X]
[% END %] [% END %] [% END %] @@ -153,6 +141,12 @@ Description: [% INCLUDE maybeEditString param="description" value=curProject.description %] + + Enabled: + + [% INCLUDE renderSelection param="enabled" curValue=curProject.enabled options={"1" = "Yes", "0" = "No"} %] + + @@ -278,14 +272,14 @@
-

+

[% IF !create %]
-

+