Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
mirrors
openwrt
luci
提交
687861c4
L
luci
项目概览
mirrors
/
openwrt
/
luci
11 个月 前同步成功
通知
43
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
luci
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
687861c4
编写于
10月 19, 2010
作者:
J
Jo-Philipp Wich
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
libs/core: fix network counting in luci.model.wireless
上级
7ae988f3
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
31 addition
and
27 deletion
+31
-27
libs/core/luasrc/model/wireless.lua
libs/core/luasrc/model/wireless.lua
+31
-27
未找到文件。
libs/core/luasrc/model/wireless.lua
浏览文件 @
687861c4
...
...
@@ -36,28 +36,29 @@ function init(cursor)
st
=
uci
.
cursor_state
()
ifs
=
{
}
local
count
=
0
local
count
=
{
}
ub
.
uci
:
foreach
(
"wireless"
,
"wifi-iface"
,
function
(
s
)
count
=
count
+
1
if
s
.
device
then
count
[
s
.
device
]
=
count
[
s
.
device
]
and
count
[
s
.
device
]
+
1
or
1
local
id
=
"%s.network%d"
%
{
s
.
device
,
count
}
local
id
=
"%s.network%d"
%
{
s
.
device
,
count
[
s
.
device
]
}
ifs
[
id
]
=
{
id
=
id
,
sid
=
s
[
'.name'
],
count
=
count
}
ifs
[
id
]
=
{
id
=
id
,
sid
=
s
[
'.name'
],
count
=
count
}
local
dev
=
st
:
get
(
"wireless"
,
s
[
'.name'
],
"ifname"
)
or
st
:
get
(
"wireless"
,
s
[
'.name'
],
"device"
)
local
dev
=
st
:
get
(
"wireless"
,
s
[
'.name'
],
"ifname"
)
or
st
:
get
(
"wireless"
,
s
[
'.name'
],
"device"
)
local
wtype
=
dev
and
iwi
.
type
(
dev
)
if
dev
and
wtype
then
ifs
[
id
].
winfo
=
iwi
[
wtype
]
ifs
[
id
].
wdev
=
dev
local
wtype
=
dev
and
iwi
.
type
(
dev
)
if
dev
and
wtype
then
ifs
[
id
].
winfo
=
iwi
[
wtype
]
ifs
[
id
].
wdev
=
dev
end
end
end
)
end
...
...
@@ -129,7 +130,7 @@ end
function
shortname
(
self
,
iface
)
if
iface
.
wdev
and
iface
.
winfo
then
return
"%s %q"
%
{
i18n
.
translate
(
iface
:
active_mode
()),
i18n
.
translate
(
iface
:
active_mode
()),
iface
:
active_ssid
()
or
i18n
.
translate
(
"(hidden)"
)
}
else
...
...
@@ -230,7 +231,7 @@ network:property("bssid")
network
:
property
(
"network"
)
function
network
.
_init
(
self
,
sid
)
local
count
=
0
local
count
=
{
}
local
parent_dev
=
st
:
get
(
"wireless"
,
sid
,
"device"
)
or
ub
.
uci
:
get
(
"wireless"
,
sid
,
"device"
)
...
...
@@ -241,14 +242,17 @@ function network._init(self, sid)
if
dev
then
ub
.
uci
:
foreach
(
"wireless"
,
"wifi-iface"
,
function
(
s
)
count
=
count
+
1
if
s
[
'.name'
]
==
sid
then
self
.
id
=
"%s.network%d"
%
{
parent_dev
,
count
}
local
wtype
=
iwi
.
type
(
dev
)
if
dev
and
wtype
then
self
.
winfo
=
iwi
[
wtype
]
self
.
wdev
=
dev
if
s
.
device
then
count
[
s
.
device
]
=
count
[
s
.
device
]
and
count
[
s
.
device
]
+
1
or
1
if
s
[
'.name'
]
==
sid
then
self
.
id
=
"%s.network%d"
%
{
parent_dev
,
count
[
s
.
device
]
}
local
wtype
=
iwi
.
type
(
dev
)
if
dev
and
wtype
then
self
.
winfo
=
iwi
[
wtype
]
self
.
wdev
=
dev
end
end
end
end
)
...
...
@@ -302,7 +306,8 @@ function network.active_bssid(self)
end
function
network
.
active_encryption
(
self
)
return
self
.
winfo
and
self
.
winfo
.
enctype
(
self
.
wdev
)
or
"-"
local
enc
=
self
.
winfo
and
self
.
winfo
.
encryption
(
self
.
wdev
)
return
enc
and
enc
.
description
or
"-"
end
function
network
.
assoclist
(
self
)
...
...
@@ -360,4 +365,3 @@ function network.signal_percent(self)
return
0
end
end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录