update menu extras

This commit is contained in:
rlx 2016-01-13 10:19:49 +05:30
parent 4dc7a97504
commit 0bb44fc4ef
4 changed files with 31 additions and 32 deletions

View file

@ -6,7 +6,7 @@ oml.ui.connectionButton = function() {
tooltip: Ox._('Transfers')
})
.css({
marginRight: '3px'
marginRight: '6px'
})
.bindEvent({
click: function() {
@ -26,7 +26,7 @@ oml.ui.connectionButton = function() {
function formatBandwidth(up, down) {
return '↓ ' + Ox.formatValue(down, 'B')
+ ' / ↑ ' + Ox.formatValue(up, 'B');
+ ' ↑ ' + Ox.formatValue(up, 'B');
}
oml.bindEvent({

View file

@ -9,8 +9,8 @@ oml.ui.mainMenu = function() {
that = Ox.MainMenu({
extras: [
oml.$ui.connectionButton = oml.ui.connectionButton(),
oml.$ui.updateButton = oml.ui.updateButton(),
oml.$ui.connectionButton = oml.ui.connectionButton(),
oml.$ui.notificationsButton = oml.ui.notificationsButton(),
oml.$ui.loadingIcon = oml.ui.loadingIcon()
],

View file

@ -3,10 +3,10 @@
oml.ui.notificationsButton = function() {
var that = Ox.Element({
tooltip: Ox._('No notifications')
tooltip: Ox._('No peering requests')
})
.css({
marginRight: '3px'
marginRight: '6px'
})
.bindEvent({
click: function() {
@ -16,7 +16,7 @@ oml.ui.notificationsButton = function() {
Ox.Button({
style: 'symbol',
title: 'playlist',
title: 'user',
type: 'image'
})
.css({

View file

@ -3,27 +3,15 @@
oml.ui.updateButton = function() {
var that = Ox.Element({
tooltip: Ox._('Updates Available')
tooltip: Ox._('Software Update')
})
.css({
marginRight: '3px'
}).hide();
function check() {
oml.api.getVersion(function(response) {
if (response.data.update) {
that.show();
} else {
that.hide();
}
});
}
check();
setTimeout(check, 86400000);
marginRight: '6px'
})
.append(
Ox.Button({
style: 'symbol',
title: 'upload',
title: 'set',
type: 'image'
})
.css({
@ -32,13 +20,24 @@ oml.ui.updateButton = function() {
})
.bindEvent({
click: function() {
oml.UI.set({
'page': 'app',
'part.app': 'update'
})
oml.UI.set({page: 'update'})
}
})
.appendTo(that);
)
.hide();
check();
function check() {
oml.api.getVersion(function(result) {
if (result.data.version != oml.version) {
that.show();
} else {
that.hide();
}
});
setTimeout(check, 3600000);
}
return that;