[Bps-public-commit] r16252 - in Pushmi/trunk: . Pushmi-Admin/etc Pushmi-Admin/lib/Pushmi/Admin/Model Pushmi-Admin/share/web/static/css Pushmi-Admin/share/web/static/images/silk

alexmv at bestpractical.com alexmv at bestpractical.com
Wed Oct 8 22:32:52 EDT 2008


Author: alexmv
Date: Wed Oct  8 22:32:51 2008
New Revision: 16252

Added:
   Pushmi/trunk/Pushmi-Admin/share/web/static/images/silk/database_gear.png   (contents, props changed)
Modified:
   Pushmi/trunk/   (props changed)
   Pushmi/trunk/Pushmi-Admin/etc/config.yml
   Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/Model/Replica.pm
   Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/View.pm
   Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/Watcher.pm
   Pushmi/trunk/Pushmi-Admin/share/web/static/css/app.css

Log:
 r38033 at kohr-ah:  chmrr | 2008-10-08 15:51:05 -0400
  * Add per-replica auto-sync configurability
  * Rearrange "advanced" page so buttons are always below text


Modified: Pushmi/trunk/Pushmi-Admin/etc/config.yml
==============================================================================
--- Pushmi/trunk/Pushmi-Admin/etc/config.yml	(original)
+++ Pushmi/trunk/Pushmi-Admin/etc/config.yml	Wed Oct  8 22:32:51 2008
@@ -14,7 +14,7 @@
     Password: ''
     RecordBaseClass: Jifty::DBI::Record::Memcached
     User: ''
-    Version: 0.0.2
+    Version: 0.0.3
   DevelMode: 1
   L10N: 
     PoDir: share/po

Modified: Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/Model/Replica.pm
==============================================================================
--- Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/Model/Replica.pm	(original)
+++ Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/Model/Replica.pm	Wed Oct  8 22:32:51 2008
@@ -46,6 +46,15 @@
         type is 'text',
         is unique, ajax validates;
 
+    column auto_sync_revisions =>
+        type is 'integer',
+        default is 10,
+        since '0.0.3';
+
+    column auto_sync_minutes =>
+        type is 'integer',
+        default is 5,
+        since '0.0.3';
 };
 
 # Ignore all children when they die
@@ -320,8 +329,8 @@
             . $self->remote_revision
             . " revisions mirrored.";
     } elsif ( $status eq "loading" ) {
-        return "Mirroring revisions "
-            . $self->local_revision . " to "
+        return "Mirroring revision "
+            . $self->local_revision . " of "
             . $self->remote_revision;
     } elsif ( $status eq "offline" ) {
         return "Remote master offline!  Mirrored "

Modified: Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/View.pm
==============================================================================
--- Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/View.pm	(original)
+++ Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/View.pm	Wed Oct  8 22:32:51 2008
@@ -409,8 +409,31 @@
 
         form {
             div {
+                { class is "option update" };
+                my $update = $replica->as_update_action;
+                $update->register;
+                p {
+                    outs("This replica should be automatically updated when it is more than ");
+                    outs_raw( $update->form_field("auto_sync_revisions")->render_widget );
+                    outs( " revisions, or ");
+                    outs_raw( $update->form_field("auto_sync_minutes")->render_widget );
+                    outs( " minutes out of date.");
+                };
+                outs_raw(
+                    $update->button(
+                        label => "Update",
+                        url   => "/replica/" . $replica->clean_name,
+                        class => "replica update",
+                    )
+                );
+            }
+
+            div {
                 { class is "option" };
                 my $unlock = Jifty->web->new_action( class => "Unlock" );
+                p {
+                    "This will forcably remove the update lock from the replica.  This should only be used if the process updating the replica has crashed."
+                };
                 outs_raw(
                     $unlock->button(
                         label     => "Force unlock replica",
@@ -419,14 +442,14 @@
                         class     => "replica unlock",
                     )
                 );
-                p {
-                    "This will forcably remove the update lock from the replica.  This should only be used if the process updating the replica has crashed."
-                };
             }
 
             div {
                 { class is "option" };
                 my $delete = $replica->as_delete_action;
+                p {
+                    "This will permanently remove the replica from this Pushmi server."
+                };
                 outs_raw(
                     $delete->button(
                         label   => "Delete replica",
@@ -436,14 +459,15 @@
                             { confirm => 'Really delete this replica?', }
                     )
                 );
-                p {
-                    "This will permanently remove the replica from this Pushmi server."
-                };
             }
 
             div {
                 { class is "option" };
                 my $remirror = Jifty->web->new_action( class => "Remirror" );
+                p {
+                    "This will remove the replica, and immediately re-create it,"
+                        . " remirroring all remote revisions.  This is likely to take a while!";
+                };
                 outs_raw(
                     $remirror->button(
                         label     => "Delete and remirror",
@@ -456,14 +480,17 @@
                         }
                     )
                 );
-                p {
-                    "This will remove the replica, and immediately re-create it,"
-                        . " remirroring all remote revisions.  This is likely to take a while!";
-                };
             }
 
             div {
                 { class is "last option" }
+                p {
+                    outs( "This will download a backup of the replica, as a " );
+                    tt { "gzip"};
+                    outs( "'d ");
+                    tt { "svnadmin dump" };
+                    outs( " file." );
+                };
                 hyperlink(
                     url => "/replica/"
                         . $replica->clean_name . "-"
@@ -472,13 +499,6 @@
                     class     => "replica backup",
                     as_button => 1
                 );
-                p {
-                    outs( "This will download a backup of the replica, as a " );
-                    tt { "gzip"};
-                    outs( "'d ");
-                    tt { "svnadmin dump" };
-                    outs( " file." );
-                };
             }
         };
     }

