audit-logs: improve help text, and expose all audit commands for easier filtering +ui fixes
This commit is contained in:
parent
c3519ccca6
commit
8bb0fee018
5 changed files with 44 additions and 31 deletions
|
|
@ -29,6 +29,7 @@ import os
|
|||
import random
|
||||
import hashlib
|
||||
import StringIO
|
||||
import textwrap
|
||||
import urllib
|
||||
import math
|
||||
import logging
|
||||
|
|
@ -1864,6 +1865,8 @@ def get_permission_name(key):
|
|||
|
||||
def journal_filter_help(request):
|
||||
_ = request.translate
|
||||
from rhodecode.lib.audit_logger import ACTIONS
|
||||
actions = '\n'.join(textwrap.wrap(', '.join(sorted(ACTIONS.keys())), 80))
|
||||
|
||||
return _(
|
||||
'Example filter terms:\n' +
|
||||
|
|
@ -1875,6 +1878,8 @@ def journal_filter_help(request):
|
|||
' date:20120101\n' +
|
||||
' date:[20120101100000 TO 20120102]\n' +
|
||||
'\n' +
|
||||
'Actions: {actions}\n' +
|
||||
'\n' +
|
||||
'Generate wildcards using \'*\' character:\n' +
|
||||
' "repository:vcs*" - search everything starting with \'vcs\'\n' +
|
||||
' "repository:*vcs*" - search for repository containing \'vcs\'\n' +
|
||||
|
|
@ -1882,7 +1887,7 @@ def journal_filter_help(request):
|
|||
'Optional AND / OR operators in queries\n' +
|
||||
' "repository:vcs OR repository:test"\n' +
|
||||
' "username:test AND repository:test*"\n'
|
||||
)
|
||||
).format(actions=actions)
|
||||
|
||||
|
||||
def search_filter_help(searcher, request):
|
||||
|
|
|
|||
|
|
@ -14,12 +14,14 @@
|
|||
<input type='submit' value="${_('filter')}" class="btn" />
|
||||
${_('Audit logs')} - ${_ungettext('%s entry', '%s entries', c.audit_logs.item_count) % (c.audit_logs.item_count)}
|
||||
${h.end_form()}
|
||||
<p class="tooltip filterexample" title="${h.tooltip(h.journal_filter_help(request))}">${_('Example Queries')}</p>
|
||||
<p class="filterexample" style="position: inherit" onclick="$('#search-help').toggle()">${_('Example Queries')}</p>
|
||||
<pre id="search-help" style="display: none">${h.tooltip(h.journal_filter_help(request))}</pre>
|
||||
</%def>
|
||||
|
||||
<%def name="menu_bar_nav()">
|
||||
${self.menu_items(active='admin')}
|
||||
</%def>
|
||||
|
||||
<%def name="main()">
|
||||
<div class="box">
|
||||
<!-- box / title -->
|
||||
|
|
|
|||
|
|
@ -14,7 +14,9 @@
|
|||
<input class="q_filter_box ${'' if c.filter_term else 'initial'}" id="j_filter" size="15" type="text" name="filter" value="${c.filter_term or ''}" placeholder="${_('audit filter...')}"/>
|
||||
<input type='submit' value="${_('filter')}" class="btn" />
|
||||
${h.end_form()}
|
||||
<p class="tooltip filterexample" style="position: inherit" title="${h.tooltip(h.journal_filter_help(request))}">${_('Example Queries')}</p>
|
||||
|
||||
<p class="filterexample" style="position: inherit" onclick="$('#search-help').toggle()">${_('Example Queries')}</p>
|
||||
<pre id="search-help" style="display: none">${h.tooltip(h.journal_filter_help(request))}</pre>
|
||||
|
||||
<%include file="/admin/admin_log_base.mako" />
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,9 @@
|
|||
<input class="q_filter_box ${'' if c.filter_term else 'initial'}" id="j_filter" size="15" type="text" name="filter" value="${c.filter_term or ''}" placeholder="${_('audit filter...')}"/>
|
||||
<input type='submit' value="${_('filter')}" class="btn" />
|
||||
${h.end_form()}
|
||||
<p class="tooltip filterexample" style="position: inherit" title="${h.tooltip(h.journal_filter_help(request))}">${_('Example Queries')}</p>
|
||||
|
||||
<p class="filterexample" style="position: inherit" onclick="$('#search-help').toggle()">${_('Example Queries')}</p>
|
||||
<pre id="search-help" style="display: none">${h.tooltip(h.journal_filter_help(request))}</pre>
|
||||
|
||||
<%include file="/admin/admin_log_base.mako" />
|
||||
|
||||
|
|
|
|||
|
|
@ -7,19 +7,20 @@
|
|||
%endif
|
||||
</%def>
|
||||
|
||||
<%def name="breadcrumbs()">
|
||||
<h1 class="block-left">
|
||||
<%def name="breadcrumbs_links()">
|
||||
${h.form(None, id_="filter_form", method="get")}
|
||||
<input class="q_filter_box ${'' if c.search_term else 'initial'}" id="j_filter" size="15" type="text" name="filter" value="${c.search_term}" placeholder="${_('quick filter...')}"/>
|
||||
<input type='submit' value="${_('Filter')}" class="btn" />
|
||||
<input type='submit' value="${_('filter')}" class="btn" />
|
||||
${_('Journal')} - ${_ungettext('%s entry', '%s entries', c.journal_pager.item_count) % (c.journal_pager.item_count)}
|
||||
${h.end_form()}
|
||||
</h1>
|
||||
<p class="tooltip filterexample" title="${h.tooltip(h.journal_filter_help(request))}">${_('Example Queries')}</p>
|
||||
<p class="filterexample" style="position: inherit" onclick="$('#search-help').toggle()">${_('Example Queries')}</p>
|
||||
<pre id="search-help" style="display: none">${h.tooltip(h.journal_filter_help(request))}</pre>
|
||||
</%def>
|
||||
|
||||
<%def name="menu_bar_nav()">
|
||||
${self.menu_items(active='journal')}
|
||||
</%def>
|
||||
|
||||
<%def name="head_extra()">
|
||||
<link href="${h.route_path('journal_atom', _query=dict(auth_token=c.rhodecode_user.feed_token))}" rel="alternate" title="${_('ATOM journal feed')}" type="application/atom+xml" />
|
||||
<link href="${h.route_path('journal_rss', _query=dict(auth_token=c.rhodecode_user.feed_token))}" rel="alternate" title="${_('RSS journal feed')}" type="application/rss+xml" />
|
||||
|
|
@ -27,30 +28,31 @@
|
|||
|
||||
<%def name="main()">
|
||||
|
||||
<div class="box">
|
||||
<!-- box / title -->
|
||||
<div class="title journal">
|
||||
${self.breadcrumbs()}
|
||||
<ul class="links icon-only-links block-right">
|
||||
<li>
|
||||
<span><a id="refresh" href="${h.route_path('journal')}"><i class="icon-refresh"></i></a></span>
|
||||
</li>
|
||||
<li>
|
||||
<span><a href="${h.route_path('journal_atom', _query=dict(auth_token=c.rhodecode_user.feed_token))}"><i class="icon-rss-sign"></i></a></span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="journal">${c.journal_data|n}</div>
|
||||
<div class="box">
|
||||
<!-- box / title -->
|
||||
<div class="title journal">
|
||||
${self.breadcrumbs()}
|
||||
<ul class="links icon-only-links block-right">
|
||||
<li>
|
||||
<span><a id="refresh" href="${h.route_path('journal')}"><i class="icon-refresh"></i></a></span>
|
||||
</li>
|
||||
<li>
|
||||
<span><a href="${h.route_path('journal_atom', _query=dict(auth_token=c.rhodecode_user.feed_token))}"><i class="icon-rss-sign"></i></a></span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="journal">${c.journal_data|n}</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
<script type="text/javascript">
|
||||
|
||||
$('#j_filter').autoGrowInput();
|
||||
$(document).on('pjax:success',function(){
|
||||
show_more_event();
|
||||
});
|
||||
$(document).pjax('#refresh', '#journal',
|
||||
{url: "${request.current_route_path(_query=dict(filter=c.search_term))}", push: false});
|
||||
$('#j_filter').autoGrowInput();
|
||||
$(document).on('pjax:success',function(){
|
||||
show_more_event();
|
||||
});
|
||||
$(document).pjax(
|
||||
'#refresh', '#journal',
|
||||
{url: "${request.current_route_path(_query=dict(filter=c.search_term))}", push: false});
|
||||
|
||||
</script>
|
||||
</script>
|
||||
</%def>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue