Fix the problem that the page cannot be displayed due to too many clients
This commit is contained in:
parent
af168f6fdb
commit
fd6fef639b
@ -158,7 +158,7 @@ s.anonymous = true
|
||||
users = s:option(MultiValue, "users", "", translate("Select at least one user, otherwise it will take effect for all users"))
|
||||
users.widget="checkbox"
|
||||
--users.widget="select"
|
||||
users.size=1
|
||||
users.size=6
|
||||
|
||||
local fd = io.open("/tmp/dev_list", "r")
|
||||
if not fd then return m end
|
||||
@ -170,8 +170,9 @@ while true do
|
||||
if not line:match("Id*") then
|
||||
local ip=get_cmd_result(string.format("echo '%s' | awk '{print $3}'", line))
|
||||
local mac=get_cmd_result(string.format("echo '%s' | awk '{print $2}'", line))
|
||||
local hostname=get_cmd_result(string.format("echo '%s' | awk '{print $4}'", line))
|
||||
if mac ~= nil then
|
||||
local hostname=get_hostname_by_mac(mac)
|
||||
|
||||
if not hostname or hostname == "*" then
|
||||
users:value(mac, mac);
|
||||
else
|
||||
@ -180,6 +181,7 @@ while true do
|
||||
end
|
||||
end
|
||||
end
|
||||
fd:close()
|
||||
|
||||
local config_users=m.uci:get_all("appfilter.user.users")
|
||||
if config_users~=nil then
|
||||
|
@ -156,8 +156,9 @@ void update_dev_hostname(void){
|
||||
dev_node_t *node = find_dev_node(mac_buf);
|
||||
if (!node)
|
||||
continue;
|
||||
if (strlen(hostname_buf) > 0)
|
||||
if (strlen(hostname_buf) > 0){
|
||||
strncpy(node->hostname, hostname_buf, sizeof(node->hostname));
|
||||
}
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
@ -219,6 +220,8 @@ void dump_dev_list(void){
|
||||
dev_node_t *node = dev_hash_table[i];
|
||||
while(node){
|
||||
if (node->online != 0){
|
||||
if (strlen(node->hostname) == 0)
|
||||
strcpy(node->hostname, "*");
|
||||
fprintf(fp, "%-4d %-20s %-20s %-32s %-8d\n",
|
||||
i + 1, node->mac, node->ip, node->hostname, node->online);
|
||||
count++;
|
||||
@ -233,7 +236,10 @@ void dump_dev_list(void){
|
||||
for (i = 0;i < MAX_DEV_NODE_HASH_SIZE; i++){
|
||||
dev_node_t *node = dev_hash_table[i];
|
||||
while(node){
|
||||
|
||||
if (node->online == 0){
|
||||
if (strlen(node->hostname) == 0)
|
||||
strcpy(node->hostname, "*");
|
||||
fprintf(fp, "%-4d %-20s %-20s %-32s %-8d\n",
|
||||
i + 1, node->mac, node->ip, node->hostname, node->online);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user