Add the ability to perist the Zuul Status filter with a cookie.
Change-Id: Ib576112bf0050458994da4076750c419fb81f99e
This commit is contained in:
parent
30fd70d0d9
commit
815498ca9c
@ -73,6 +73,33 @@ a:link {
|
|||||||
/* because other wise this floats up off the line */
|
/* because other wise this floats up off the line */
|
||||||
margin-top: 0.25em;
|
margin-top: 0.25em;
|
||||||
}
|
}
|
||||||
|
.projects_filter_container {
|
||||||
|
display: inline-block;
|
||||||
|
position: relative;
|
||||||
|
top: 1.5em;
|
||||||
|
padding-left: .5em;
|
||||||
|
}
|
||||||
|
.projects_filter_container input#projects_filter {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
.projects_filter_container sub {
|
||||||
|
padding: .5em 0;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.projects_filter_container sub a.save-filter {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
.projects_filter_container .hidden {
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
.projects_filter_container img.filter-saved {
|
||||||
|
display: inline-block;
|
||||||
|
position: relative;
|
||||||
|
top: 3px;
|
||||||
|
}
|
||||||
|
.projects_filter_container img.filter-saved.hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
/** Theming for the progress bars to get them consisten across browers:
|
/** Theming for the progress bars to get them consisten across browers:
|
||||||
referenced from http://www.useragentman.com/blog/2012/01/03/cross-browser-html5-progress-bars-in-depth/
|
referenced from http://www.useragentman.com/blog/2012/01/03/cross-browser-html5-progress-bars-in-depth/
|
||||||
@ -186,7 +213,19 @@ progress[aria-valuenow]:before {
|
|||||||
Queue lengths: <span id="trigger_event_queue_length"></span> events,
|
Queue lengths: <span id="trigger_event_queue_length"></span> events,
|
||||||
<span id="result_event_queue_length"></span> results.
|
<span id="result_event_queue_length"></span> results.
|
||||||
|
|
||||||
Filter projects: <input type="text" id="projects_filter" />
|
Filter projects:
|
||||||
|
<span class="projects_filter_container">
|
||||||
|
<input type="text" id="projects_filter" />
|
||||||
|
<!--
|
||||||
|
An embedded 'approved' image.
|
||||||
|
From the famfamfam "Silk" icon set, Creative Commons Attribution 2.5.
|
||||||
|
http://www.famfamfam.com/lab/icons/silk/
|
||||||
|
-->
|
||||||
|
<img class="filter-saved hidden" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAKfSURBVDjLpZPrS1NhHMf9O3bOdmwDCWREIYKEUHsVJBI7mg3FvCxL09290jZj2EyLMnJexkgpLbPUanNOberU5taUMnHZUULMvelCtWF0sW/n7MVMEiN64AsPD8/n83uucQDi/id/DBT4Dolypw/qsz0pTMbj/WHpiDgsdSUyUmeiPt2%2BV7SrIM%2BbSss8ySGdR4abQQv6lrui6VxsRonrGCS9VEjSQ9E7CtiqdOZ4UuTqnBHO1X7YXl6Daa4yGq7vWO1D40wVDtj4kWQbn94myPGkCDPdSesczE2sCZShwl8CzcwZ6NiUs6n2nYX99T1cnKqA2EKui6%2BTwphA5k4yqMayopU5mANV3lNQTBdCMVUA9VQh3GuDMHiVcLCS3J4jSLhCGmKCjBEx0xlshjXYhApfMZRP5CyYD%2BUkG08%2Bxt%2B4wLVQZA1tzxthm2tEfD3JxARH7QkbD1ZuozaggdZbxK5kAIsf5qGaKMTY2lAU/rH5HW3PLsEwUYy%2BYCcERmIjJpDcpzb6l7th9KtQ69fi09ePUej9l7cx2DJbD7UrG3r3afQHOyCo%2BV3QQzE35pvQvnAZukk5zL5qRL59jsKbPzdheXoBZc4saFhBS6AO7V4zqCpiawuptwQG%2BUAa7Ct3UT0hh9p9EnXT5Vh6t4C22QaUDh6HwnECOmcO7K%2B6kW49DKqS2DrEZCtfuI%2B9GrNHg4fMHVSO5kE7nAPVkAxKBxcOzsajpS4Yh4ohUPPWKTUh3PaQEptIOr6BiJjcZXCwktaAGfrRIpwblqOV3YKdhfXOIvBLeREWpnd8ynsaSJoyESFphwTtfjN6X1jRO2%2BFxWtCWksqBApeiFIR9K6fiTpPiigDoadqCEag5YUFKl6Yrciw0VOlhOivv/Ff8wtn0KzlebrUYwAAAABJRU5ErkJggg%3D%3D" />
|
||||||
|
<sub>
|
||||||
|
<a href="#" class="save-filter hidden">Save Filter</a>
|
||||||
|
</sub>
|
||||||
|
</span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -227,6 +227,27 @@ function update_graphs() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function save_filter() {
|
||||||
|
var name = 'zuul-project-filter';
|
||||||
|
var value = $('#projects_filter').val().trim();
|
||||||
|
document.cookie = name+"="+value+"; path=/";
|
||||||
|
$('img.filter-saved').removeClass('hidden');
|
||||||
|
window.setTimeout(function(){
|
||||||
|
$('img.filter-saved').addClass('hidden');
|
||||||
|
}, 1500);
|
||||||
|
}
|
||||||
|
|
||||||
|
function read_cookie(name) {
|
||||||
|
var nameEQ = name + "=";
|
||||||
|
var ca = document.cookie.split(';');
|
||||||
|
for(var i=0;i < ca.length;i++) {
|
||||||
|
var c = ca[i];
|
||||||
|
while (c.charAt(0)==' ') c = c.substring(1,c.length);
|
||||||
|
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
window.zuul_graph_update_count = 0;
|
window.zuul_graph_update_count = 0;
|
||||||
update_timeout();
|
update_timeout();
|
||||||
@ -253,5 +274,16 @@ $(function() {
|
|||||||
val.show(100);
|
val.show(100);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}).live('keyup', function () {
|
||||||
|
$('a.save-filter')
|
||||||
|
.removeClass('hidden')
|
||||||
|
.live('click', function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
$(this).addClass('hidden');
|
||||||
|
save_filter();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
var cookie = read_cookie('zuul-project-filter');
|
||||||
|
if(cookie)
|
||||||
|
$('#projects_filter').val(cookie).change();
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user