diff options
Diffstat (limited to 'settings')
-rw-r--r-- | settings/ajax/getlog.php | 17 | ||||
-rw-r--r-- | settings/ajax/setquota.php | 5 | ||||
-rw-r--r-- | settings/css/settings.css | 3 | ||||
-rw-r--r-- | settings/js/log.js | 46 | ||||
-rw-r--r-- | settings/log.php | 5 | ||||
-rw-r--r-- | settings/templates/log.php | 5 |
6 files changed, 78 insertions, 3 deletions
diff --git a/settings/ajax/getlog.php b/settings/ajax/getlog.php new file mode 100644 index 00000000000..600ebefcece --- /dev/null +++ b/settings/ajax/getlog.php @@ -0,0 +1,17 @@ +<?php +/** + * Copyright (c) 2012, Robin Appelman <icewind1991@gmail.com> + * This file is licensed under the Affero General Public License version 3 or later. + * See the COPYING-README file. + */ + +// Init owncloud +require_once('../../lib/base.php'); + +OC_JSON::checkAdminUser(); + +$count=(isset($_GET['count']))?$_GET['count']:50; +$offset=(isset($_GET['offset']))?$_GET['offset']:0; + +$entries=OC_Log::getEntries($count,$offset); +OC_JSON::success(array("data" => $entries)); diff --git a/settings/ajax/setquota.php b/settings/ajax/setquota.php index dc87625a05d..f59017600ac 100644 --- a/settings/ajax/setquota.php +++ b/settings/ajax/setquota.php @@ -1,4 +1,9 @@ <?php +/** + * Copyright (c) 2012, Robin Appelman <icewind1991@gmail.com> + * This file is licensed under the Affero General Public License version 3 or later. + * See the COPYING-README file. + */ // Init owncloud require_once('../../lib/base.php'); diff --git a/settings/css/settings.css b/settings/css/settings.css index 7a5873bb4d2..e80de0f1ad2 100644 --- a/settings/css/settings.css +++ b/settings/css/settings.css @@ -40,3 +40,6 @@ select.quota.active { background: #fff; } li { color:#888; } li.active { color:#000; } span.version { margin-left:3em; color:#ddd; } + +/* LOF */ +#log { white-space:normal; }
\ No newline at end of file diff --git a/settings/js/log.js b/settings/js/log.js new file mode 100644 index 00000000000..3814d9c10bf --- /dev/null +++ b/settings/js/log.js @@ -0,0 +1,46 @@ +/** + * Copyright (c) 2012, Robin Appelman <icewind1991@gmail.com> + * This file is licensed under the Affero General Public License version 3 or later. + * See the COPYING-README file. + */ + +OC.Log={ + levels:['Debug','Info','Warning','Error','Fatal'], + loaded:50,//are initially loaded + getMore:function(){ + $.get(OC.filePath('settings','ajax','getlog.php'),{offset:OC.Log.loaded},function(result){ + if(result.status=='success'){ + OC.Log.addEntries(result.data); + } + }); + OC.Log.loaded+=50; + }, + addEntries:function(entries){ + for(var i=0;i<entries.length;i++){ + var entry=entries[i]; + var row=$('<tr/>'); + var levelTd=$('<td/>'); + levelTd.text(OC.Log.levels[entry.level]); + row.append(levelTd); + + var appTd=$('<td/>'); + appTd.text(entry.app); + row.append(appTd); + + var messageTd=$('<td/>'); + messageTd.text(entry.message); + row.append(messageTd); + + var timeTd=$('<td/>'); + timeTd.text(formatDate(entry.time)); + row.append(timeTd); + $('#log').append(row); + } + } +} + +$(document).ready(function(){ + $('#moreLog').click(function(){ + OC.Log.getMore(); + }) +}); diff --git a/settings/log.php b/settings/log.php index 21303c2170f..946f2b6f8e5 100644 --- a/settings/log.php +++ b/settings/log.php @@ -3,7 +3,7 @@ * ownCloud * * @author Robin Appelman - * @copyright 2011 Robin Appelman icewind1991@gmail.com + * @copyright 2012 Robin Appelman icewind1991@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE @@ -30,6 +30,9 @@ OC_App::setActiveNavigationEntry( "core_log" ); $entries=OC_Log::getEntries(); +OC_Util::addScript('settings','log'); +OC_Util::addStyle('settings','settings'); + function compareEntries($a,$b){ return $b->time - $a->time; } diff --git a/settings/templates/log.php b/settings/templates/log.php index bcf5258f5f5..da5defc320e 100644 --- a/settings/templates/log.php +++ b/settings/templates/log.php @@ -9,7 +9,7 @@ $levels=array('Debug','Info','Warning','Error','Fatal'); <div id="controls"> </div> -<table> +<table id='log'> <?php foreach($_['entries'] as $entry):?> <tr> <td> @@ -26,4 +26,5 @@ $levels=array('Debug','Info','Warning','Error','Fatal'); </td> </tr> <?php endforeach;?> -</table>
\ No newline at end of file +</table> +<input id='moreLog' type='button' value='<?php echo $l->t('More');?>...'></input> |