Finished log configuration. All loggers are currentrly working

This commit is contained in:
Franck Allimant
2013-11-01 16:15:19 +01:00
parent 1dc6aa52cb
commit 2aefb87db7
58 changed files with 2236 additions and 1438 deletions

View File

@@ -167,8 +167,8 @@
{loop type="auth" name="pcc8" role="ADMIN" resource="admin.configuration.system-logs" access="VIEW"}
<tr>
<td><a href="{url path='/admin/configuration/system_logs'}">{intl l='System logs'}</a></td>
<td><a class="btn btn-default btn-xs" href="{url path='/admin/configuration/system_logs'}"><i class="glyphicon glyphicon-edit"></i></a></td>
<td><a href="{url path='/admin/configuration/system-logs'}">{intl l='System logs'}</a></td>
<td><a class="btn btn-default btn-xs" href="{url path='/admin/configuration/system-logs'}"><i class="glyphicon glyphicon-edit"></i></a></td>
</tr>
{/loop}

View File

@@ -3,6 +3,7 @@ A toolbar displayed in forms, to display language change flags, submit and close
Parameters:
- hide_flags: true / false. If true, the flags will not be visible
- hide_submit_buttons: true / false. If true, only the close button will be deplayed.
- show_currencies: true/false. If true, show the currency selection bar
- page_url: the current page URL. Dafault id $current_url. Used to switchedition anguage.
@@ -11,6 +12,7 @@ Parameters:
<div class="row inner-toolbar">
<div class="col-md-3 inner-actions">
{if $hide_flags != true}
<ul class="nav nav-pills">
{loop name="lang_list" type="lang"}
<li {if $ID == $edit_language_id}class="active"{/if}>
@@ -20,6 +22,7 @@ Parameters:
</li>
{/loop}
</ul>
{/if}
</div>
<div class="col-md-3 inner-actions">

View File

