Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
406 lines (356 sloc) 11.3 KB
<!DOCTYPE html>
<meta charset="utf-8">
<title>FirefoxOS.Status</title>
<style>
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 9pt;
margin: 0 auto;
/*
background-image: -moz-radial-gradient(center 45deg, circle closest-side, #fff 0%, #DDD 140%);
background-attachment: fixed;
*/
background-color: #fff;
}
#header {
margin: 1em;
}
#container {
margin-top: 2em;
margin-left: auto ;
margin-right: auto ;
}
#content {
margin: 1em;
/*border: 1px solid silver;*/
float: left;
/*max-width: 900px;*/
}
.card {
width: 23em;
height: 15em;
margin: 1em;
background-color: #fff;
box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.2);
/*border: 0.05em solid #ccc;*/
text-align: center;
padding: 0px;
float: left;
}
h1 {
font-size: 10em;
margin: 0;
margin-bottom: -15px;
}
h3 {
font-size: 1.5em;
margin: 0;
}
/*
.ray {
background-color: rgba(255,255,255,.1);
width: 150%;
height: 10px;
position: fixed;
top: 50%;
left: -25%;
-moz-transform:
-moz-transform-origin: 100% 50%;
z-index: -1;
}
*/
</style>
<link rel="stylesheet" href="tipsy.css" type="text/css"/>
<script type='text/javascript' src='jquery-1.8.2.min.js'></script>
<script type='text/javascript' src="jquery.tipsy.js"></script>
<script type='text/javascript' src="bugzilla.js"></script>
<script type='text/javascript' src="date-utils.js"></script>
<script type="text/javascript" src="mustache.js" ></script>
<script type="text/javascript" src="asyncStorage.js" ></script>
<script type="text/javascript" src="eventEmitter.js" ></script>
<script type='text/javascript' src="protovis-r3.2.js"></script>
<script type='text/javascript' src="protovis.tipsy.js"></script>
<script type='text/javascript' src="utils.js"></script>
<script type='text/javascript' src="team.js"></script>
<script type='text/javascript' src="firebase.js"></script>
<script>
/*
object:
- title
- key
- search configuration
- type (count, rich)
- updateInterval
- lastUpdated
- chartType: line, bar
- chartBucket: day/week/month
- chartLength: number
- callback
- type: count
- type: rich
- driver iterates through items, updating if
// every checkInterval minutes, check if the lastUpdated value is >updateInterval
// checkInterval is 1 minute
// updateInterval is 5 minutes
var checkInterval = 1 * 60 * 1000
var updateInterval = 5 * 60 * 1000
// check lastUpdated, and get fresh data if interval has been exceeded
function driver() {
asyncStorage.getItem('lastUpdated', function(lastUpdated) {
if ((new Date()) - lastUpdated > updateInterval)
fetchAll()
})
}
setInterval(driver, checkInterval)
function fetchAll() {
asyncStorage.length(function(length) {
for (var i = 0; i < length; i++) {
asyncStorage.key(function(key) {
})
}
})
}
*/
// add event emitter to window scope
var self = this
EventEmitter.call(self)
/*
var remote = new Firebase('https://mozilla.firebaseio.com/workweek')
remote.on('value', function(value) {
console.log('fb', value.val())
})
*/
$(window).ready(function() {
addBugzillaItem('Open Blockers', 'blockerCount', {
'bug_status': ['NEW', 'UNCONFIRMED', 'READY', 'ASSIGNED', 'REOPENED'],
'field0-0-0': 'cf_blocking_basecamp',
'type0-0-0': 'equals',
'value0-0-0': '+',
})
/*
// example changed-during-period search
addBugzillaItem('Workweek Blockers Fixed', 'workweekBlockersFixed', {
'bug_status': ['RESOLVED', 'VERIFIED'],
'resolution': 'FIXED',
'field0-0-0': 'cf_blocking_basecamp',
'type0-0-0': 'equals',
'value0-0-0': '+',
'changed_field': 'Resolution',
'changed_field_to': 'FIXED',
'changed_after': '2012-11-04',
'changed_before': '2012-11-10',
})
*/
addBugzillaItem('Workweek Blockers Fixed (SUNDAY)', 'workweekBlockersFixedSunday', {
'bug_status': ['RESOLVED', 'VERIFIED'],
'resolution': 'FIXED',
'field0-0-0': 'cf_blocking_basecamp',
'type0-0-0': 'equals',
'value0-0-0': '+',
'changed_field': 'Resolution',
'changed_field_to': 'FIXED',
'changed_after': '2013-01-06 00:00:00',
'changed_before': '2013-01-07 00:00:00',
})
addBugzillaItem('Open Smoketest Blockers', 'smoketestBlockerCount', {
'bug_status': ['NEW', 'UNCONFIRMED', 'READY', 'ASSIGNED', 'REOPENED'],
'keywords': 'smoketest',
'product': 'boot2gecko',
'field0-0-0': 'cf_blocking_basecamp',
'type0-0-0': 'equals',
'value0-0-0': '+',
})
addBugzillaItem('Open Feature Blockers', 'featureBlockerCount', {
'bug_status': ['NEW', 'UNCONFIRMED', 'READY', 'ASSIGNED', 'REOPENED'],
'field0-0-0': 'cf_blocking_basecamp',
'type0-0-0': 'equals',
'value0-0-0': '+',
'keywords': 'feature',
})
addBugzillaItem('Open Dogfood Blockers', 'dogfoodBlockerCount', {
'bug_status': ['NEW', 'UNCONFIRMED', 'READY', 'ASSIGNED', 'REOPENED'],
'field0-0-0': 'cf_blocking_basecamp',
'type0-0-0': 'equals',
'value0-0-0': '+',
'keywords': 'unagi,b2g-testdriver',
})
addBugzillaItem('Blockers Fixed Last 24hrs', 'blockersFixedLastDay', {
'bug_status': ['RESOLVED', 'VERIFIED'],
'resolution': 'FIXED',
'field0-0-0': 'cf_blocking_basecamp',
'type0-0-0': 'equals',
'value0-0-0': '+',
'changed_field': 'Resolution',
'changed_field_to': 'FIXED',
'changed_after': '-1d',
})
addBugzillaItem('Blockers Fixed Last 1hr', 'blockersFixedLastHour', {
'bug_status': ['RESOLVED', 'VERIFIED'],
'resolution': 'FIXED',
'field0-0-0': 'cf_blocking_basecamp',
'type0-0-0': 'equals',
'value0-0-0': '+',
'changed_field': 'Resolution',
'changed_field_to': 'FIXED',
'changed_after': '-1h',
})
addBugzillaItem('Blockers Fixed Last 7 Days', 'blockersFixedLastWeek', {
'bug_status': ['RESOLVED', 'VERIFIED'],
'resolution': 'FIXED',
'field0-0-0': 'cf_blocking_basecamp',
'type0-0-0': 'equals',
'value0-0-0': '+',
'changed_field': 'Resolution',
'changed_field_to': 'FIXED',
'changed_after': '-7d',
})
addBugzillaItem('Blocker Nominations', 'blockerNomCount', {
'field0-0-0': 'cf_blocking_basecamp',
'type0-0-0': 'equals',
'value0-0-0': '?',
})
addSpreadsheetItem('Open User Stories', 'openUserStories', {
url: 'http://spreadsheets.google.com/feeds/cells/0Ajt_meMlK3MOdHphdnV2a2RvcU9MZmd3cDlIQnZBMVE/1/public/values?alt=json-in-script',
row: 6,
column: 2
})
addBugzillaItem('Open C3 Blockers', 'openC3BlockerCount', {
'bug_status': ['NEW', 'UNCONFIRMED', 'READY', 'ASSIGNED', 'REOPENED'],
'field0-0-0': 'cf_blocking_basecamp',
'type0-0-0': 'equals',
'value0-0-0': '+',
'target_milestone': 'B2G C3 (12dec-1jan)',
})
addBugzillaItem('P1 C3 Blockers Fixed Last 7 Days', 'P1C2BlockersFixedLastWeek', {
'bug_status': ['RESOLVED', 'VERIFIED'],
'resolution': 'FIXED',
'field0-0-0': 'cf_blocking_basecamp',
'type0-0-0': 'equals',
'value0-0-0': '+',
'priority': 'P1',
'target_milestone': 'B2G C3 (12dec-1jan)',
'changed_field': 'Resolution',
'changed_field_to': 'FIXED',
'changed_after': '-7d',
})
addBugzillaItem('P2 C3 Blockers Fixed Last 7 Days', 'P2C2BlockersFixedLastWeek', {
'bug_status': ['RESOLVED', 'VERIFIED'],
'resolution': 'FIXED',
'field0-0-0': 'cf_blocking_basecamp',
'type0-0-0': 'equals',
'value0-0-0': '+',
'priority': 'P2',
'target_milestone': 'B2G C3 (12dec-1jan)',
'changed_field': 'Resolution',
'changed_field_to': 'FIXED',
'changed_after': '-7d',
})
addBugzillaItem('P3 C3 Blockers Fixed Last 7 Days', 'P3C2BlockersFixedLastWeek', {
'bug_status': ['RESOLVED', 'VERIFIED'],
'resolution': 'FIXED',
'field0-0-0': 'cf_blocking_basecamp',
'type0-0-0': 'equals',
'value0-0-0': '+',
'priority': 'P3',
'target_milestone': 'B2G C3 (12dec-1jan)',
'changed_field': 'Resolution',
'changed_field_to': 'FIXED',
'changed_after': '-7d',
})
})
function addBugzillaItem(title, key, options) {
addItem(title, key, function(callback) {
Bugzilla.ajax({
url: "/count",
data: options,
success: function(data) {
callback(data.data)
},
error: function(err) {
console.log('err', err)
}
})
})
}
function addSpreadsheetItem(title, key, options) {
addItem(title, key, function(callback) {
getGoogleSpreadsheetCellValue(options.url, options.row, options.column, callback)
})
}
function addItem(title, key, freshDataGetter) {
packStackAndRack(key, function(cachedData) {
if (0 && result) {
self.emit('data', {title: title, data: cachedData})
}
else {
freshDataGetter(function(freshData) {
if (freshData) {
asyncStorage.setItem(key, freshData, function(){})
self.emit('data', {
key: key,
title: title,
data: freshData
})
}
})
}
})
}
self.on('data', function onData(msg) {
if (msg.title && msg.data != null)
addCard(msg.title, msg.data)
})
self.on('feedback', function progress(msg) {
var feedback = document.querySelector('#feedback')
if (!msg)
feedback.innerHTML = ''
else
feedback.innerHTML = "<img src='http://www.fbi.gov/spinner.gif'><br>" + msg
})
self.on('display', function progress(msg) {
console.log(msg.results[0])
var users = getUsersOfBlockers(msg.results)
users.every(function(person) {
var node = $("#templates .entry").clone();
node.find(".blockersGraph").attr("id", "blockersGraph-" + person.name);
node.find(".nonblockersGraph").attr("id", "nonblockersGraph-" + person.name);
node.find(".name").text(person.name);
var dashboard = node.find("a.dashboard");
dashboard.attr("href", dashboard.attr("href") + person.email);
var timerecord = node.find("a.timerecord");
timerecord.attr("href", timerecord.attr("href") + person.email);
var twitterPortrait = new Image();
twitterPortrait.src = "http://static.twitter.com/images/default_profile_bigger.png";
node.find(".portrait").append(twitterPortrait);
$("#content").append(node);
var renderer = makeRenderer(node, person);
getActivity(person.email, WEEKS_BACK, renderer);
return false
});
})
function addCard(title, count) {
var template = '<div class="card" title="{{title}}"><h1>{{count}}</h1><h3>{{title}}</h3></div>'
document.querySelector('#content').innerHTML += Mustache.to_html(template, {
count: count,
title: title
})
}
</script>
<div id='header'>
<h2>FirefoxOS.Status (Live)</h2>
</div>
<div id='container'>
<div id='feedback' style='text-align: center;'></div>
<div id="content"></div>
</div>
<script>
/*
var NUM = 50;
for(var i=0;i<NUM;i++){
var ray = document.createElement("div");
ray.className = "ray";
ray.style.MozTransform = "rotate(%deg)".replace("%", i*360/NUM);
document.body.appendChild(ray);
}
*/
</script>
Something went wrong with that request. Please try again.