diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-04-16 12:21:12 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-04-16 12:21:48 +0200 |
commit | 5720bd296dbd5f0459ea53c12d488999193801da (patch) | |
tree | 6bb24f9174ee5db421f3a0d0c4d635ecc00d983b /settings | |
parent | 70d0103a675fca4896974f1d59f5e76365304159 (diff) | |
download | nextcloud-server-5720bd296dbd5f0459ea53c12d488999193801da.tar.gz nextcloud-server-5720bd296dbd5f0459ea53c12d488999193801da.zip |
merge log into admin
Diffstat (limited to 'settings')
-rw-r--r-- | settings/admin.php | 9 | ||||
-rw-r--r-- | settings/js/log.js | 7 | ||||
-rw-r--r-- | settings/templates/admin.php | 23 | ||||
-rw-r--r-- | settings/templates/log.php | 30 |
4 files changed, 34 insertions, 35 deletions
diff --git a/settings/admin.php b/settings/admin.php index 9ee79002b5e..a997bad4e3c 100644 --- a/settings/admin.php +++ b/settings/admin.php @@ -10,11 +10,20 @@ OC_Util::checkAdminUser(); OC_Util::addStyle( "settings", "settings" ); OC_Util::addScript( "settings", "admin" ); +OC_Util::addScript( "settings", "log" ); OC_App::setActiveNavigationEntry( "admin" ); $tmpl = new OC_Template( 'settings', 'admin', 'user'); $forms=OC_App::getForms('admin'); + +$entries=OC_Log_Owncloud::getEntries(3); +function compareEntries($a,$b){ + return $b->time - $a->time; +} +usort($entries, 'compareEntries'); + $tmpl->assign('loglevel',OC_Config::getValue( "loglevel", 2 )); +$tmpl->assign('entries',$entries); $tmpl->assign('forms',array()); foreach($forms as $form){ $tmpl->append('forms',$form); diff --git a/settings/js/log.js b/settings/js/log.js index ae83f0a6283..bccf2c88269 100644 --- a/settings/js/log.js +++ b/settings/js/log.js @@ -6,14 +6,15 @@ OC.Log={ levels:['Debug','Info','Warning','Error','Fatal'], - loaded:50,//are initially loaded + loaded:3,//are initially loaded getMore:function(){ - $.get(OC.filePath('settings','ajax','getlog.php'),{offset:OC.Log.loaded},function(result){ + $.get(OC.filePath('settings','ajax','getlog.php'),{offset:OC.Log.loaded,count:10},function(result){ if(result.status=='success'){ OC.Log.addEntries(result.data); + $('html, body').animate({scrollTop: $(document).height()}, 800); } }); - OC.Log.loaded+=50; + OC.Log.loaded+=10; }, addEntries:function(entries){ for(var i=0;i<entries.length;i++){ diff --git a/settings/templates/admin.php b/settings/templates/admin.php index e3fd60fefce..38c6042c82a 100644 --- a/settings/templates/admin.php +++ b/settings/templates/admin.php @@ -10,8 +10,8 @@ $levels=array('Debug','Info','Warning','Error','Fatal'); echo $form; };?> <fieldset class="personalblock"> - <legend><strong><?php echo $l->t('Log level');?></strong></legend> - <select name='loglevel' id='loglevel'> + <legend><strong><?php echo $l->t('Log');?></strong></legend> + Log level: <select name='loglevel' id='loglevel'> <option value='<?php echo $_['loglevel']?>'><?php echo $levels[$_['loglevel']]?></option> <?php for($i=0;$i<5;$i++): if($i!=$_['loglevel']):?> @@ -19,4 +19,23 @@ $levels=array('Debug','Info','Warning','Error','Fatal'); <?php endif; endfor;?> </select> + <table id='log'> + <?php foreach($_['entries'] as $entry):?> + <tr> + <td> + <?php echo $levels[$entry->level];?> + </td> + <td> + <?php echo $entry->app;?> + </td> + <td> + <?php echo $entry->message;?> + </td> + <td> + <?php echo OC_Util::formatDate($entry->time);?> + </td> + </tr> + <?php endforeach;?> +</table> +<input id='moreLog' type='button' value='<?php echo $l->t('More');?>...'></input> </fieldset> diff --git a/settings/templates/log.php b/settings/templates/log.php deleted file mode 100644 index da5defc320e..00000000000 --- a/settings/templates/log.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php /** - * Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com> - * This file is licensed under the Affero General Public License version 3 or later. - * See the COPYING-README file. - */ -$levels=array('Debug','Info','Warning','Error','Fatal'); -?> - -<div id="controls"> - -</div> -<table id='log'> - <?php foreach($_['entries'] as $entry):?> - <tr> - <td> - <?php echo $levels[$entry->level];?> - </td> - <td> - <?php echo $entry->app;?> - </td> - <td> - <?php echo $entry->message;?> - </td> - <td> - <?php echo $l->l('datetime',$entry->time);?> - </td> - </tr> - <?php endforeach;?> -</table> -<input id='moreLog' type='button' value='<?php echo $l->t('More');?>...'></input> |