##// END OF EJS Templates
cache-pages: hide keys by default so they produce less noise when viewing this page with a lot of keys
marcink -
r3889:8e80fcf9 default
parent child Browse files
Show More
@@ -1,142 +1,154 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 ${_('Invalidation keys')}
33 </h3>
33 </h3>
34 </div>
34 </div>
35 <div class="panel-body">
35 <div class="panel-body">
36 <div class="field" >
36 <p>
37 <table class="rctable edit_cache">
37 Cache keys used to signal repository state changes after operations such as push, strip etc.
38 </p>
39 <div class="field">
40 <a href="#showKeys" onclick="$('#signal-keys').toggle()">${_('Show all')} ${len(c.rhodecode_db_repo.cache_keys)}</a>
41
42 <table class="rctable edit_cache" id="signal-keys" style="display: none">
38 <tr>
43 <tr>
39 <th>${_('Key')}</th>
44 <th>${_('Key')}</th>
40 <th>${_('State UID')}</th>
45 <th>${_('State UID')}</th>
41 <th>${_('Namespace')}</th>
46 <th>${_('Namespace')}</th>
42 <th>${_('Active')}</th>
47 <th>${_('Active')}</th>
43 </tr>
48 </tr>
44 %for cache in c.rhodecode_db_repo.cache_keys:
49 %for cache in c.rhodecode_db_repo.cache_keys:
45 <tr>
50 <tr>
46 <td class="td-prefix"><code>${cache.cache_key}</code></td>
51 <td class="td-prefix"><code>${cache.cache_key}</code></td>
47 <td class="td-cachekey"><code>${cache.cache_state_uid}</code></td>
52 <td class="td-cachekey"><code>${cache.cache_state_uid}</code></td>
48 <td class="td-cachekey"><code>${cache.cache_args}</code></td>
53 <td class="td-cachekey"><code>${cache.cache_args}</code></td>
49 <td class="td-active">${h.bool2icon(cache.cache_active)}</td>
54 <td class="td-active">${h.bool2icon(cache.cache_active)}</td>
50 </tr>
55 </tr>
51 %endfor
56 %endfor
52 </table>
57 </table>
53 </div>
58 </div>
54 </div>
59 </div>
55 </div>
60 </div>
56
61
57 <div class="panel panel-default">
62 <div class="panel panel-default">
58 <div class="panel-heading">
63 <div class="panel-heading">
59 <h3 class="panel-title">
64 <h3 class="panel-title">
60 ${_('Cache keys')}
65 ${_('Cache keys')}
61 </h3>
66 </h3>
62 </div>
67 </div>
63 <div class="panel-body">
68 <div class="panel-body">
64 <p>
69 <p>
65 Cache keys used for storing cached values of repository stats,
70 Cache keys used for storing cached values of repository stats,
66 file tree history and file tree search.
71 file tree history and file tree search.
67 Invalidating the cache will remove those entries.
72 Invalidating the cache will remove those entries.
68 </p>
73 </p>
69 <pre>
74 <pre>
70 region: ${c.region.name}
71 backend: ${c.region.actual_backend.__class__}
75 backend: ${c.region.actual_backend.__class__}
72 % if c.rhodecode_user.is_admin:
76 % if c.rhodecode_user.is_admin:
73 store: ${c.region.actual_backend.get_store()}
77 store: ${c.region.actual_backend.get_store()}
74 % else:
78 % else:
75 store: ${c.region.actual_backend.get_store().__class__}
79 store: ${c.region.actual_backend.get_store().__class__}
76 % endif
80 % endif
81 </pre>
77
82
78 % if c.repo_keys:
83 <div class="field">
79 ${len(c.repo_keys)} <a href="#showKeys" onclick="$('#show-keys').toggle()">${_('Show all')}</a>
84 <a href="#showKeys" onclick="$('#cache-keys').toggle()">${_('Show all')} ${len(c.repo_keys)}</a>
80 <span id="show-keys" style="display: none">
81 % for k in c.repo_keys:
82 - ${k}
83 % endfor
84 </span>
85 % else:
86 NO KEYS FOUND
87 % endif
88
85
89 </pre>
86 <table class="rctable edit_cache" id="cache-keys" style="display: none">
87 <tr>
88 <th>${_('Key')}</th>
89 <th>${_('Region')}</th>
90 </tr>
91 %for cache_key in c.repo_keys:
92 <tr>
93 <td class="td-prefix"><code>${cache_key}</code></td>
94 <td class="td-cachekey">${c.region.name}</td>
95 </tr>
96 %endfor
97 </table>
98 </div>
90
99
91 </div>
100 </div>
92 </div>
101 </div>
93
102
94
103
95 <div class="panel panel-default">
104 <div class="panel panel-default">
96 <div class="panel-heading">
105 <div class="panel-heading">
97 <h3 class="panel-title">${_('Shadow Repositories')}</h3>
106 <h3 class="panel-title">${_('Shadow Repositories')}</h3>
98 </div>
107 </div>
99 <div class="panel-body">
108 <div class="panel-body">
100 <table class="rctable edit_cache">
109 <table class="rctable edit_cache">
101 % if c.shadow_repos:
110 % if c.shadow_repos:
102 % for shadow_repo in c.shadow_repos:
111 % for shadow_repo in c.shadow_repos:
103 <tr>
112 <tr>
104 <td>${shadow_repo}</td>
113 <td>${shadow_repo}</td>
105 </tr>
114 </tr>
106 % endfor
115 % endfor
107 % else:
116 % else:
108 <tr>
117 <tr>
109 <td>${_('No Shadow repositories exist for this repository.')}</td>
118 <td>${_('No Shadow repositories exist for this repository.')}</td>
110 </tr>
119 </tr>
111 % endif
120 % endif
112
121
113 </table>
122 </table>
114 </div>
123 </div>
115 </div>
124 </div>
116
125
117
126
118 <div class="panel panel-default">
127 <div class="panel panel-default">
119 <div class="panel-heading">
128 <div class="panel-heading">
120 <h3 class="panel-title">${_('Diff Caches')}</h3>
129 <h3 class="panel-title">${_('Diff Caches')}</h3>
121 </div>
130 </div>
122 <div class="panel-body">
131 <div class="panel-body">
132 <p>
133 Number and size of stored cached diff for commits and pull requests.
134 </p>
123 <table class="rctable edit_cache">
135 <table class="rctable edit_cache">
124 <tr>
136 <tr>
125 <td>${_('Cached diff name')}:</td>
137 <td>${_('Cached diff name')}:</td>
126 % if c.rhodecode_user.is_admin:
138 % if c.rhodecode_user.is_admin:
127 <td>${c.rhodecode_db_repo.cached_diffs_dir}</td>
139 <td>${c.rhodecode_db_repo.cached_diffs_dir}</td>
128 % else:
140 % else:
129 <td>${c.rhodecode_db_repo.cached_diffs_relative_dir}</td>
141 <td>${c.rhodecode_db_repo.cached_diffs_relative_dir}</td>
130 % endif
142 % endif
131 </tr>
143 </tr>
132 <tr>
144 <tr>
133 <td>${_('Cached diff files')}:</td>
145 <td>${_('Cached diff files')}:</td>
134 <td>${c.cached_diff_count}</td>
146 <td>${c.cached_diff_count}</td>
135 </tr>
147 </tr>
136 <tr>
148 <tr>
137 <td>${_('Cached diff size')}:</td>
149 <td>${_('Cached diff size')}:</td>
138 <td>${h.format_byte_size(c.cached_diff_size)}</td>
150 <td>${h.format_byte_size(c.cached_diff_size)}</td>
139 </tr>
151 </tr>
140 </table>
152 </table>
141 </div>
153 </div>
142 </div>
154 </div>
General Comments 0
You need to be logged in to leave comments. Login now