users dialog: display bots as bots (comes with better UA parsing, but all this is front-end only, so won't affect sort)

This commit is contained in:
rolux 2012-03-21 06:57:40 +00:00
parent eb58676dd6
commit 2b0a8c4f88

View file

@ -8,6 +8,12 @@ pandora.ui.usersDialog = function() {
dialogWidth = Math.round(window.innerWidth * 0.9), dialogWidth = Math.round(window.innerWidth * 0.9),
formWidth = 256, formWidth = 256,
numberOfUsers = 0, numberOfUsers = 0,
userLevels = Ox.merge(
pandora.site.userLevels.map(function(userLevel) {
return Ox.toTitleCase(userLevel);
}),
['Robot']
),
$reloadButton = Ox.Button({ $reloadButton = Ox.Button({
title: 'redo', title: 'redo',
@ -17,6 +23,7 @@ pandora.ui.usersDialog = function() {
.css({float: 'left', margin: '4px 2px 4px 4px'}) .css({float: 'left', margin: '4px 2px 4px 4px'})
.bindEvent({ .bindEvent({
click: function() { click: function() {
Ox.Request.clearCache('findUsers');
$list.reloadList(true); $list.reloadList(true);
} }
}), }),
@ -121,13 +128,12 @@ pandora.ui.usersDialog = function() {
}, },
{ {
align: 'center', align: 'center',
format: function(value) { format: function(value, data) {
return Ox.Theme.formatColorLevel( return Ox.Theme.formatColorLevel(
pandora.site.userLevels.indexOf(value), data.useragent.indexOf('Googlebot') > -1 || data.username == 'rlx'
pandora.site.userLevels.map(function(userLevel) { ? 5 : pandora.site.userLevels.indexOf(value),
return Ox.toTitleCase(userLevel); userLevels,
}), [0, 300]
[0, 240]
); );
}, },
id: 'level', id: 'level',
@ -235,18 +241,24 @@ pandora.ui.usersDialog = function() {
width: 160 width: 160
}, },
{ {
format: function(value, data) {
return Ox.parseUserAgent(data.useragent).browser.string;
},
id: 'browser', id: 'browser',
operator: '+', operator: '+',
title: 'Browser', title: 'Browser',
visible: true, visible: true,
width: 80 width: 160
}, },
{ {
format: function(value, data) {
return Ox.parseUserAgent(data.useragent).system.string;
},
id: 'system', id: 'system',
operator: '+', operator: '+',
title: 'System', title: 'System',
visible: true, visible: true,
width: 80 width: 160
}, },
{ {
id: 'useragent', id: 'useragent',