OpenWRT 添加 释放内存 按钮
时间:2015-1-2 22:26 热度:6567° 评论:0 条

修改 modules/admin-full/luasrc/controller/admin/index.lua 文件 –[[ LuCI - Lua Configuration Interface Copyright 2008 Steven Barth <[email protected]> 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 at http://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 end local 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 = true entry({“admin”, ”Free_Memory”}, call(“Free_Memory”), _(“Free Memory”), 89) entry({“admin”, “logout”}, call(“action_logout”), _(“Logout”), 90) end function 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 end luci.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 添加 释放内存 按钮
本文地址:https://blog.sxx1314.com/openwrt/161.html
版权声明:若无注明,本文皆为“unix 软硬件 技术宅 ”原创,转载请保留文章出处。百度已收录
本文地址:https://blog.sxx1314.com/openwrt/161.html
版权声明:若无注明,本文皆为“unix 软硬件 技术宅 ”原创,转载请保留文章出处。百度已收录















