Skip to content

Commit

Permalink
fix bug #280
Browse files Browse the repository at this point in the history
Signed-off-by: Catherine <[email protected]>
  • Loading branch information
Catherine2019 committed Mar 29, 2021
1 parent 467d5f6 commit d709e23
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions web/clui/templates/instances.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,33 @@
type: "GET",
url: searchURL,
success: function (data) {
var html = "";
var page1 = '<a class="active item"><a href="/instances?offset=';
var page2 = '">';
var page3 = '</a></a>';
var page_content = "";
var instants_num = data.instancedata.length;
var temp_num = 32/inst_num;
var count = Math.floor(temp_num);
var temp_num2;
var temp_num3;
console.log(temp_num);
console.log(count);
if(count>1){
for(var k=0;k<count;k++){
temp_num2 = k*16;
temp_num3 = k+1;
page_content = page_content+page1+ temp_num2 +page2+temp_num3+page3;

}
if(temp_num>count){
count = count*16;
temp_num3 = temp_num3+1;
page_content = page_content+page1+ count +page2+temp_num3+page3;
}
}
$("#page_content").html(page_content);

var html = "";
for(var i = 0; i < data.instancedata.length; i++){
html += "<tr>" +
"<td>";
Expand Down Expand Up @@ -295,7 +321,7 @@
</div>
<div class="ui attached segment">
{{ if .Pages}}
<div class="ui pagination menu">
<div class="ui pagination menu" id="page_content" >
{{ range $index, $element := .Pages }}
<a class="active item">
<a href="{{$Link}}?offset={{$element.Offset}}">{{ $element.Number }}</a>
Expand Down

0 comments on commit d709e23

Please sign in to comment.