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