update logs dialog

This commit is contained in:
rolux 2011-11-02 17:58:16 +00:00
parent 634eedeab7
commit 7e779aaa7c

View file

@ -56,47 +56,47 @@ pandora.ui.logsDialog = function() {
visible: false, visible: false,
}, },
{ {
id: 'url', id: 'user',
title: 'URL', title: 'User',
operator: '+',
visible: true, visible: true,
width: 420 width: 72
},
{
id: 'line',
title: 'Line',
operator: '+',
visible: true,
width: 48
}, },
{ {
id: 'created',
title: 'Date',
align: 'right',
format: function(value) { format: function(value) {
return value.replace(/[TZ]/g, ' '); return value.replace(/[TZ]/g, ' ');
}, },
align: 'right',
id: 'created',
operator: '-', operator: '-',
title: 'Date',
visible: true, visible: true,
width: 128 width: 144
}, },
{ {
id: 'user', id: 'url',
title: 'User', title: 'URL',
visible: false, format: function(value, data) {
width: 128 return value.split('?')[0] + ':' + data.line;
},
operator: '+',
visible: true,
width: 320
}, },
{ {
id: 'text', id: 'text',
title: 'Text', title: 'Text',
visible: false, tooltip: function(data) {
width: 300 return data.text;
},
visible: true,
width: 640
}, },
], ],
columnsRemovable: true, columnsMovable: true,
columnsResizable: true,
columnsVisible: true, columnsVisible: true,
items: pandora.api.findLogs, items: pandora.api.findLogs,
keys: ['text'], keys: ['line'],
scrollbarVisible: true, scrollbarVisible: true,
sort: [ sort: [
{key: 'created', operator: '-'} {key: 'created', operator: '-'}
@ -110,19 +110,6 @@ pandora.ui.logsDialog = function() {
+ ' log ' + (numberOfLogs == 1 ? 'entry' : 'entries') + ' log ' + (numberOfLogs == 1 ? 'entry' : 'entries')
); );
}, },
select: function(data) {
var values;
$log.empty();
if (data.ids.length) {
values = $list.value(data.ids[0]);
$logLabel.options({
title: values.url
});
$log.append(renderLog(values));
} else {
$logLabel.options({title: 'No logs selected'});
}
},
'delete': function(data) { 'delete': function(data) {
pandora.api.removeLogs({ids: data.ids}, function(result) { pandora.api.removeLogs({ids: data.ids}, function(result) {
$list.reloadList(); $list.reloadList();
@ -131,15 +118,6 @@ pandora.ui.logsDialog = function() {
} }
}), }),
$logLabel = Ox.Label({
textAlign: 'center',
title: 'No logs selected',
width: 604
})
.css({margin: '4px'}),
$log = Ox.Element({}),
that = Ox.Dialog({ that = Ox.Dialog({
buttons: [ buttons: [
Ox.Button({ Ox.Button({
@ -155,9 +133,6 @@ pandora.ui.logsDialog = function() {
], ],
closeButton: true, closeButton: true,
content: Ox.SplitPanel({ content: Ox.SplitPanel({
elements: [
{
element: Ox.SplitPanel({
elements: [ elements: [
{ {
element: Ox.Bar({size: 24}) element: Ox.Bar({size: 24})
@ -172,26 +147,6 @@ pandora.ui.logsDialog = function() {
} }
], ],
orientation: 'vertical' orientation: 'vertical'
})
},
{
element: Ox.SplitPanel({
elements: [
{
element: Ox.Bar({size: 24})
.append($logLabel),
size: 24
},
{
element: $log
}
],
orientation: 'vertical'
}),
size: 612
}
],
orientation: 'horizontal'
}), }),
height: height, height: height,
maximizeButton: true, maximizeButton: true,