]> source.dussan.org Git - nextcloud-server.git/commitdiff
reload log after changing log level
authorRobin Appelman <icewind@owncloud.com>
Mon, 16 Apr 2012 10:27:21 +0000 (12:27 +0200)
committerRobin Appelman <icewind@owncloud.com>
Mon, 16 Apr 2012 10:27:21 +0000 (12:27 +0200)
settings/js/admin.js
settings/js/log.js

index a3585f7e1c24113e1da93977f5172d6066702b0d..4f295ab6f5d3fbf4e2e054f1d3ca7ed2d9c4b09b 100644 (file)
@@ -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
index bccf2c88269a3d4b020306cf624b18b22f938c9b..5dd9c94ae0c0acb9bc1a0fb407f79bdc19eeb076 100644 (file)
@@ -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++){