分页查询文件上传的主页面

本文涉及的产品
传统型负载均衡 CLB,每月750个小时 15LCU
应用型负载均衡 ALB,每月750个小时 15LCU
网络型负载均衡 NLB,每月750个小时 15LCU
简介: 分页查询文件上传的主页面,可参考
<!DOCTYPE html><htmllang="en"><head><metacharset="UTF-8"><title>主页面</title><scriptsrc="http://www.jq22.com/jquery/jquery-1.10.2.js"></script></head><body><buttononclick="logout()">登出</button><header><h1>我是头部</h1></header><br><br><formaction="/fileUpload"enctype="multipart/form-data"method="post"><inputname="multipartFile"type="file"><inputtype="submit"value="文件上传"></form><br><br><div><buttononclick="page()">查询用户信息</button></div><tableid="pageTable"class="table table-striped"></table><divclass="pagination"><divstyle="float:left;"><label>显示
<selectid="pageSize"><option>5</option><option>10</option></select></label></div><divstyle="float:right;"><buttonid="select">查询</button><buttonid="prePage">前一页</button><inputtype="text"id="pageNum"value="1"/><buttonid="nextPage">后一页</button>/
<labelid="pages"></label> |
<labelid="total"></label></div></div><br><br><br><tableid="loadBalance"class="table table-striped"></table><div><buttononclick="loadBalance()">查询负载均衡信息</button></div><br><br><br><tableid="serverGroup"class="table table-striped"></table><div><buttononclick="serverGroup()">查询服务器组信息</button></div><footerclass="footer"><h1>我是底部</h1></footer><script>functionloadBalance(){
$.ajax({
async: false,
type: "POST",
url: "http://localhost:8000/loadBalance",
data: {},
success: function (response) {
if (response.success==true) {
varresult=response.data;
varliststr='';
vartitlestr=`<caption>负载均衡信息</caption><thead><tr><th>名称</th><th>状态</th><th>IP</th><th>端口</th></tr></thead>`;
liststr=`<tr><td>${result.loadBalancerName}</td><td>${result.loadBalancerStatus}</td><td>${result.address}</td><td>${result.listenerPorts}</td></tr>`// result( item >= {//     liststr = `<tr><td>${item.name}</td><td>${item.status}</td><td>${item.ip}</td><td>${item.port}</td></tr>`// })varalllist=titlestr+liststr;
$("#loadBalance").html(alllist);
                } else {
alert("查询失败");
                }
            }
        })
    }
functionserverGroup(){
$.ajax({
async: false,
type: "POST",
url: "http://localhost:8000/serverGroup",
data: {},
success: function (response) {
if (response.success==true) {
varresult=response.data;
varliststr='';
vartitlestr=`<caption>服务器组信息</caption><thead><tr><th>ID</th><th>端口</th><th>协议</th></tr></thead>`;
result.forEach(item=> {
liststr=`<tr><td>${item.serverId}</td><td>${item.port}</td><td>${item.Description}</td></tr>`                    })
varalllist=titlestr+liststr;
$("#serverGroup").html(alllist);
                } else {
alert("查询失败");
                }
            }
        })
    }
functionpage(pageNum){
varpageSize=$("#pageSize").val();
$.ajax({
async: false,
type: "POST",
url: "http://localhost:8000/page",
data: {
pageNum: pageNum,
pageSize: pageSize            },
success:function (response){
if(response.success==true){
varres=response.data;
varliststr='';
varlist=response.data.records;
list.forEach( item=> {
liststr+=`<tr><td>${item.username}</td><td>${item.email}</td><td>${item.createtime}</td></tr>`;
                    })
$("#pageTable").html(liststr);
setPage(res);
                }else {alert("查询失败")}
            }
        })
    }
functionsetPage(res){
$("#total").text("总共"+res.total+"条记录");
$("#pages").text(res.pages);
$("#prePage").val(res.current-1);
$("#nextPage").val(res.current+1);
varpages=res.pages;
$("#prePage").val()==0?$("#prePage").attr("disabled",true):$("#prePage").attr("disabled",false);
$("#nextPage").val() >pages?$("#nextPage").attr("disabled",true):$("#nextPage").attr("disabled",false);
    }
