-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsystem-logs.html
221 lines (176 loc) · 11.5 KB
/
system-logs.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
{extends file="admin-layout.tpl"}
{block name="no-return-functions"}
{$admin_current_location = 'configuration'}
{/block}
{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}
{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 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 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 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 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 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}
{block name="javascript-last-call"}
{hook name="system.logs-js" location="system-logs-js" }
{/block}