view_5fa28f9e09af84a1ed967ce49cb64dca.c
4.74 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
/*
Generated from client/settings/advanced/network.esp
*/
#include "esp.h"
static void view_5fa28f9e09af84a1ed967ce49cb64dca(HttpConn *conn) {
espRenderBlock(conn, "<!DOCTYPE html>\r\n\
<html>\r\n\
<head>\r\n\
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>\r\n\
<title></title>\r\n\
<link href=\"../../css/frame.css\" rel=\"stylesheet\" />\r\n\
<link href=\"../../scripts/easyui/themes/default/easyui.css\" rel=\"stylesheet\" />\r\n\
<link href=\"../../css/reboot.css\" rel=\"stylesheet\" />\r\n\
<style type=\"text/css\">\r\n\
#form_network {\r\n\
padding: 8px;\r\n\
}\r\n\
\r\n\
.disabled {\r\n\
display: none;\r\n\
}\r\n\
</style>\r\n\
</head>\r\n\
<body>\r\n\
<form id=\"form_network\">\r\n\
<table class=\"settingsContainer\">\r\n\
<tr>\r\n\
<td class=\"tdTitle\">\r\n\
<label class=\"needRebootHint\" title=\"修改需重启生效\">MAC</label>\r\n\
</td>\r\n\
<td class=\"tdContent\">\r\n\
<input id=\"920\" name=\"920\" class=\"settingParameter needReboot\" type=\"text\" />\r\n\
</td>\r\n\
</tr>\r\n\
<tr class=\"disabled\">\r\n\
<td class=\"tdTitle\">MTU</td>\r\n\
<td class=\"tdContent\">\r\n\
<input id=\"921\" name=\"921\" disabled=\"disabled\" class=\"settingParameter\" type=\"text\" />\r\n\
</td>\r\n\
</tr>\r\n\
<tr class=\"disabled\">\r\n\
<td class=\"tdTitle\">DNS</td>\r\n\
<td class=\"tdContent\">\r\n\
<input id=\"922\" name=\"922\" disabled=\"disabled\" class=\"settingParameter\" type=\"text\" />\r\n\
</td>\r\n\
</tr>\r\n\
<tr>\r\n\
<td colspan=\"2\">\r\n\
<a href=\"#\" class=\"settingBtn\" id=\"btnSave\">保存</a>\r\n\
</td>\r\n\
</tr>\r\n\
</table>\r\n\
", 1798);
inputSecurityToken(); espRenderBlock(conn, "\r\n\
</form>\r\n\
<script src=\"../../scripts/easyui/jquery.min.js\"></script>\r\n\
<script src=\"../../scripts/easyui/jquery.easyui.min.js\"></script>\r\n\
<script src=\"../../scripts/easyui/locale/easyui-lang-zh_CN.js\"></script>\r\n\
<script src=\"../../scripts/utilities.js\"></script>\r\n\
<script src=\"../../scripts/jquery.validate.min.js\"></script>\r\n\
<script src=\"../../scripts/jquery.validate.extend.js\"></script>\r\n\
<script type=\"text/javascript\">\r\n\
var parameterAdaptor = new ParameterAdaptor();\r\n\
var rebootManager = new RebootManager();\r\n\
$().ready(function() {\r\n\
loadNetworkInfo();\r\n\
\r\n\
$(\"#btnSave\").click(saveParametersToServer);\r\n\
\r\n\
$(\"#form_network\").validate({\r\n\
rules: {\r\n\
920: {\r\n\
mac: true,\r\n\
required:true\r\n\
}\r\n\
}\r\n\
});\r\n\
});\r\n\
\r\n\
//加载高级网络参数\r\n\
function loadNetworkInfo() {\r\n\
var refererInfo = \"advancedNetwork\";\r\n\
parameterAdaptor.getParameters(refererInfo, function(data) {\r\n\
$(\"#form_network\").form(\"load\", data.feedback);\r\n\
//加载完参数,立即验证\r\n\
$(\"#form_network\").valid();\r\n\
});\r\n\
}\r\n\
\r\n\
//保存参数到服务器\r\n\
function saveParametersToServer() {\r\n\
var formObj = $(\"#form_network\");\r\n\
if (!formObj.valid()) {\r\n\
$.messager.alert(\"提示\", \"参数验证有误,请修改后再提交!\", \"error\");\r\n\
return;\r\n\
}\r\n\
parameterAdaptor.saveParameters(formObj, function(response) {\r\n\
if (response.error) {\r\n\
rebootManager.sendRebootCmd(\"Mac地址重启后生效,现在是否重启?\");\r\n\
}\r\n\
});\r\n\
}\r\n\
</script>\r\n\
</body>\r\n\
</html>", 2097);
}
ESP_EXPORT int esp_view_5fa28f9e09af84a1ed967ce49cb64dca(HttpRoute *route, MprModule *module) {
espDefineView(route, "client/settings/advanced/network.esp", view_5fa28f9e09af84a1ed967ce49cb64dca);
return 0;
}