Add first version of backgroundjobs settings

This commit is contained in:
Jakob Sack 2012-08-09 10:41:10 +02:00
parent 889f0a1c6d
commit 1ce2cd73ff
3 changed files with 48 additions and 1 deletions

View File

@ -0,0 +1,28 @@
<?php
/**
* ownCloud
*
* @author Jakob Sack
* @copyright 2012 Jakob Sack owncloud@jakobsack.de
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
OC_Util::checkAdminUser();
OCP\JSON::callCheck();
OC_Appconfig::setValue( 'core', 'backgroundjob_mode', $_POST['mode'] );
echo 'true';

View File

@ -3,5 +3,11 @@ $(document).ready(function(){
$.post(OC.filePath('settings','ajax','setloglevel.php'), { level: $(this).val() },function(){
OC.Log.reload();
} );
})
});
$('#backgroundjobs input').change(function(){
if($(this).attr('checked')){
$.post(OC.filePath('settings','ajax','setbackgroundjobsmode.php'), { mode: $(this).val() });
}
});
});

View File

@ -24,6 +24,19 @@ if(!$_['htaccessworking']) {
<?php foreach($_['forms'] as $form){
echo $form;
};?>
<fieldset class="personalblock" id="backgroundjobs">
<legend><strong><?php echo $l->t('Cron');?></strong></legend>
<input type="radio" name="mode" value="none" id="backgroundjobs_none">
<label for="backgroundjobs_none">None</label><br />
<input type="radio" name="mode" value="ajax" id="backgroundjobs_ajax">
<label for="backgroundjobs_ajax">AJAX</label><br />
<input type="radio" name="mode" value="webcron" id="backgroundjobs_webcron">
<label for="backgroundjobs_webcron">Webcron</label><br />
<input type="radio" name="mode" value="cron" id="backgroundjobs_cron">
<label for="backgroundjobs_cron">Cron</label><br />
</fieldset>
<fieldset class="personalblock">
<legend><strong><?php echo $l->t('Log');?></strong></legend>
Log level: <select name='loglevel' id='loglevel'>