Show More
@@ -1,66 +1,66 b'' | |||
|
1 | 1 | <div class="panel panel-default"> |
|
2 | 2 | <div class="panel-heading"> |
|
3 | 3 | <h3 class="panel-title">${_('Maintenance')}</h3> |
|
4 | 4 | </div> |
|
5 | 5 | <div class="panel-body"> |
|
6 | 6 | |
|
7 | 7 | % if c.executable_tasks: |
|
8 | 8 | <h4>${_('Perform maintenance tasks for this repo')}</h4> |
|
9 | 9 | |
|
10 | 10 | <span>${_('Following tasks will be performed')}:</span> |
|
11 | 11 | <ol> |
|
12 | 12 | % for task in c.executable_tasks: |
|
13 | 13 | <li>${task}</li> |
|
14 | 14 | % endfor |
|
15 | 15 | </ol> |
|
16 | 16 | <p> |
|
17 | 17 | ${_('Maintenance can be automated by such api call. Can be called periodically in crontab etc.')} |
|
18 | 18 | <br/> |
|
19 | 19 | <code> |
|
20 | 20 | ${h.api_call_example(method='maintenance', args={"repoid": c.repo_info.repo_name})} |
|
21 | 21 | </code> |
|
22 | 22 | </p> |
|
23 | 23 | |
|
24 | 24 | % else: |
|
25 | 25 | <h4>${_('No maintenance tasks for this repo available')}</h4> |
|
26 | 26 | % endif |
|
27 | 27 | |
|
28 | 28 | <div id="results" style="display:none; padding: 10px 0px;"></div> |
|
29 | 29 | |
|
30 | 30 | % if c.executable_tasks: |
|
31 | 31 | <div class="form"> |
|
32 | 32 | <div class="fields"> |
|
33 | 33 | <button class="btn btn-small btn-primary" onclick="executeTask();return false"> |
|
34 | 34 | ${_('Run Maintenance')} |
|
35 | 35 | </button> |
|
36 | 36 | </div> |
|
37 | 37 | </div> |
|
38 | 38 | % endif |
|
39 | 39 | |
|
40 | 40 | </div> |
|
41 | 41 | </div> |
|
42 | 42 | |
|
43 | 43 | |
|
44 | 44 | <script> |
|
45 | 45 | |
|
46 | 46 | executeTask = function() { |
|
47 | 47 | var btn = $(this); |
|
48 | 48 | $('#results').show(); |
|
49 | 49 | $('#results').html('<h4>${_('Performing Maintenance')}...</h4>'); |
|
50 | 50 | |
|
51 | 51 | btn.attr('disabled', 'disabled'); |
|
52 | 52 | btn.addClass('disabled'); |
|
53 | 53 | |
|
54 | var url = "${h.route_path('repo_maintenance_execute', repo_name=c.repo_info.repo_name)}"; | |
|
54 | var url = "${h.route_path('edit_repo_maintenance_execute', repo_name=c.repo_info.repo_name)}"; | |
|
55 | 55 | var success = function (data) { |
|
56 | 56 | var displayHtml = $('<pre></pre>'); |
|
57 | 57 | |
|
58 | 58 | $(displayHtml).append(data); |
|
59 | 59 | $('#results').html(displayHtml); |
|
60 | 60 | btn.removeAttr('disabled'); |
|
61 | 61 | btn.removeClass('disabled'); |
|
62 | 62 | }; |
|
63 | 63 | ajaxGET(url, success, null); |
|
64 | 64 | |
|
65 | 65 | } |
|
66 | 66 | </script> |
General Comments 0
You need to be logged in to leave comments.
Login now