##// END OF EJS Templates
caches: show full paths for super-admin, hide paths for regular users for security.
marcink -
r3084:34a685d4 default
parent child Browse files
Show More
@@ -1,133 +1,140 b''
1 <div class="panel panel-default">
1 <div class="panel panel-default">
2 <div class="panel-heading">
2 <div class="panel-heading">
3 <h3 class="panel-title">${_('Invalidate Cache for Repository')}</h3>
3 <h3 class="panel-title">${_('Invalidate Cache for Repository')}</h3>
4 </div>
4 </div>
5 <div class="panel-body">
5 <div class="panel-body">
6
6
7 <h4>${_('Manually invalidate the repository cache. On the next access a repository cache will be recreated.')}</h4>
7 <h4>${_('Manually invalidate the repository cache. On the next access a repository cache will be recreated.')}</h4>
8
8
9 <p>
9 <p>
10 ${_('Cache purge can be automated by such api call. Can be called periodically in crontab etc.')}
10 ${_('Cache purge can be automated by such api call. Can be called periodically in crontab etc.')}
11 <br/>
11 <br/>
12 <code>
12 <code>
13 ${h.api_call_example(method='invalidate_cache', args={"repoid": c.rhodecode_db_repo.repo_name})}
13 ${h.api_call_example(method='invalidate_cache', args={"repoid": c.rhodecode_db_repo.repo_name})}
14 </code>
14 </code>
15 </p>
15 </p>
16
16
17 ${h.secure_form(h.route_path('edit_repo_caches', repo_name=c.repo_name), request=request)}
17 ${h.secure_form(h.route_path('edit_repo_caches', repo_name=c.repo_name), request=request)}
18 <div class="form">
18 <div class="form">
19 <div class="fields">
19 <div class="fields">
20 ${h.submit('reset_cache_%s' % c.rhodecode_db_repo.repo_name,_('Invalidate repository cache'),class_="btn btn-small",onclick="return confirm('"+_('Confirm to invalidate repository cache')+"');")}
20 ${h.submit('reset_cache_%s' % c.rhodecode_db_repo.repo_name,_('Invalidate repository cache'),class_="btn btn-small",onclick="return confirm('"+_('Confirm to invalidate repository cache')+"');")}
21 </div>
21 </div>
22 </div>
22 </div>
23 ${h.end_form()}
23 ${h.end_form()}
24
24
25 </div>
25 </div>
26 </div>
26 </div>
27
27
28
28
29 <div class="panel panel-default">
29 <div class="panel panel-default">
30 <div class="panel-heading">
30 <div class="panel-heading">
31 <h3 class="panel-title">
31 <h3 class="panel-title">
32 ${(_ungettext('List of repository caches (%(count)s entry)', 'List of repository caches (%(count)s entries)' ,len(c.rhodecode_db_repo.cache_keys)) % {'count': len(c.rhodecode_db_repo.cache_keys)})}
32 ${(_ungettext('List of repository caches (%(count)s entry)', 'List of repository caches (%(count)s entries)' ,len(c.rhodecode_db_repo.cache_keys)) % {'count': len(c.rhodecode_db_repo.cache_keys)})}
33 </h3>
33 </h3>
34 </div>
34 </div>
35 <div class="panel-body">
35 <div class="panel-body">
36 <div class="field" >
36 <div class="field" >
37 <table class="rctable edit_cache">
37 <table class="rctable edit_cache">
38 <tr>
38 <tr>
39 <th>${_('Key')}</th>
39 <th>${_('Key')}</th>
40 <th>${_('Namespace')}</th>
40 <th>${_('Namespace')}</th>
41 <th>${_('Active')}</th>
41 <th>${_('Active')}</th>
42 </tr>
42 </tr>
43 %for cache in c.rhodecode_db_repo.cache_keys:
43 %for cache in c.rhodecode_db_repo.cache_keys:
44 <tr>
44 <tr>
45 <td class="td-prefix"><code>${cache.cache_key}</code></td>
45 <td class="td-prefix"><code>${cache.cache_key}</code></td>
46 <td class="td-cachekey"><code>${cache.cache_args}</code></td>
46 <td class="td-cachekey"><code>${cache.cache_args}</code></td>
47 <td class="td-active">${h.bool2icon(cache.cache_active)}</td>
47 <td class="td-active">${h.bool2icon(cache.cache_active)}</td>
48 </tr>
48 </tr>
49 %endfor
49 %endfor
50 </table>
50 </table>
51 </div>
51 </div>
52 </div>
52 </div>
53 </div>
53 </div>
54
54
55 <div class="panel panel-default">
55 <div class="panel panel-default">
56 <div class="panel-heading">
56 <div class="panel-heading">
57 <h3 class="panel-title">
57 <h3 class="panel-title">
58 ${_('Cache keys')}
58 ${_('Cache keys')}
59 </h3>
59 </h3>
60 </div>
60 </div>
61 <div class="panel-body">
61 <div class="panel-body">
62 <p>
62 <p>
63 Cache keys used for storing cached values of repository stats,
63 Cache keys used for storing cached values of repository stats,
64 file tree history and file tree search.
64 file tree history and file tree search.
65 Invalidating the cache will remove those entries.
65 Invalidating the cache will remove those entries.
66 </p>
66 </p>
67 <pre>
67 <pre>
68 region: ${c.region.name}
68 region: ${c.region.name}
69 backend: ${c.region.actual_backend.__class__}
69 backend: ${c.region.actual_backend.__class__}
70 % if c.rhodecode_user.is_admin:
70 store: ${c.region.actual_backend.get_store()}
71 store: ${c.region.actual_backend.get_store()}
71
72 % else:
73 store: ${c.region.actual_backend.get_store().__class__}
74 % endif
72
75
73 % if c.repo_keys:
76 % if c.repo_keys:
74 ${len(c.repo_keys)} <a href="#showKeys" onclick="$('#show-keys').toggle()">${_('Show all')}</a>
77 ${len(c.repo_keys)} <a href="#showKeys" onclick="$('#show-keys').toggle()">${_('Show all')}</a>
75 <span id="show-keys" style="display: none">
78 <span id="show-keys" style="display: none">
76 % for k in c.repo_keys:
79 % for k in c.repo_keys:
77 - ${k}
80 - ${k}
78 % endfor
81 % endfor
79 </span>
82 </span>
80 % else:
83 % else:
81 NO KEYS FOUND
84 NO KEYS FOUND
82 % endif
85 % endif
83
86
84 </pre>
87 </pre>
85
88
86 </div>
89 </div>
87 </div>
90 </div>
88
91
89
92
90 <div class="panel panel-default">
93 <div class="panel panel-default">
91 <div class="panel-heading">
94 <div class="panel-heading">
92 <h3 class="panel-title">${_('Shadow Repositories')}</h3>
95 <h3 class="panel-title">${_('Shadow Repositories')}</h3>
93 </div>
96 </div>
94 <div class="panel-body">
97 <div class="panel-body">
95 <table class="rctable edit_cache">
98 <table class="rctable edit_cache">
96 % if c.shadow_repos:
99 % if c.shadow_repos:
97 % for shadow_repo in c.shadow_repos:
100 % for shadow_repo in c.shadow_repos:
98 <tr>
101 <tr>
99 <td>${shadow_repo}</td>
102 <td>${shadow_repo}</td>
100 </tr>
103 </tr>
101 % endfor
104 % endfor
102 % else:
105 % else:
103 <tr>
106 <tr>
104 <td>${_('No Shadow repositories exist for this repository.')}</td>
107 <td>${_('No Shadow repositories exist for this repository.')}</td>
105 </tr>
108 </tr>
106 % endif
109 % endif
107
110
108 </table>
111 </table>
109 </div>
112 </div>
110 </div>
113 </div>
111
114
112
115
113 <div class="panel panel-default">
116 <div class="panel panel-default">
114 <div class="panel-heading">
117 <div class="panel-heading">
115 <h3 class="panel-title">${_('Diff Caches')}</h3>
118 <h3 class="panel-title">${_('Diff Caches')}</h3>
116 </div>
119 </div>
117 <div class="panel-body">
120 <div class="panel-body">
118 <table class="rctable edit_cache">
121 <table class="rctable edit_cache">
119 <tr>
122 <tr>
120 <td>${_('Cached diff name')}:</td>
123 <td>${_('Cached diff name')}:</td>
121 <td>${c.rhodecode_db_repo.cached_diffs_relative_dir}</td>
124 % if c.rhodecode_user.is_admin:
125 <td>${c.rhodecode_db_repo.cached_diffs_dir}</td>
126 % else:
127 <td>${c.rhodecode_db_repo.cached_diffs_relative_dir}</td>
128 % endif
122 </tr>
129 </tr>
123 <tr>
130 <tr>
124 <td>${_('Cached diff files')}:</td>
131 <td>${_('Cached diff files')}:</td>
125 <td>${c.cached_diff_count}</td>
132 <td>${c.cached_diff_count}</td>
126 </tr>
133 </tr>
127 <tr>
134 <tr>
128 <td>${_('Cached diff size')}:</td>
135 <td>${_('Cached diff size')}:</td>
129 <td>${h.format_byte_size(c.cached_diff_size)}</td>
136 <td>${h.format_byte_size(c.cached_diff_size)}</td>
130 </tr>
137 </tr>
131 </table>
138 </table>
132 </div>
139 </div>
133 </div>
140 </div>
General Comments 0
You need to be logged in to leave comments. Login now