*2013-12-25更新
修改 modules/admin-full/luasrc/controller/admin/index.lua 文件
–[[
LuCI – Lua Configuration InterfaceCopyright 2008 Steven Barth <steven@midlink.org>
Licensed under the Apache License, Version 2.0 (the “License”);
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
$Id: index.lua 7789 2011-10-26 03:04:18Z jow $
]]–module(“luci.controller.admin.index”, package.seeall)
function index()
local root = node()
if not root.target then
root.target = alias(“admin”)
root.index = true
endlocal page = node(“admin”)
page.target = firstchild()
page.title = _(“Administration”)
page.order = 10
page.sysauth = “root”
page.sysauth_authenticator = “htmlauth”
page.ucidata = true
page.index = true— Empty services menu to be populated by addons
entry({“admin”, “services”}, firstchild(), _(“Services”), 40).index = trueentry({“admin”, “Free_Memory”}, call(“Free_Memory”), _(“Free Memory”), 89)
entry({“admin”, “logout”}, call(“action_logout”), _(“Logout”), 90)
endfunction action_logout()
local dsp = require “luci.dispatcher”
local sauth = require “luci.sauth”
if dsp.context.authsession then
sauth.kill(dsp.context.authsession)
dsp.context.urltoken.stok = nil
endluci.http.header(“Set-Cookie”, “sysauth=; path=” .. dsp.build_url())
luci.http.redirect(luci.dispatcher.build_url())
end
function Free_Memory()
luci.util.exec(“echo 3 > /proc/sys/vm/drop_caches”)
luci.http.redirect(luci.dispatcher.build_url(“admin”, “status”, “overview”))
end
黑色加粗部分。
另在 luci/trunk/luci/luci/po/zh_CN/base.po 最底部添加
msgid “Free_Memory”
msgstr “释放内存”
这样使用中文的时候便能显示中文。
[分享]OpenWRT 添加 释放内存 按钮:目前有 1 条评论