diff options
| author | Martin Ridgers <[email protected]> | 2024-09-18 15:41:39 +0200 |
|---|---|---|
| committer | Martin Ridgers <[email protected]> | 2024-09-24 10:57:34 +0200 |
| commit | fafaf721f17c943a2f84710ebdeb120969778355 (patch) | |
| tree | 9cfa43bcd1f6739c658e9c45d37dcb3b562fda97 /src | |
| parent | Build action cells using toolbars (diff) | |
| download | zen-fafaf721f17c943a2f84710ebdeb120969778355.tar.xz zen-fafaf721f17c943a2f84710ebdeb120969778355.zip | |
Added pagination when browsing oplog entries
Diffstat (limited to 'src')
| -rw-r--r-- | src/zenserver/frontend/html/zen.js | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/zenserver/frontend/html/zen.js b/src/zenserver/frontend/html/zen.js index 03386f173..469d2f6f1 100644 --- a/src/zenserver/frontend/html/zen.js +++ b/src/zenserver/frontend/html/zen.js @@ -369,10 +369,29 @@ class Oplog extends Page var section = this.add_section(project + " - " + oplog); + this._build_nav(section) + this._entry_table = new Table(section, ["key"]); await this._build_table(); } + _build_nav(section) + { + var nav = new Toolbar(section); + nav.left().add("prev").on_click(() => this._on_next_prev(-1)); + nav.left().add("next").on_click(() => this._on_next_prev( 1)); + + nav.left().sep(); + for (var count of [10, 25, 50, 100]) + { + var handler = (e) => this._on_change_count(e.innerHTML); + nav.left().add(count).on_click(handler); + } + + nav.right().add("search:", "span"); + nav.right().add("", "input").attr("disabled", ""); + } + async _build_table() { const project = this.get_param("project"); @@ -386,7 +405,6 @@ class Oplog extends Page this._entry_table.clear(this._index_start); - var count = 12; for (const entry of (await entries)["entries"]) { var cells = this._entry_table.add_row([ @@ -399,10 +417,6 @@ class Oplog extends Page "oplog" : oplog, "key" : entry["key"], }); - - --count; - if (count == 0) - break; } } |