Modified: Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/Watcher.pm
==============================================================================
--- Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/Watcher.pm	(original)
+++ Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/Watcher.pm	Wed Oct  8 22:32:51 2008
@@ -50,8 +50,8 @@
         # Sync if we're more than 10 revisions, or 5 minutes, behind
         if (    $replica->status eq "behind"
             and $replica->local_revision > 0
-            and ( $replica->remote_revision - $replica->local_revision >= 10
-                or ( time - $replica->cache->{remote_date} >= 5 * 60 ) )
+            and ( $replica->remote_revision - $replica->local_revision >= $replica->auto_sync_revisions
+                or ( time - $replica->cache->{remote_date} >= $replica->auto_sync_minutes * 60 ) )
             )
         {
             $replica->sync;

Modified: Pushmi/trunk/Pushmi-Admin/share/web/static/css/app.css
==============================================================================
--- Pushmi/trunk/Pushmi-Admin/share/web/static/css/app.css	(original)
+++ Pushmi/trunk/Pushmi-Admin/share/web/static/css/app.css	Wed Oct  8 22:32:51 2008
@@ -309,6 +309,7 @@
 
 input.replica.create   { background-image: url(/static/images/silk/database_add.png);       }
 input.replica.sync     { background-image: url(/static/images/silk/database_refresh.png);   }
+input.replica.update   { background-image: url(/static/images/silk/database_gear.png);   }
 input.replica.unlock   { background-image: url(/static/images/silk/database_lightning.png); }
 input.replica.delete   { background-image: url(/static/images/silk/database_delete.png);    }
 input.replica.remirror { background-image: url(/static/images/silk/database_error.png);     }
@@ -317,10 +318,20 @@
 .advanced_options .option p {
   margin: 0;
   padding-left: 1em;
-  padding-top: 1em;
+  padding-bottom: 1em;
+}
+
+.advanced_options .option input.argument-auto_sync_revisions,
+.advanced_options .option input.argument-auto_sync_minutes {
+  display: inline;
+  width: 2em;
 }
 
 .advanced_options .option {
+  border-bottom: 1px dotted #334;
+}
+
+.advanced_options .option.update {
   border-bottom: 1px solid #334;
 }
 

Added: Pushmi/trunk/Pushmi-Admin/share/web/static/images/silk/database_gear.png
==============================================================================
Binary file. No diff available.



More information about the Bps-public-commit mailing list