forked from 0x2620/pandora
add status with used/granted disk usage
This commit is contained in:
parent
146a1ca39a
commit
b9220e6820
1 changed files with 20 additions and 1 deletions
|
@ -87,7 +87,16 @@ pandora.ui.cacheDialog = function() {
|
|||
}
|
||||
}),
|
||||
|
||||
$statusbar = Ox.Bar({size: 16}),
|
||||
$status = $('<div>')
|
||||
.css({
|
||||
width: '100%',
|
||||
marginTop: '2px',
|
||||
fontSize: '9px',
|
||||
textAlign: 'center',
|
||||
textOverflow: 'ellipsis'
|
||||
}),
|
||||
|
||||
$statusbar = Ox.Bar({size: 16}).append($status),
|
||||
|
||||
$panel = Ox.SplitPanel({
|
||||
elements: [
|
||||
|
@ -319,8 +328,18 @@ pandora.ui.cacheDialog = function() {
|
|||
$list.value(file.id, 'progress', file.progress);
|
||||
}
|
||||
});
|
||||
updateStatus();
|
||||
});
|
||||
}
|
||||
function updateStatus() {
|
||||
navigator.webkitPersistentStorage.queryUsageAndQuota(function(usage, quota) {
|
||||
$status.html(
|
||||
Ox.formatValue(usage, 'B', true) + ' of ' + Ox.formatValue(quota, 'B', true)
|
||||
);
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
return that;
|
||||
|
||||
|
|
Loading…
Reference in a new issue