aboutsummaryrefslogtreecommitdiffstats
path: root/settings/js
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-04-16 12:27:21 +0200
committerRobin Appelman <icewind@owncloud.com>2012-04-16 12:27:21 +0200
commite59c87ee3691b85ef747dc50518f250fdd00af37 (patch)
tree0d010a3e3c2575618663812148a70a4c0d075498 /settings/js
parent5720bd296dbd5f0459ea53c12d488999193801da (diff)
downloadnextcloud-server-e59c87ee3691b85ef747dc50518f250fdd00af37.tar.gz
nextcloud-server-e59c87ee3691b85ef747dc50518f250fdd00af37.zip
reload log after changing log level
Diffstat (limited to 'settings/js')
-rw-r--r--settings/js/admin.js4
-rw-r--r--settings/js/log.js17
2 files changed, 17 insertions, 4 deletions
diff --git a/settings/js/admin.js b/settings/js/admin.js
index a3585f7e1c2..4f295ab6f5d 100644
--- a/settings/js/admin.js
+++ b/settings/js/admin.js
@@ -1,5 +1,7 @@
$(document).ready(function(){
$('#loglevel').change(function(){
- $.post(OC.filePath('settings','ajax','setloglevel.php'), { level: $(this).val() } );
+ $.post(OC.filePath('settings','ajax','setloglevel.php'), { level: $(this).val() },function(){
+ OC.Log.reload();
+ } );
})
}); \ No newline at end of file
diff --git a/settings/js/log.js b/settings/js/log.js
index bccf2c88269..5dd9c94ae0c 100644
--- a/settings/js/log.js
+++ b/settings/js/log.js
@@ -5,16 +5,27 @@
*/
OC.Log={
+ reload:function(count){
+ if(!count){
+ count=OC.Log.loaded;
+ }
+ OC.Log.loaded=0;
+ $('#log tbody').empty();
+ OC.Log.getMore(count);
+ },
levels:['Debug','Info','Warning','Error','Fatal'],
loaded:3,//are initially loaded
- getMore:function(){
- $.get(OC.filePath('settings','ajax','getlog.php'),{offset:OC.Log.loaded,count:10},function(result){
+ getMore:function(count){
+ if(!count){
+ count=10;
+ }
+ $.get(OC.filePath('settings','ajax','getlog.php'),{offset:OC.Log.loaded,count:count},function(result){
if(result.status=='success'){
OC.Log.addEntries(result.data);
$('html, body').animate({scrollTop: $(document).height()}, 800);
}
});
- OC.Log.loaded+=10;
+ OC.Log.loaded+=count;
},
addEntries:function(entries){
for(var i=0;i<entries.length;i++){