Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add basic (first, prev, next, last page) message navigation panel #437

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
34 changes: 33 additions & 1 deletion src/main/resources/templates/message-inspector.ftlh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
margin-bottom: 16px;
}

#messageFormPanel {
#messageFormPanel, #messageNavigationPanel {
margin-top: 16px;
}

Expand Down Expand Up @@ -165,6 +165,38 @@
</form>
</div>

<#if messages?? && messages?size gt 0 && (curPartition.size - curPartition.firstOffset gt messageForm.count)>
<div id="messageNavigationPanel">
<nav>
<ul class="pagination justify-content-center">
<li class="page-item <#if curPartition.firstOffset gte messageForm.offset>disabled</#if>">
<a class="page-link btn-success" href="<@spring.url '/topic/${topic.name}/messages?partition=${curPartition.id}&offset=${curPartition.firstOffset}&count=${messageForm.count}&keyFormat=${selectedKeyFormat}&format=${selectedFormat}'/>"
<#if curPartition.firstOffset gte messageForm.offset>tabindex="-1"</#if>>
<i class="fa fa-fast-backward"></i>
</a>
</li>
<li class="page-item <#if curPartition.firstOffset gte messageForm.offset>disabled</#if>">
<a class="page-link btn-success" href="<@spring.url '/topic/${topic.name}/messages?partition=${curPartition.id}&offset=${[(curPartition.firstOffset),(messageForm.offset-messageForm.count)]?max}&count=${messageForm.count}&keyFormat=${selectedKeyFormat}&format=${selectedFormat}'/>"
<#if curPartition.firstOffset gte messageForm.offset>tabindex="-1"</#if>>
<i class="fa fa-step-backward"></i>
</a>
</li>
<li class="page-item <#if messageForm.offset gte curPartition.size-messageForm.count>disabled</#if>">
<a class="page-link btn-success" href="<@spring.url '/topic/${topic.name}/messages?partition=${curPartition.id}&offset=${[(curPartition.size-messageForm.count),(messageForm.offset+messageForm.count)]?min}&count=${messageForm.count}&keyFormat=${selectedKeyFormat}&format=${selectedFormat}'/>"
<#if messageForm.offset gte curPartition.size-messageForm.count>tabindex="-1"</#if>>
<i class="fa fa-step-forward"></i>
</a>
</li>
<li class="page-item <#if messageForm.offset gte curPartition.size-messageForm.count>disabled</#if>">
<a class="page-link btn-success" href="<@spring.url '/topic/${topic.name}/messages?partition=${curPartition.id}&offset=${[(curPartition.size-messageForm.count),curPartition.firstOffset]?max}&count=${messageForm.count}&keyFormat=${selectedKeyFormat}&format=${selectedFormat}'/>"
<#if messageForm.offset gte curPartition.size-messageForm.count>tabindex="-1"</#if>>
<i class="fa fa-fast-forward"></i>
</a>
</li>
</nav>
</div>
</#if>

<@spring.bind path="messageForm.*"/>
<div id="message-display" class="container">
<#if messages?? && messages?size gt 0>
Expand Down