Implemented "all display limit"

SVN revision: 1750
This commit is contained in:
2006-11-09 20:18:44 +00:00
parent 96fdf0a015
commit 660e6f5f32
2 changed files with 23 additions and 6 deletions
+12
View File
@@ -916,6 +916,18 @@ if the file name starts with a <b><code>"/"</code></b> (Unix) or <b><code>
case they can be replaced by others like <b>Serif</b>,
<b>Sans-serif</b>, <b>Helvetica</b>.
</li>
<li>
<b><code>All display limit = &lt;n&gt;</code></b><br>
If a logbook contains many entries, the list gets divided into pages,
with some page navigation for the next, previous, a specific page and
all pages. If the logbook contains a large number of entries (>500),
the display of all thes entries can take very long and might slow down
the elogd server, especially if the entries are not displayed in
"summary" mode but in "full" mode. Therefore the "All" link should not
be used in the page navigation for large logbooks. The number of
entries from when on the "All" link gets hidden can be specified with
this number, the default value is <b><code>500</code></b>.
</li>
</ul><a name="attrib" id="attrib"></a>
<hr>
<div class="section">
+11 -6
View File
@@ -16293,10 +16293,10 @@ void show_page_filters(LOGBOOK * lbs, int n_msg, int page_n, BOOL mode_commands,
/*------------------------------------------------------------------*/
void show_page_navigation(int n_msg, int page_n, int n_page)
void show_page_navigation(LOGBOOK *lbs, int n_msg, int page_n, int n_page)
{
int i, num_pages, skip;
char ref[256];
int i, num_pages, skip, max_n_msg;
char ref[256], str[256];
if (!page_n || n_msg <= n_page)
return;
@@ -16360,7 +16360,12 @@ void show_page_navigation(int n_msg, int page_n, int n_page)
rsprintf("<a href=\"%s\">%s</a>&nbsp;&nbsp;", ref, loc("Next"));
}
if (page_n != -1 && n_page < n_msg) {
if (getcfg(lbs->name, "All display limit", str, sizeof(str)))
max_n_msg = atoi(str);
else
max_n_msg = 500;
if (page_n != -1 && n_page < n_msg && n_msg < max_n_msg) {
sprintf(ref, "page");
build_ref(ref, sizeof(ref), "", "", "", "");
@@ -17961,7 +17966,7 @@ void show_elog_list(LOGBOOK * lbs, int past_n, int last_n, int page_n, BOOL defa
if (!printable) {
show_page_filters(lbs, n_msg, page_n, mode_commands, mode);
show_page_navigation(n_msg, page_n, n_page);
show_page_navigation(lbs, n_msg, page_n, n_page);
}
/*---- select navigation ----*/
@@ -18316,7 +18321,7 @@ void show_elog_list(LOGBOOK * lbs, int past_n, int last_n, int page_n, BOOL defa
/*---- page navigation ----*/
if (!printable)
show_page_navigation(n_msg, page_n, n_page);
show_page_navigation(lbs, n_msg, page_n, n_page);
rsprintf("</table>\n");
show_bottom_text(lbs);