mirror of
https://github.com/roacn/openwrt-packages.git
synced 2025-01-07 03:16:45 +08:00
🍉 Sync 2024-03-04 00:22
This commit is contained in:
parent
009dcede1e
commit
b921f38df0
@ -11,8 +11,8 @@ LUCI_DEPENDS:=+netdata
|
||||
LUCI_PKGARCH:=all
|
||||
|
||||
PKG_NAME:=luci-app-netdata
|
||||
PKG_VERSION:=1.2
|
||||
PKG_RELEASE:=20240227
|
||||
PKG_VERSION:=1.3
|
||||
PKG_RELEASE:=20240303
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
@ -7,18 +7,19 @@ function index()
|
||||
if not nixio.fs.access("/etc/config/netdata") then
|
||||
return
|
||||
end
|
||||
local e = entry({"admin", "status", "netdata"}, alias("admin", "status", "netdata", "setting"),_("NetData"), 10)
|
||||
local e = entry({"admin", "status", "netdata"}, alias("admin", "status", "netdata", "netdata"),_("NetData"), 10)
|
||||
e.dependent = false
|
||||
e.acl_depends = { "luci-app-netdata" }
|
||||
entry({"admin", "status", "netdata", "netdata"}, template("netdata"), _("NetData Monitoring"), 10).leaf = true
|
||||
entry({"admin", "status", "netdata", "setting"}, cbi("netdata/netdata"), _("Base Setting"), 20).leaf=true
|
||||
entry({"admin", "status", "netdata", "netdata"}, template("netdata"), _("NetData"), 30).leaf = true
|
||||
entry({"admin", "status", "netdata", "config"}, cbi("netdata/config"), _("Netdata Config"), 40).leaf=true
|
||||
entry({"admin", "status", "netdata_status"}, call("act_status"))
|
||||
end
|
||||
|
||||
function act_status()
|
||||
local sys = require "luci.sys"
|
||||
local e = { }
|
||||
e.running = sys.call("pidof netdata >/dev/null") == 0
|
||||
e.running = sys.call("busybox ps -w | grep netdata | grep -v grep >/dev/null ") == 0
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(e)
|
||||
end
|
||||
|
22
luci-app-netdata/luasrc/model/cbi/netdata/config.lua
Normal file
22
luci-app-netdata/luasrc/model/cbi/netdata/config.lua
Normal file
@ -0,0 +1,22 @@
|
||||
-- Copyright 2018-2022 sirpdboy (herboy2008@gmail.com)
|
||||
-- https://github.com/sirpdboy/luci-app-netdata
|
||||
|
||||
local n=require"nixio.fs"
|
||||
local o=require"luci.util"
|
||||
|
||||
local i="/etc/netdata/netdata.conf"
|
||||
local t,a,e
|
||||
t=SimpleForm("netdata", translate("NetData"), translate("Netdata is high-fidelity infrastructure monitoring and troubleshooting.Open-source, free, preconfigured, opinionated, and always real-time.")..translate("</br>For specific usage, see:")..translate("<a href=\'https://github.com/sirpdboy/luci-app-netdata.git' target=\'_blank\'>GitHub @sirpdboy/luci-app-netdata </a>") )
|
||||
t.reset=false
|
||||
t.submit=false
|
||||
a=t:section(SimpleSection,nil,translatef("The content of the config file in<code>/etc/netdata/netdata. conf</code>"))
|
||||
e=a:option(TextValue,"_session")
|
||||
e.rows=20
|
||||
e.readonly=true
|
||||
e.cfgvalue=function()
|
||||
local e=n.readfile(i)or translate("File does not exist.")
|
||||
return o.trim(e)~=""and e or translate("Empty file.")
|
||||
end
|
||||
|
||||
|
||||
return t
|
@ -4,6 +4,7 @@ require("luci.util")
|
||||
|
||||
local m, s ,o
|
||||
|
||||
|
||||
m = Map("netdata", translate("NetData"), translate("Netdata is high-fidelity infrastructure monitoring and troubleshooting.Open-source, free, preconfigured, opinionated, and always real-time.")..translate("</br>For specific usage, see:")..translate("<a href=\'https://github.com/sirpdboy/luci-app-netdata.git' target=\'_blank\'>GitHub @sirpdboy/luci-app-netdata </a>") )
|
||||
m:section(SimpleSection).template = "netdata_status"
|
||||
s = m:section(TypedSection, "netdata", translate("Global Settings"))
|
||||
@ -19,7 +20,8 @@ o.default=19999
|
||||
|
||||
m.apply_on_parse = true
|
||||
m.on_after_apply = function(self,map)
|
||||
luci.sys.exec("/etc/init.d/netdata start")
|
||||
luci.sys.exec("/etc/init.d/netdata start")
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin","status","netdata","setting"))
|
||||
end
|
||||
|
||||
return m
|
||||
|
@ -4,13 +4,12 @@
|
||||
Licensed to the public under the Apache License 2.0.
|
||||
-%>
|
||||
<%
|
||||
local running = luci.sys.exec("pidof netdata | awk -F ' ' '{print $1}'")
|
||||
local running = luci.sys.exec("busybox ps -w | grep netdata | grep -v grep >/dev/null && echo -ne '1' ")
|
||||
%>
|
||||
<%+header%>
|
||||
|
||||
<div class="cbi-map">
|
||||
|
||||
<% if tonumber(running) ~= nil then %>
|
||||
<% if running == "1" then %>
|
||||
<iframe id="netdata" style="width: 100%; min-height: 780px; border: none; border-radius: .375rem;box-shadow: rgba(0, 0, 0, 0.75) 0px 0px 15px -5px;"></iframe>
|
||||
|
||||
</div>
|
||||
|
@ -1,3 +1,4 @@
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
XHR.poll(3, '<%=url([[admin]], [[status]], [[netdata_status]])%>', null,
|
||||
function(x, d) {
|
||||
|
@ -28,5 +28,20 @@ msgstr "基本设置"
|
||||
msgid "Netdata is high-fidelity infrastructure monitoring and troubleshooting.Open-source, free, preconfigured, opinionated, and always real-time."
|
||||
msgstr "Netdata是高保真的基础设施监控和故障排除。开源、免费、预配置、始终实时."
|
||||
|
||||
msgid "The content of the config file in<code>/etc/netdata/netdata. conf</code>"
|
||||
msgstr "在<code>/etc/netdata/netdata.conf</code>下的config文件内容"
|
||||
|
||||
msgid "</br>For specific usage, see:"
|
||||
msgstr "</br>具体使用方法参见:"
|
||||
|
||||
msgid "File does not exist."
|
||||
msgstr "文件不存在"
|
||||
|
||||
msgid "Empty file."
|
||||
msgstr "空文件。"
|
||||
|
||||
msgid "NetData Monitoring"
|
||||
msgstr "NetData监控台"
|
||||
|
||||
msgid "Netdata Config"
|
||||
msgstr "配置文件"
|
||||
|
@ -28,5 +28,20 @@ msgstr "基本设置"
|
||||
msgid "Netdata is high-fidelity infrastructure monitoring and troubleshooting.Open-source, free, preconfigured, opinionated, and always real-time."
|
||||
msgstr "Netdata是高保真的基础设施监控和故障排除。开源、免费、预配置、始终实时."
|
||||
|
||||
msgid "The content of the config file in<code>/etc/netdata/netdata. conf</code>"
|
||||
msgstr "在<code>/etc/netdata/netdata.conf</code>下的config文件内容"
|
||||
|
||||
msgid "</br>For specific usage, see:"
|
||||
msgstr "</br>具体使用方法参见:"
|
||||
|
||||
msgid "File does not exist."
|
||||
msgstr "文件不存在"
|
||||
|
||||
msgid "Empty file."
|
||||
msgstr "空文件。"
|
||||
|
||||
msgid "NetData Monitoring"
|
||||
msgstr "NetData监控台"
|
||||
|
||||
msgid "Netdata Config"
|
||||
msgstr "配置文件"
|
||||
|
@ -7,5 +7,5 @@
|
||||
[ -f /usr/share/netdata/webcn/index.html ] && mv -f /usr/share/netdata/webcn/index.html /usr/share/netdata/web/index.html
|
||||
[ -f /usr/share/netdata/webcn/netdata.init ] && mv -f /usr/share/netdata/webcn/netdata.init /etc/init.d/netdata
|
||||
rm -rf /tmp/luci-modulecache /tmp/luci-indexcache*
|
||||
chmod +x /etc/init.d/netdata
|
||||
chmod +x chmod +x /etc/init.d/netdata
|
||||
exit 0
|
||||
|
@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=v2ray-core
|
||||
PKG_VERSION:=5.12.1
|
||||
PKG_VERSION:=5.13.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/v2fly/v2ray-core/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=fa1845d42b46c6b5046a8f95d49cc7a9175e40efc5c13b95174b4c556567aca1
|
||||
PKG_HASH:=6b2eb6286c99da010db5c5f629f950e753fc4addeed189d3d898c1ef56d5a785
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
Loading…
Reference in New Issue
Block a user