diff --git a/pandora/log/views.py b/pandora/log/views.py index 8e1b0cb7..b11243bb 100644 --- a/pandora/log/views.py +++ b/pandora/log/views.py @@ -15,7 +15,7 @@ from item import utils import models -def log(request, data): +def logError(request, data): ''' takes { url: string, @@ -43,11 +43,11 @@ def log(request, data): l.save() response = json_response() return render_to_json_response(response) -actions.register(log, cache=False) +actions.register(logError, cache=False) @admin_required_json -def removeLogs(request, data): +def removeErrorLogs(request, data): ''' takes { ids: [string] @@ -57,7 +57,7 @@ def removeLogs(request, data): models.Log.objects.filter(id__in=[ox.fromAZ(i) for i in data['ids']]).delete() response = json_response() return render_to_json_response(response) -actions.register(removeLogs, cache=False) +actions.register(removeErrorLogs, cache=False) def parse_query(data, user): query = {} @@ -84,7 +84,7 @@ def order_query(qs, sort): return qs @admin_required_json -def findLogs(request, data): +def findErrorLogs(request, data): ''' takes { query: { @@ -132,4 +132,4 @@ def findLogs(request, data): else: response['data']['items'] = qs.count() return render_to_json_response(response) -actions.register(findLogs) +actions.register(findErrorLogs) diff --git a/static/js/changelogDialog.js b/static/js/changelogDialog.js index a01dae93..7e93810d 100644 --- a/static/js/changelogDialog.js +++ b/static/js/changelogDialog.js @@ -117,7 +117,7 @@ pandora.ui.changelogDialog = function() { columnsMovable: true, columnsResizable: true, columnsVisible: true, - items: pandora.api.findLogs, + items: pandora.api.findErrorLogs, keys: ['line'], scrollbarVisible: true, sort: [{key: 'created', operator: '-'}], @@ -130,8 +130,8 @@ pandora.ui.changelogDialog = function() { )); }, 'delete': function(data) { - pandora.api.removeLogs({ids: data.ids}, function(result) { - Ox.Request.clearCache('findLogs'); + pandora.api.removeErrorLogs({ids: data.ids}, function(result) { + Ox.Request.clearCache('findErrorLogs'); $list.reloadList(); }); }, diff --git a/static/js/errorlogsDialog.js b/static/js/errorlogsDialog.js index 519c7224..b724534a 100644 --- a/static/js/errorlogsDialog.js +++ b/static/js/errorlogsDialog.js @@ -17,7 +17,7 @@ pandora.ui.errorlogsDialog = function() { .bindEvent({ click: function() { $reloadButton.options({disabled: true}); - Ox.Request.clearCache('findLogs'); + Ox.Request.clearCache('findErrorLogs'); $list.reloadList(true); } }), @@ -118,7 +118,7 @@ pandora.ui.errorlogsDialog = function() { columnsMovable: true, columnsResizable: true, columnsVisible: true, - items: pandora.api.findLogs, + items: pandora.api.findErrorLogs, keys: ['line'], scrollbarVisible: true, sort: [{key: 'created', operator: '-'}], @@ -131,8 +131,8 @@ pandora.ui.errorlogsDialog = function() { )); }, 'delete': function(data) { - pandora.api.removeLogs({ids: data.ids}, function(result) { - Ox.Request.clearCache('findLogs'); + pandora.api.removeErrorLogs({ids: data.ids}, function(result) { + Ox.Request.clearCache('findErrorLogs'); $list.reloadList(); }); }, @@ -226,7 +226,7 @@ pandora.ui.errorlogsDialog = function() { that.superClose = that.close; that.close = function() { - Ox.Request.clearCache('findLogs'); + Ox.Request.clearCache('findErrorLogs'); that.superClose(); }; @@ -253,7 +253,7 @@ pandora.ui.errorlogsDialog = function() { }; $list.options({ items: function(data, callback) { - return pandora.api.findLogs(Ox.extend(data, { + return pandora.api.findErrorLogs(Ox.extend(data, { query: query }), callback); } diff --git a/static/js/pandora.js b/static/js/pandora.js index af437992..ec807fb4 100644 --- a/static/js/pandora.js +++ b/static/js/pandora.js @@ -23,7 +23,7 @@ appPanel window.onerror = function(error, url, line) { try { - !isMSIE && !/^resource:/.test(url) && pandora.api.log({ + !isMSIE && !/^resource:/.test(url) && pandora.api.logError({ text: error, url: document.location.pathname + ' at ' + url, line: line diff --git a/static/js/uploadVideoDialog.js b/static/js/uploadVideoDialog.js index e0ee331f..0e1864bb 100644 --- a/static/js/uploadVideoDialog.js +++ b/static/js/uploadVideoDialog.js @@ -203,7 +203,7 @@ pandora.ui.uploadVideoDialog = function(data) { that.close(); } else { $status.html(Ox._('Upload failed.')); - pandora.api.log({ + pandora.api.logError({ text: data.responseText, url: '/' + item, line: 1 @@ -257,7 +257,7 @@ pandora.ui.uploadVideoDialog = function(data) { that.close(); } else { $status.html(cancelled ? Ox._('Upload cancelled.') : Ox._('Upload failed.')); - !cancelled && pandora.api.log({ + !cancelled && pandora.api.logError({ text: data.responseText, url: '/' + item, line: 1