From 45b2ee62d7aae8a6a0b60811091f0795f6c8c673 Mon Sep 17 00:00:00 2001 From: dichgrem Date: Thu, 22 Jan 2026 12:45:27 +0800 Subject: [PATCH] fix:actions --- .github/workflows/build-zzz.yml | 1 + luci-app-zzz/luasrc/model/cbi/zzz.lua | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-zzz.yml b/.github/workflows/build-zzz.yml index 124b4c5..3198db0 100644 --- a/.github/workflows/build-zzz.yml +++ b/.github/workflows/build-zzz.yml @@ -124,6 +124,7 @@ jobs: set -euo pipefail cd "$SDK_ROOT" echo "添加 zzz feed" + sed -i '/^src-git zzz/d' feeds.conf.default 2>/dev/null || true echo "src-git zzz https://github.com/Dichgrem/luci-app-zzz.git" >> feeds.conf.default echo "更新 feeds" ./scripts/feeds update -a diff --git a/luci-app-zzz/luasrc/model/cbi/zzz.lua b/luci-app-zzz/luasrc/model/cbi/zzz.lua index 529ece6..dac597b 100644 --- a/luci-app-zzz/luasrc/model/cbi/zzz.lua +++ b/luci-app-zzz/luasrc/model/cbi/zzz.lua @@ -106,11 +106,17 @@ auto_start = s:option(Flag, "auto_start", "启用定时启动") auto_start.description = "启用后将在每周一至周五自动启动服务" auto_start.rmempty = false +-- Get Status +auto_start.cfgvalue = function(self, section) + local has_cron = sys.call("crontab -l 2>/dev/null | grep 'S99zzz' >/dev/null") == 0 + return has_cron and "1" or "0" +end + -- Schedule Time schedule_time = s:option(Value, "schedule_time", "启动时间") schedule_time.description = "设置定时启动的时间 (格式: HH:MM,例如 07:30)" schedule_time.placeholder = "07:00" -schedule_time.rmempty = true +schedule_time.rmempty = false schedule_time.default = "07:00" schedule_time.cfgvalue = function(self, section) @@ -135,12 +141,6 @@ end schedule_time:depends("auto_start", "1") --- Get Status -auto_start.cfgvalue = function(self, section) - local has_cron = sys.call("crontab -l 2>/dev/null | grep 'S99zzz' >/dev/null") == 0 - return has_cron and "1" or "0" -end - -- Crontab auto_start.write = function(self, section, value) local schedule_time_val = self.map:get(section, "schedule_time") or "07:00"