-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathserver_lists.html
More file actions
executable file
·209 lines (169 loc) · 10 KB
/
server_lists.html
File metadata and controls
executable file
·209 lines (169 loc) · 10 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
{% extends 'base.html' %}
{% block css-page %}
<link href="/static/datatable/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.css" rel="stylesheet">
<!-- DataTables Responsive CSS -->
<link href="/static/datatable/datatables-responsive/css/dataTables.responsive.css" rel="stylesheet">
{% endblock %}
{% block page-content %}
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">服务器管理</h1>
</div>
<!-- /.col-lg-12 -->
</div>
<!-- /.row -->
<div class="row">
<div class="col-lg-12">
<div>
<a href="{% url 'server_add' %}"><button class="btn btn-primary " type="button">添加服务器</button></a>
<a href="{% url 'outputdata' %}"><button class="btn btn-danger " type="button">导出列表</button></a>
{% if listencelery == 0%}
<button class="btn btn-success " type="button">监控进程正在运行!!!</button>
{%else %}
<button class="btn btn-danger " type="button">监控进程未运行!!!</button>
{%endif%}
</div>
</div>
<div class="col-lg-12" style="margin-top:10px;">
<div class="panel panel-default">
<div class="panel-heading">
服务器信息列表
</div>
<!-- /.panel-heading -->
<div class="panel-body">
<div class="dataTable_wrapper">
<table class="table table-striped table-bordered table-hover" id="dataTables-example">
<thead>
<tr>
<th>主机名</th>
<th>IP地址</th>
<th>内网IP</th>
<th>虚拟IP</th>
<th>区域</th>
<th>机房</th>
<th>部门</th>
<th>业务</th>
<th>状态</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{%for s in Serverlist%}
<tr class="odd gradeX">
<td>{{s.hostname}}</td>
<td>{{s.externalip}}</td>
<td>{{s.internalip}}</td>
<td>{{s.virtip}}</td>
<td>{{s.idc.idczone}}</td>
<td class="center">{{s.idc}}</td>
<td class="center">{{s.dept}}</td>
<td class="center">{{s.businessname}}</td>
{%for k,v in ServerStatus.items%}
{%if k == s.status%}
{%if s.status == 1%}
<td class="center "><span class="running_510">{{v}}</span></td>
{%endif%}
{%if s.status == 2%}
<td class="center "><span class="down_610">{{v}}</span></td>
{%endif%}
{%if s.status == 3%}
<td class="center "><span class="unknow_710">{{v}}</span></td>
{%endif%}
{%endif%}
{%endfor%}
<td class="center">
<a class="btn btn-xs btn-primary" href="/server/server_detail/{{s.id}}">详情</a>
<a class="btn btn-xs btn-info" href="/server/edit/{{s.id}}">编辑</a>
<button class="btn btn-xs btn-danger" data-toggle="modal" onclick="clickurl('{{s.id}}')" data-target="#myModal" >删除</button>
</td>
</tr>
{%endfor%}
</tbody>
</table>
</div>
<!-- /.table-responsive -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close"
data-dismiss="modal" aria-hidden="true">
×
</button>
<h4 class="modal-title" id="myModalLabel">
删除提醒
</h4>
</div>
<div class="modal-body">
系统提示:您是否确认删除这条记录!!!!
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default"
data-dismiss="modal">关闭
</button>
<a class="btn btn-primary" id="postdel" > 删除</a>
</div>
</div>
</div>
</div>
<div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">系统提示</h4>
</div>
<div class="modal-body">
<p id="getdata">ddddddd</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<a class="btn btn-primary" href="/server/list/">确定</a>
</div>
</div>
</div>
</div>
<script>
function clickurl(url){
$("#postdel").click(function() {
$.get("/server/del/"+url,
function (data) {
$('#myModal').modal('hide')
$("#getdata").html(data);
$('#myModal2').modal('show');
});
});
}
</script>
</div>
<!-- /.panel-body -->
</div>
<!-- /.panel -->
</div>
</div>
<!-- /.row -->
{% endblock %}
{% block script-page %}
<!-- Custom Theme JavaScript -->
<!-- Page-Level Demo Scripts - Tables - Use for reference -->
<script>
$(document).ready(function() {
$('#dataTables-example').DataTable({
responsive: true,
"oLanguage":{
"sZeroRecords":"查询不到任何相关数据",
"sSearch": "搜索:",
"sLengthMenu": "每页显示 _MENU_ 条记录",
"oPaginate": {
"sFirst": "第一页",
"sPrevious": " 上一页 ",
"sNext": " 下一页 ",
"sLast": " 最后一页 "
},
"sInfo": "当前显示 _START_ 到 _END_ 条,共 _TOTAL_ 条记录",
}
});
});
</script>
{% endblock %}