report bandwidth, only pull changes

This commit is contained in:
j 2015-12-01 00:26:35 +01:00
commit 68383b8834
8 changed files with 78 additions and 26 deletions

View file

@ -10,24 +10,34 @@ oml.ui.connectionButton = function() {
})
.bindEvent({
// ...
});
}),
bandwidth;
/*
oml.ui.statusIcon(oml.user.online ? 'connected' : 'disconnected')
oml.ui.statusIcon(oml.user)
.css({float: 'left'})
.appendTo(that);
*/
Ox.Element()
function formatBandwidth(up, down) {
return '↓'+Ox.formatValue(down, 'b')+' / ↑'+Ox.formatValue(up, 'b')+'';
}
bandwidth = Ox.Element()
.addClass('OxLight')
.css({
float: 'left',
marginTop: '2px',
fontSize: '9px'
})
.html('↓0K/↑0K')
.html(formatBandwidth(0, 0))
.appendTo(that);
oml.bindEvent({
bandwidth: function(data) {
bandwidth.html(formatBandwidth(data.up, data.down));
}
});
return that;
};
};