$(".pagination button").click(function (e){
varpageNum=$(this).val();
page(pageNum);
    })
$("#pageNum").change(function (e){
page($("#pageNum").val());
    })
$("#pageSize").change(function (e){
page($("#pageNum").val());
    })
window.onload=page($("#pageNum").val());
functionlogout(){
$.ajax({
async: false,
type: "POST",
url: "http://localhost:8000/logout",
data: {},
success: function (response){
if(response.success==true){
location.href="./login.html";
                }else {alert("登出失败")};
            }
        })
    }
</script></body><style>.table-striped{
border: 1pxsolid#000;
border-collapse: collapse;
    }
tableth{
border: 1pxsolid#000;
border-collapse: collapse;
background: aliceblue;
    }
tabletd{
border: 1pxsolid#000;
border-collapse: collapse;
    }
</style></html>
相关实践学习
SLB负载均衡实践
本场景通过使用阿里云负载均衡 SLB 以及对负载均衡 SLB 后端服务器 ECS 的权重进行修改,快速解决服务器响应速度慢的问题
负载均衡入门与产品使用指南
负载均衡(Server Load Balancer)是对多台云服务器进行流量分发的负载均衡服务,可以通过流量分发扩展应用系统对外的服务能力,通过消除单点故障提升应用系统的可用性。 本课程主要介绍负载均衡的相关技术以及阿里云负载均衡产品的使用方法。
目录
相关文章
|
4月前
|
存储 移动开发 JavaScript
使用vuex记住当前页面页码信息,以便从详情页返回列表页时能还原到上一次页面
使用vuex记住当前页面页码信息,以便从详情页返回列表页时能还原到上一次页面
55 0
|
1月前
|
前端开发 JavaScript Java
解决springboot+vue+mybatis中,将后台数据分页显示在前台,并且根据页码自动跳转对应页码信息
该博客文章讲述了如何在Spring Boot + Vue + MyBatis的项目中实现后台数据的分页查询,并在前端进行显示和页码跳转,包括后端的分页查询实现、前端与后端的交互以及使用Element UI进行分页展示的方法。
文件上传,下载,预览,删除(File),分页接口(三)
文件上传,下载,预览,删除(File),分页接口
46 0
文件上传,下载,预览,删除(File),分页接口(四)
文件上传,下载,预览,删除(File),分页接口
44 0
|
JavaScript Java
文件上传,下载,预览,删除(File),分页接口(二)
文件上传,下载,预览,删除(File),分页接口
162 0
|
XML Java 数据库
文件上传,下载,预览,删除(File),分页接口(一)
文件上传,下载,预览,删除(File),分页接口
77 0
|
Python
【Django学习笔记 - 15】:admin站点编辑(关联对象在列表页中添加,编辑页调整、图片设置)2
【Django学习笔记 - 15】:admin站点编辑(关联对象在列表页中添加,编辑页调整、图片设置)
【Django学习笔记 - 15】:admin站点编辑(关联对象在列表页中添加,编辑页调整、图片设置)2
|
数据库 Python
【Django学习笔记 - 15】:admin站点编辑(关联对象在列表页中添加,编辑页调整、图片设置)
【Django学习笔记 - 15】:admin站点编辑(关联对象在列表页中添加,编辑页调整、图片设置)
157 0
【Django学习笔记 - 15】:admin站点编辑(关联对象在列表页中添加,编辑页调整、图片设置)
|
JavaScript 前端开发 数据安全/隐私保护
注册页面的一些记录
注册页面是大多数网站必备的页面,所以很有必要对自己的注册页面做些精心的设计。下面三张图,第一张是注册的展示页面,第二张思维导图就一个简单的逻辑,第三张是通过firebug查看调用的JS文件。
注册页面的一些记录