storage.esp
13.4 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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="../../css/frame.css" rel="stylesheet" />
<link href="../../scripts/easyui/themes/default/easyui.css" rel="stylesheet" />
<link href="../../scripts/easyui/themes/icon.css" rel="stylesheet" />
<style type="text/css">
.tab_content {
min-height: 500px;
}
.content_group {
background-color: #DCDFE2;
width: 880px;
}
.content_items tr td {
height: 30px;
text-align: left;
width: 160px;
}
.content_items tr td.tdLarge {
width: 400px;
}
.content_items tr td .settingParameter {
width: 92px;
height: 21px;
}
.content_items tr td.td_comment {
width: 400px;
}
.content_items tr td select.settingParameter {
height: 25px;
line-height: 25px;
width: 92px;
}
.plainBtn {
border: 1px solid #7C8895;
width: 60px;
}
.plainText {
width: 60px;
border: 0;
background-color: #DCDFE2;
}
</style>
</head>
<body>
<ul class="tab_header">
<!--<li class="tab_title" data-index="0">硬盘</li>-->
<li class="tab_title selected" data-index="1">SD卡</li>
<!--<li class="tab_title" data-index="2">U盘</li>-->
<li class="clear"></li>
</ul>
<form id="storageForm">
<div class="tab_content" style="display: none;">
</div>
<div class="tab_content">
<div class="content_group">
<table class="content_items">
<tr>
<td class="title">存储卡模式</td>
<td class="content">
<span id="cardType"></span>
</td>
</tr>
</table>
</div>
<div class="content_group">
<table class="content_items">
<tr>
<td class="title">路径</td>
<td class="content">
<input name="146" id="146" type="text" class="plainText" disabled="disabled" />
</td>
</tr>
<tr>
<td class="title">总容量</td>
<td class="content">
<input type="text" name="147" id="147" class="plainText" disabled="disabled" />
</td>
</tr>
<tr>
<td class="title">剩余容量</td>
<td class="content">
<input type="text" name="148" id="148" class="plainText" disabled="disabled" />
</td>
</tr>
</table>
</div>
<div class="content_group">
<table class="content_items">
<tr>
<td class="tableTitle">分区信息</td>
<td class="tableTitle">
<label class="needRebootHint" title="修改需重启生效">分区大小</label>
</td>
<td class="tableTitle">剩余容量</td>
<td class="tableTitle">操作</td>
</tr>
<tr>
<td class="title">结果分区</td>
<td>
<input type="text" name="149" id="149" class="settingParameter needReboot" />
</td>
<td>
<input class="plainText" name="150" id="150" type="text" disabled="disabled" />
</td>
<td class="tdContent">
<a class="settingBtn" id="btnFormatResult">格式化</a>
</td>
</tr>
<tr>
<td>录像分区</td>
<td>
<input type="text" name="151" id="151" class="settingParameter needReboot" />
</td>
<td>
<input class="plainText" name="152" id="152" type="text" disabled="disabled" />
</td>
<td class="tdContent">
<a class="settingBtn" id="btnFormatVideo">格式化</a>
</td>
</tr>
</table>
</div>
<!-- <div class="content_group">
<table class="content_items">
<tr>
<td>
<label>录像流类型</label>
</td>
<td>
<select name="158" id="158" class="settingParameter ">
<option value="0">主码流</option>
<option value="1">子码流</option>
</select>
</td>
<td rowspan="3" class="td_comment">
<table>
<tr>
<td>编码格式</td>
<td>h264</td>
<td>码率类型</td>
<td>CBR</td>
<td>分辨率</td>
<td></td>
</tr>
<tr>
<td>码率</td>
<td></td>
<td>I帧间隔</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="3">
可能存储码流:<span></span>分辨率:<span></span>录像<span></span>天
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<label>存储类型</label>
</td>
<td>
<select name="159" id="159" class="settingParameter ">
<option value="0">avi</option>
<option value="1">h264</option>
</select>
</td>
</tr>
<tr>
<td>
<label>存满策略</label>
</td>
<td colspan="2">
<input name="160" value="0" type="radio" class="checkboxAlign " /> 循环覆盖
<input name="160" value="1" type="radio" class="checkboxAlign " /> 存满即停
</td>
</tr>
</table>
</div>
<div class="content_group">
<table class="content_items">
<tr>
<td>
<input type="checkbox" name="153" id="153" class="checkboxAlign " /> <label>违法结果存储</label>
</td>
<td class="tdLarge">
违法最多支持(天) <input name="154" id="154" type="text" class="settingParameter " /> (1-100)
<span>至少需要 <span>6G</span></span>
</td>
</tr>
<tr>
<td>
<input type="checkbox" name="155" id="155" class="checkboxAlign " /> <label>卡口数据存储</label>
</td>
<td>
</td>
</tr>
<tr>
<td>
<input type="checkbox" name="156" id="156" class="checkboxAlign " /> <label>短时录像独立存储</label>
</td>
<td>
</td>
</tr>
</table>
</div>
</div> -->
<div class="tab_content" style="display: none;">
</div>
<% inputSecurityToken(); %>
</form>
<div class="operateDiv" style="padding-left: 5px;display:none;">
<a class="settingBtn" id="btnSave" style="float: left;">保存</a>
<div class="clear"></div>
</div>
<script src="../../scripts/jquery-1.11.1.js"></script>
<script src="../../scripts/easyui/jquery.easyui.min.js"></script>
<script src="../../scripts/easyui/locale/easyui-lang-zh_CN.js"></script>
<script src="../../scripts/utilities.js"></script>
<script src="../../scripts/jquery.validate.min.js"></script>
<script src="../../scripts/jquery.validate.extend.js"></script>
<script type="text/javascript">
var parameterAdaptor = new ParameterAdaptor();
var oldValue = null
$().ready(function () {
//保存参数
$("#btnSave").click(saveParametersToServer);
//加载存储参数
loadStorageInfo();
$("#btnFormatResult").click(sendCmdFormatResult); //格式化结果信息
$("#btnFormatVideo").click(sendCmdFormatVideo); //格式化结果信息
$("#storageForm").validate({
rules: {
154: {
range: [1, 100],
digits: true
}
}
});
});
//保存参数到服务器
function saveParametersToServer() {
var formObj = $("#storageForm");
if (!formObj.valid()) {
$.messager.alert("提示", "参数验证有误,请修改后再提交!", "error");
return;
}
parameterAdaptor.saveParameters(formObj);
}
//加载参数
function loadStorageInfo() {
var RefererInfo = "storageSettings";
parameterAdaptor.getParameters(RefererInfo, bindStorageInfo);
}
//绑定参数的本地方法
function bindStorageInfo(data) {
// 根据返回的存储卡模式更新UI
var cardType = data.feedback["146001"];
// 根据参数值更新UI
switch (cardType) {
case 0:
$("#cardType").html("无卡");
break;
case 1:
// 只有一张卡,禁用录像分区
$("#151").attr("disabled", "disabled");
$("#cardType").html("单卡模式");
break;
case 2:
// 两张卡,都不可修改
$("#cardType").html("双卡模式");
$("#151").attr("disabled", "disabled");
$("#149").attr("disabled", "disabled");
break;
default:
$.messager.alert("提示", "加载存储卡模式失败!", "error");
if (window.console && window.console.error) {
console.error("存储卡模式参数值为: " + cardType + ",不知道怎么处理!");
$("#storageForm").hide();
}
return;
}
// 保存旧值
oldValue = data.feedback["149"];
$("#storageForm").form("load", data.feedback);
}
//格式化结果信息
function sendCmdFormatResult() {
var url = "/do/trafficController/formatResult";
var params = {
partionSize: $("#149").val()
};
$.get(url, params, function (data) {
var message = "格式化成功!";
var currentValue = $("#149").val();
if (currentValue != oldValue) {
message += "分区大小改变,需要重启后生效!";
}
if (data.error) {
$.messager.alert("格式化", message, "info");
} else {
$.messager.alert("格式化", "格式化失败!" + data.feedback.Msg, "error");
}
}, "json");
}
//格式化视频信息
function sendCmdFormatVideo() {
var url = "/do/trafficController/formatVideo";
var params = {
partionSize: $("#151").val()
};
$.get(url, params, function (data) {
if (data.error) {
$.messager.alert("格式化", "格式化成功!", "info");
} else {
$.messager.alert("格式化", "格式化失败!" + data.feedback.Msg, "error");
}
}, "json");
}
</script>
</body>
</html>