##// END OF EJS Templates
diffs: use whole chunk diff to calculate if it's oversized or not....
diffs: use whole chunk diff to calculate if it's oversized or not. - This fixes an issue if a file is added that has very large number of small lines. In this case the time to detect if the diff should be limited was very very long and CPU intensive.

File last commit:

r2015:92ecc3e5 default
r2070:7939c6bf default
Show More
repo_edit_maintenance.mako
66 lines | 1.8 KiB | application/x-mako | MakoHtmlLexer
/ rhodecode / templates / admin / repos / repo_edit_maintenance.mako
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">${_('Maintenance')}</h3>
</div>
<div class="panel-body">
% if c.executable_tasks:
<h4>${_('Perform maintenance tasks for this repo')}</h4>
<span>${_('Following tasks will be performed')}:</span>
<ol>
% for task in c.executable_tasks:
<li>${task}</li>
% endfor
</ol>
<p>
${_('Maintenance can be automated by such api call. Can be called periodically in crontab etc.')}
<br/>
<code>
${h.api_call_example(method='maintenance', args={"repoid": c.repo_info.repo_name})}
</code>
</p>
% else:
<h4>${_('No maintenance tasks for this repo available')}</h4>
% endif
<div id="results" style="display:none; padding: 10px 0px;"></div>
% if c.executable_tasks:
<div class="form">
<div class="fields">
<button class="btn btn-small btn-primary" onclick="executeTask();return false">
${_('Run Maintenance')}
</button>
</div>
</div>
% endif
</div>
</div>
<script>
executeTask = function() {
var btn = $(this);
$('#results').show();
$('#results').html('<h4>${_('Performing Maintenance')}...</h4>');
btn.attr('disabled', 'disabled');
btn.addClass('disabled');
var url = "${h.route_path('edit_repo_maintenance_execute', repo_name=c.repo_info.repo_name)}";
var success = function (data) {
var displayHtml = $('<pre></pre>');
$(displayHtml).append(data);
$('#results').html(displayHtml);
btn.removeAttr('disabled');
btn.removeClass('disabled');
};
ajaxGET(url, success, null);
}
</script>