Fossil SCM
Add a link to the /uvlist screen from the /setup menu. Add the byage=1 query parameter to /uvlist.
Commit
ab4c1e2961a69e5104be3734ffcee7f09386f2f6
Parent
18524551580288e…
2 files changed
+2
+7
-1
+2
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -127,10 +127,12 @@ | ||
| 127 | 127 | "A record of received artifacts and their sources"); |
| 128 | 128 | setup_menu_entry("User Log", "access_log", |
| 129 | 129 | "A record of login attempts"); |
| 130 | 130 | setup_menu_entry("Administrative Log", "admin_log", |
| 131 | 131 | "View the admin_log entries"); |
| 132 | + setup_menu_entry("Unversioned Files", "uvlist?byage=1", | |
| 133 | + "Show all unversioned files held"); | |
| 132 | 134 | setup_menu_entry("Stats", "stat", |
| 133 | 135 | "Repository Status Reports"); |
| 134 | 136 | setup_menu_entry("Sitemap", "sitemap", |
| 135 | 137 | "Links to miscellaneous pages"); |
| 136 | 138 | setup_menu_entry("SQL", "admin_sql", |
| 137 | 139 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -127,10 +127,12 @@ | |
| 127 | "A record of received artifacts and their sources"); |
| 128 | setup_menu_entry("User Log", "access_log", |
| 129 | "A record of login attempts"); |
| 130 | setup_menu_entry("Administrative Log", "admin_log", |
| 131 | "View the admin_log entries"); |
| 132 | setup_menu_entry("Stats", "stat", |
| 133 | "Repository Status Reports"); |
| 134 | setup_menu_entry("Sitemap", "sitemap", |
| 135 | "Links to miscellaneous pages"); |
| 136 | setup_menu_entry("SQL", "admin_sql", |
| 137 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -127,10 +127,12 @@ | |
| 127 | "A record of received artifacts and their sources"); |
| 128 | setup_menu_entry("User Log", "access_log", |
| 129 | "A record of login attempts"); |
| 130 | setup_menu_entry("Administrative Log", "admin_log", |
| 131 | "View the admin_log entries"); |
| 132 | setup_menu_entry("Unversioned Files", "uvlist?byage=1", |
| 133 | "Show all unversioned files held"); |
| 134 | setup_menu_entry("Stats", "stat", |
| 135 | "Repository Status Reports"); |
| 136 | setup_menu_entry("Sitemap", "sitemap", |
| 137 | "Links to miscellaneous pages"); |
| 138 | setup_menu_entry("SQL", "admin_sql", |
| 139 |
+7
-1
| --- src/unversioned.c | ||
| +++ src/unversioned.c | ||
| @@ -352,17 +352,21 @@ | ||
| 352 | 352 | |
| 353 | 353 | /* |
| 354 | 354 | ** WEBPAGE: uvlist |
| 355 | 355 | ** |
| 356 | 356 | ** Display a list of all unversioned files in the repository. |
| 357 | +** Query parameters: | |
| 358 | +** | |
| 359 | +** byage=1 Order the initial display be decreasing age | |
| 357 | 360 | */ |
| 358 | 361 | void uvstat_page(void){ |
| 359 | 362 | Stmt q; |
| 360 | 363 | sqlite3_int64 iNow; |
| 361 | 364 | sqlite3_int64 iTotalSz = 0; |
| 362 | 365 | int cnt = 0; |
| 363 | 366 | int n = 0; |
| 367 | + const char *zOrderBy = "name"; | |
| 364 | 368 | char zSzName[100]; |
| 365 | 369 | |
| 366 | 370 | login_check_credentials(); |
| 367 | 371 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 368 | 372 | style_header("Unversioned Files"); |
| @@ -369,20 +373,22 @@ | ||
| 369 | 373 | if( !db_table_exists("repository","unversioned") ){ |
| 370 | 374 | @ No unversioned files on this server |
| 371 | 375 | style_footer(); |
| 372 | 376 | return; |
| 373 | 377 | } |
| 378 | + if( PB("byage") ) zOrderBy = "mtime DESC"; | |
| 374 | 379 | db_prepare(&q, |
| 375 | 380 | "SELECT" |
| 376 | 381 | " name," |
| 377 | 382 | " mtime," |
| 378 | 383 | " hash," |
| 379 | 384 | " sz," |
| 380 | 385 | " (SELECT login FROM rcvfrom, user" |
| 381 | 386 | " WHERE user.uid=rcvfrom.uid AND rcvfrom.rcvid=unversioned.rcvid)," |
| 382 | 387 | " rcvid" |
| 383 | - " FROM unversioned" | |
| 388 | + " FROM unversioned ORDER BY %s", | |
| 389 | + zOrderBy/*safe-for-%s*/ | |
| 384 | 390 | ); |
| 385 | 391 | iNow = db_int64(0, "SELECT strftime('%%s','now');"); |
| 386 | 392 | while( db_step(&q)==SQLITE_ROW ){ |
| 387 | 393 | const char *zName = db_column_text(&q, 0); |
| 388 | 394 | sqlite3_int64 mtime = db_column_int(&q, 1); |
| 389 | 395 |
| --- src/unversioned.c | |
| +++ src/unversioned.c | |
| @@ -352,17 +352,21 @@ | |
| 352 | |
| 353 | /* |
| 354 | ** WEBPAGE: uvlist |
| 355 | ** |
| 356 | ** Display a list of all unversioned files in the repository. |
| 357 | */ |
| 358 | void uvstat_page(void){ |
| 359 | Stmt q; |
| 360 | sqlite3_int64 iNow; |
| 361 | sqlite3_int64 iTotalSz = 0; |
| 362 | int cnt = 0; |
| 363 | int n = 0; |
| 364 | char zSzName[100]; |
| 365 | |
| 366 | login_check_credentials(); |
| 367 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 368 | style_header("Unversioned Files"); |
| @@ -369,20 +373,22 @@ | |
| 369 | if( !db_table_exists("repository","unversioned") ){ |
| 370 | @ No unversioned files on this server |
| 371 | style_footer(); |
| 372 | return; |
| 373 | } |
| 374 | db_prepare(&q, |
| 375 | "SELECT" |
| 376 | " name," |
| 377 | " mtime," |
| 378 | " hash," |
| 379 | " sz," |
| 380 | " (SELECT login FROM rcvfrom, user" |
| 381 | " WHERE user.uid=rcvfrom.uid AND rcvfrom.rcvid=unversioned.rcvid)," |
| 382 | " rcvid" |
| 383 | " FROM unversioned" |
| 384 | ); |
| 385 | iNow = db_int64(0, "SELECT strftime('%%s','now');"); |
| 386 | while( db_step(&q)==SQLITE_ROW ){ |
| 387 | const char *zName = db_column_text(&q, 0); |
| 388 | sqlite3_int64 mtime = db_column_int(&q, 1); |
| 389 |
| --- src/unversioned.c | |
| +++ src/unversioned.c | |
| @@ -352,17 +352,21 @@ | |
| 352 | |
| 353 | /* |
| 354 | ** WEBPAGE: uvlist |
| 355 | ** |
| 356 | ** Display a list of all unversioned files in the repository. |
| 357 | ** Query parameters: |
| 358 | ** |
| 359 | ** byage=1 Order the initial display be decreasing age |
| 360 | */ |
| 361 | void uvstat_page(void){ |
| 362 | Stmt q; |
| 363 | sqlite3_int64 iNow; |
| 364 | sqlite3_int64 iTotalSz = 0; |
| 365 | int cnt = 0; |
| 366 | int n = 0; |
| 367 | const char *zOrderBy = "name"; |
| 368 | char zSzName[100]; |
| 369 | |
| 370 | login_check_credentials(); |
| 371 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 372 | style_header("Unversioned Files"); |
| @@ -369,20 +373,22 @@ | |
| 373 | if( !db_table_exists("repository","unversioned") ){ |
| 374 | @ No unversioned files on this server |
| 375 | style_footer(); |
| 376 | return; |
| 377 | } |
| 378 | if( PB("byage") ) zOrderBy = "mtime DESC"; |
| 379 | db_prepare(&q, |
| 380 | "SELECT" |
| 381 | " name," |
| 382 | " mtime," |
| 383 | " hash," |
| 384 | " sz," |
| 385 | " (SELECT login FROM rcvfrom, user" |
| 386 | " WHERE user.uid=rcvfrom.uid AND rcvfrom.rcvid=unversioned.rcvid)," |
| 387 | " rcvid" |
| 388 | " FROM unversioned ORDER BY %s", |
| 389 | zOrderBy/*safe-for-%s*/ |
| 390 | ); |
| 391 | iNow = db_int64(0, "SELECT strftime('%%s','now');"); |
| 392 | while( db_step(&q)==SQLITE_ROW ){ |
| 393 | const char *zName = db_column_text(&q, 0); |
| 394 | sqlite3_int64 mtime = db_column_int(&q, 1); |
| 395 |