Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Improvements to the /clusterlist page. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
e3ef536c6979e4a08374fd4d754f1bae |
| User & Date: | drh 2024-12-20 15:14:42.685 |
Context
|
2024-12-20
| ||
| 15:27 | Fix a typo in a column name for the query that deals with phantom entries in the info page for clusters. check-in: 72a218cecf user: drh tags: trunk | |
| 15:14 | Improvements to the /clusterlist page. check-in: e3ef536c69 user: drh tags: trunk | |
| 15:04 | Add the /clusterlist webpage. check-in: a2ce1f109a user: drh tags: trunk | |
Changes
Changes to src/name.c.
| ︙ | ︙ | |||
2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 |
** WEBPAGE: clusterlist
**
** Show information about all cluster artifacts in the database.
** This page is accessible by administrators only.
*/
void clusterlist_page(void){
Stmt q;
login_check_credentials();
if( !g.perm.Admin ){ login_needed(g.anon.Admin); return; }
style_header("All Cluster Artifacts");
db_prepare(&q,
"SELECT blob.uuid, "
" datetime(rcvfrom.mtime),"
" user.login,"
" rcvfrom.ipaddr"
" FROM tagxref JOIN blob ON tagxref.rid=blob.rid"
" LEFT JOIN rcvfrom ON blob.rcvid=rcvfrom.rcvid"
" LEFT JOIN user ON user.uid=rcvfrom.uid"
" WHERE tagxref.tagid=%d"
" ORDER BY rcvfrom.mtime, blob.uuid",
TAG_CLUSTER
);
@ <table cellpadding="2" cellspacing="0" border="1">
| > > > | > | | | > > | > > | 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 |
** WEBPAGE: clusterlist
**
** Show information about all cluster artifacts in the database.
** This page is accessible by administrators only.
*/
void clusterlist_page(void){
Stmt q;
int cnt = 1;
sqlite3_int64 szTotal = 0;
login_check_credentials();
if( !g.perm.Admin ){ login_needed(g.anon.Admin); return; }
style_header("All Cluster Artifacts");
db_prepare(&q,
"SELECT blob.uuid, "
" blob.size, "
" datetime(rcvfrom.mtime),"
" user.login,"
" rcvfrom.ipaddr"
" FROM tagxref JOIN blob ON tagxref.rid=blob.rid"
" LEFT JOIN rcvfrom ON blob.rcvid=rcvfrom.rcvid"
" LEFT JOIN user ON user.uid=rcvfrom.uid"
" WHERE tagxref.tagid=%d"
" ORDER BY rcvfrom.mtime, blob.uuid",
TAG_CLUSTER
);
@ <table cellpadding="2" cellspacing="0" border="1">
@ <tr><th> <th>Hash<th>Received<th>Size<th>User<th>IP-Address
while( db_step(&q)==SQLITE_ROW ){
const char *zUuid = db_column_text(&q, 0);
sqlite3_int64 sz = db_column_int64(&q, 1);
const char *zDate = db_column_text(&q, 2);
const char *zUser = db_column_text(&q, 3);
const char *zIp = db_column_text(&q, 4);
szTotal += sz;
@ <tr><td align="right">%d(cnt++)
@ <td><a href="%R/info/%S(zUuid)">%S(zUuid)</a>
if( zDate ){
@ <td>%h(zDate)
}else{
@ <td>
}
@ <td align="right">%,lld(sz)
if( zUser ){
@ <td>%h(zUser)
}else{
@ <td>
}
if( zIp ){
@ <td>%h(zIp)
}else{
@ <td>
}
@ </tr>
}
@ </table>
db_finalize(&q);
@ <p>Total size of all clusters: %,lld(szTotal) bytes</p>
style_finish_page();
}
|