[Bps-public-commit] r15094 - in Pushmi/trunk: Pushmi-Admin/lib/Pushmi/Admin Pushmi-Admin/lib/Pushmi/Admin/Event Pushmi-Admin/share/web/static/css
alexmv at bestpractical.com
alexmv at bestpractical.com
Tue Aug 12 15:09:41 EDT 2008
Author: alexmv
Date: Tue Aug 12 15:09:27 2008
New Revision: 15094
Modified:
Pushmi/trunk/ (props changed)
Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/Event/ReplicaStatus.pm
Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/View.pm
Pushmi/trunk/Pushmi-Admin/share/web/static/css/app.css
Log:
r35848 at kohr-ah: chmrr | 2008-08-12 15:09:05 -0400
* Move status light into its own region, so it doesn't flicker on status updates during sync
Modified: Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/Event/ReplicaStatus.pm
==============================================================================
--- Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/Event/ReplicaStatus.pm (original)
+++ Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/Event/ReplicaStatus.pm Tue Aug 12 15:09:27 2008
@@ -9,8 +9,8 @@
return if $query->{id} and $self->data->{id} != $query->{id};
if ($query->{tostatus}) {
- return if $self->data->{new} eq $self->data->{old};
- return if $self->data->{new} ne $query->{tostatus};
+ return unless $self->data->{new} ne $self->data->{old};
+ return unless $query->{tostatus} eq "any" or $self->data->{new} eq $query->{tostatus};
}
return 1;
}
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 Tue Aug 12 15:09:27 2008
@@ -20,6 +20,11 @@
div {
{ class is 'replica-element' };
render_region(
+ name => "light-" . $replica->id,
+ path => "/fragments/status-light",
+ arguments => { id => $replica->id }
+ );
+ render_region(
name => "summary-" . $replica->id,
path => "/fragments/summary",
arguments => { id => $replica->id }
@@ -104,11 +109,21 @@
}
};
+template 'fragments/status-light' => sub {
+ my $id = get('id');
+ my $replica = Pushmi::Admin::Model::Replica->load($id);
+ div { { class is 'status-light ' . $replica->status }; };
+ Jifty->subs->update_on(
+ class => 'ReplicaStatus',
+ queries => [{id => $id, tostatus => "any" }],
+ );
+};
+
template 'fragments/summary' => sub {
my $id = get('id');
my $replica = Pushmi::Admin::Model::Replica->load($id);
div {
- { class is 'replica status-light ' . $replica->status };
+ { class is 'replica' };
h3 {
hyperlink(
url => "/replica/" . $replica->clean_name,
@@ -268,6 +283,11 @@
{ class is 'roundbox' };
h2 {"Replica status"};
render_region(
+ name => "light-" . $replica->id,
+ path => "/fragments/status-light",
+ arguments => { id => $replica->id },
+ );
+ render_region(
name => "summary-" . $replica->id,
path => "/fragments/summary",
arguments => { id => $replica->id },
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 Tue Aug 12 15:09:27 2008
@@ -136,9 +136,17 @@
padding-left: 60px;
}
-.replica.status-light {
+.status-light {
background-repeat: no-repeat;
- background-position: 0 10px;
+ background-position: 0 20px;
+ width: 50px;
+ height: 70px;
+ position: absolute;
+ margin-top: 1em;
+}
+
+.replica-element .status-light {
+ margin-top: 0em;
}
.status-light.loading { background-image: url(/static/images/status/blue.gif); }
More information about the Bps-public-commit
mailing list