Showing
1 changed file
with
92 additions
and
0 deletions
1 | +<%@page language="java" contentType="text/html;charset=utf-8" %> | ||
2 | +<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> | ||
3 | +<div id="breadcrumb"> | ||
4 | + <a href="#" title="Go to Home" class="tip-bottom"><i | ||
5 | + class="icon-home"></i> Home</a> <a href="#" class="current">Tables</a> | ||
6 | +</div> | ||
7 | + | ||
8 | +<div class="container-fluid"> | ||
9 | + | ||
10 | + | ||
11 | + <div class="widget-box"> | ||
12 | + <div class="widget-title"> | ||
13 | + | ||
14 | + <h5>Dynamic table</h5> | ||
15 | + </div> | ||
16 | + <div class="widget-content nopadding"> | ||
17 | + <div class="widget-title" style="height: 53px;"> | ||
18 | + <div> | ||
19 | + <div class="form-inline" role="form" id="inBoxQueryDiv" | ||
20 | + style=" margin-top: 12px;margin-left: 25px;float: left;"> | ||
21 | + <div class="input-group" style="float: left;"> | ||
22 | + <span class="input-group-addon">IP:</span> | ||
23 | + <input type="text" id="" class="form-control" placeholder=""/> | ||
24 | + </div> | ||
25 | + <div class="input-group" style="float: left;"> | ||
26 | + <span class="input-group-addon">IP:</span> | ||
27 | + <input type="text" id="" class="form-control" placeholder=""/> | ||
28 | + </div> | ||
29 | + <button id="submit" class="btn btn-default">搜索</button> | ||
30 | + </div> | ||
31 | + <button id="addBtn" class="btn btn-primary" style="margin-top: 12px;margin-left: 900px;">新增</button> | ||
32 | + </div> | ||
33 | + </div> | ||
34 | + <div id="hostInfoTable"> | ||
35 | + | ||
36 | + </div> | ||
37 | + </div> | ||
38 | + </div> | ||
39 | +</div> | ||
40 | +<script> | ||
41 | + $(function () { | ||
42 | + | ||
43 | + //加载表格 | ||
44 | + $("#hostInfoTable").table({ | ||
45 | + columnAutoWidth : false, | ||
46 | + url : contextPath+"/hostInfo/getHostInfos", | ||
47 | + striped : true, | ||
48 | + title : "主机信息列表", | ||
49 | + pagination : true, | ||
50 | + pageSize : 10, | ||
51 | + loadFilter : function(data) { | ||
52 | + return defaultLoadFilter(data); | ||
53 | + }, | ||
54 | + columns : [{ | ||
55 | + title : "ID", | ||
56 | + field : "id", | ||
57 | + width : "5%" | ||
58 | + }, { | ||
59 | + title : "主机别名", | ||
60 | + field : "alias", | ||
61 | + width : "8%" | ||
62 | + }, { | ||
63 | + title : "IP", | ||
64 | + field : "ip", | ||
65 | + width : "10%" | ||
66 | + }, { | ||
67 | + title : "主机组名称", | ||
68 | + field : "groupName", | ||
69 | + width : "5%" | ||
70 | + | ||
71 | + }, { | ||
72 | + title : "机器类型", | ||
73 | + field : "cloudType", | ||
74 | + formatter : function(value, rowData, rowIndex) { | ||
75 | + if(value == 1){ | ||
76 | + return 'AWS'; | ||
77 | + } else if(value == 2){ | ||
78 | + return '腾讯云'; | ||
79 | + }else{ | ||
80 | + return '其他'; | ||
81 | + } | ||
82 | + }, | ||
83 | + width : "12%" | ||
84 | + }, { | ||
85 | + title : "操作", | ||
86 | + field : "op", | ||
87 | + width : "15%" | ||
88 | + }] | ||
89 | + }); | ||
90 | + }); | ||
91 | +</script> | ||
92 | + |
-
Please register or login to post a comment