@@ -36,7 +36,7 @@
{module_include location='modules_table_row'}
<td>
<td class="text-right">
<div class="btn-group">
{* {loop type="auth" name="can_change" role="ADMIN" resource="admin.modules" access="VIEW"}

View File

@@ -0,0 +1,213 @@
{extends file="admin-layout.tpl"}
{block name="page-title"}{intl l='System Logs'}{/block}
{block name="check-resource"}admin.configuration.variable{/block}
{block name="check-access"}update{/block}
{block name="main-content"}
<div class="variables edit-variable">
<div id="wrapper" class="container">
<ul class="breadcrumb">
<li><a href="{url path='/admin/home'}">{intl l="Home"}</a></li>
<li><a href="{url path='/admin/configuration'}">{intl l="Configuration"}</a></li>
<li>{intl l="System logs"}</li>
</ul>
<div class="row">
<div class="col-md-12 general-block-decorator">
<div class="row">
<div class="col-md-12 title title-without-tabs">
{intl l="System Logs configuration"}
</div>
</div>
<div class="form-container">
<div class="row">
<div class="col-md-12">
{form name='thelia.system-logs.configuration'}
<form method="POST" action="{url path='/admin/configuration/system-logs/save'}">
{form_hidden_fields form=$form}
{include
file = "includes/inner-form-toolbar.html"
hide_flags = true
page_url = "{url path='/admin/configuration/system-logs'}"
close_url = "{url path='/admin/configuration'}"
}
<div class="row">
<div class="col-md-6">
<p class="title title-without-tabs">{intl l='General configuration'}</p>
{if $form_error}
<div class="alert alert-danger">{$form_error_message}</div>
{/if}
<fieldset>
{form_field form=$form field="level"}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label}: </label>
<select name="{$name}" id="{$label_attr.for}" class="form-control">
{foreach $choices as $choice}
<option value="{$choice->value}" {if $value == $choice->value}selected="selected"{/if}>{$choice->label}</option>
{/foreach}
</select>
<span class="help-block">
{intl l='Messages which have a level greater or equal to the selected level will be added to the log destinations. '}
</span>
</div>
{/form_field}
{form_field form=$form field='format'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label}: </label>
<div class="form-group">
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Log lines format'}">
</div>
<span class="help-block">
{intl l='Log lines header format. You may use the following variables: '}
<ul>
<li>#INDEX : {intl l='Sequential number of log line'}</li>
<li>#LEVEL : {intl l='Message level'}</li>
<li>#FILE : {intl l='Originating file name'}</li>
<li>#FUNCTION : {intl l='Originating function name '}</li>
<li>#LINE : {intl l='Originating file line number '}</li>
<li>#DATE : {intl l='date in yyyy-mm-dd format'}</li>
<li>#HOUR : {intl l='hour in hh:mm:ss format'}</li>
</ul>
</span>
</div>
{/form_field}
{form_field form=$form field='show_redirections'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label}: </label>
<div>
<label class="radio-inline">
<input type="radio" name="{$name}" value="1" {if $value == 1}checked="checked"{/if}> {intl l='Yes'}
</label>
<label class="radio-inline">
<input type="radio" name="{$name}" value="0" {if $value == 0}checked="checked"{/if}> {intl l='No'}
</label>
</div>
<span class="help-block">{intl l='If yes, redirections through Redirect::exec() will be displayed as links'}</span>
</div>
{/form_field}
{form_field form=$form field='files'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label}: </label>
<div class="form-group">
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='File names'}">
</div>
<span class="help-block">{intl l='Enter one or more file names without path separated by ";". Use "!" before a file name to exclude it. Use "*" to activate logs for all files.'}</span>
</div>
{/form_field}
{form_field form=$form field='ip_addresses'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label}: </label>
<div class="form-group">
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='IP Addresses'}">
</div>
<span class="help-block">{intl l='Enter one or more IP V4 addresses separated by ";". Leave empty to display logs for all IP addresses'}</span>
<span class="help-block">{intl l='Your current IP address is %ip' ip=$ip_address}</span>
</div>
{/form_field}
</fieldset>
</div>
<div class="col-md-6">
<p class="title title-without-tabs">{intl l='Destinations'}</p>
<div class="alert alert-info">
{intl l='The destinations processes logs to display, store or send them. You can select and configure zero, one or more destinations below.'}
</div>
<fieldset>
{foreach $destinations as $classname => $destination}
{$active = in_array(get_class($destination), $active_destinations)}
<div class="well well-sm">
<input type="hidden" name="destinations[{$classname}][classname]" value="{get_class($destination)}" />
<p class="title title-without-tabs">{$destination->getTitle()}</p>
<p>{$destination->getDescription()}</p>
<div class="form-group">
<div>
<label class="checkbox control-label">
<input type="checkbox" class="activation-checkbox" name="destinations[{$classname}][active]" value="{$classname}" {if $active}checked="checked"{/if}> {intl l='Activate this log destination'}
</label>
</div>
</div>
{if count($destination->getConfigs()) > 0}
<div class="config config-{$classname}" {if ! $active}style="display: none"{/if}>
{foreach $destination->getConfigs() as $config}
<div class="form-group">
<label>{$config->getTitle()}</label>
{if $config->getType() == 2}
<input class="form-control" type="text" name="config[{$classname}][{$config->getName()}]" value="{$config->getValue()}" />
{else if $config->getType() == 1}
<textarea class="form-control" name="config[{$classname}][{$config->getName()}]">{$config->getValue()}</textarea>
{/if}
<span class="help-block">{$config->getLabel()}</span>
</div>
{/foreach}
</div>
{/if}
</div>
{/foreach}
</fieldset>
</div>
</div>
</form>
{/form}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{/block}
{block name="javascript-initialization"}
<script>
$(function() {
$('.activation-checkbox').click(function(ev) {
var classname = $(this).val();
if ($(this).is(':checked')) {
$('.config-'+classname).slideDown();
}
else {
$('.config-'+classname).slideUp();
}
});
});
</script>
{/block}