mirror of
https://github.com/hanwckf/immortalwrt-mt798x.git
synced 2025-01-10 11:09:57 +08:00
luci-app-jd-dailybonus: sync with upstream source
Signed-off-by: CN_SZTL <cnsztl@project-openwrt.eu.org>
This commit is contained in:
parent
5f5e1c64d9
commit
2b5a8ad9c7
@ -22,7 +22,7 @@ end
|
|||||||
function run()
|
function run()
|
||||||
local running = luci.sys.call("busybox ps -w | grep JD_DailyBonus.js | grep -v grep >/dev/null") == 0
|
local running = luci.sys.call("busybox ps -w | grep JD_DailyBonus.js | grep -v grep >/dev/null") == 0
|
||||||
if not running then
|
if not running then
|
||||||
luci.sys.call('/usr/share/jd-dailybonus/newapp.sh -r')
|
luci.sys.call('sh /usr/share/jd-dailybonus/newapp.sh -r')
|
||||||
end
|
end
|
||||||
luci.http.write('')
|
luci.http.write('')
|
||||||
end
|
end
|
||||||
@ -31,7 +31,7 @@ end
|
|||||||
function check_update()
|
function check_update()
|
||||||
local jd = 'jd-dailybonus'
|
local jd = 'jd-dailybonus'
|
||||||
local e = {}
|
local e = {}
|
||||||
local new_version = luci.sys.exec('/usr/share/jd-dailybonus/newapp.sh -n')
|
local new_version = luci.sys.exec('sh /usr/share/jd-dailybonus/newapp.sh -n')
|
||||||
e.new_version = new_version
|
e.new_version = new_version
|
||||||
e.error = 0
|
e.error = 0
|
||||||
luci.http.prepare_content('application/json')
|
luci.http.prepare_content('application/json')
|
||||||
@ -45,7 +45,7 @@ function update()
|
|||||||
local uci = luci.model.uci.cursor()
|
local uci = luci.model.uci.cursor()
|
||||||
local version = luci.http.formvalue('version')
|
local version = luci.http.formvalue('version')
|
||||||
--下载脚本
|
--下载脚本
|
||||||
local code = luci.sys.exec('/usr/share/jd-dailybonus/newapp.sh -u')
|
local code = luci.sys.exec('sh /usr/share/jd-dailybonus/newapp.sh -u')
|
||||||
e.error = code
|
e.error = code
|
||||||
luci.http.prepare_content('application/json')
|
luci.http.prepare_content('application/json')
|
||||||
luci.http.write_json(e)
|
luci.http.write_json(e)
|
||||||
|
@ -70,9 +70,9 @@
|
|||||||
<div class="cbi-value-field">
|
<div class="cbi-value-field">
|
||||||
<input type="button" data-rel="1" class="cbi-button cbi-input-reload cookie-button" value="<%= translate('获取第一Cookie') %>" />
|
<input type="button" data-rel="1" class="cbi-button cbi-input-reload cookie-button" value="<%= translate('获取第一Cookie') %>" />
|
||||||
<input type="button" data-rel="2" class="cbi-button cbi-input-reload cookie-button" value="<%= translate('获取第二Cookie') %>" />
|
<input type="button" data-rel="2" class="cbi-button cbi-input-reload cookie-button" value="<%= translate('获取第二Cookie') %>" />
|
||||||
<br>
|
<br />
|
||||||
<div class="cbi-value-description">
|
<div class="cbi-value-description">
|
||||||
<span class="cbi-value-helpicon"><img src="/luci-static/resources/cbi/help.gif" alt="帮助"></span>
|
<span class="cbi-value-helpicon"><img src="/luci-static/resources/cbi/help.gif" alt="帮助" /></span>
|
||||||
<%= translate("点击上面按钮使用京东手机app扫码获取Cookie")%>
|
<%= translate("点击上面按钮使用京东手机app扫码获取Cookie")%>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
<%+cbi/valueheader%>
|
<%+cbi/valueheader%>
|
||||||
<label class="cbi-value-title"><%= translate("执行") %></label>
|
<label class="cbi-value-title"><%= translate("执行") %></label>
|
||||||
<div class="cbi-value-field">
|
<div class="cbi-value-field">
|
||||||
<input class="cbi-button cbi-button-reload" id="update_service" type="button" size="0" onclick="run()"
|
<input class="cbi-button cbi-button-reload" id="update_service" type="button" size="0" onclick="run()" value="<%= translate('手动执行签到') %>" />
|
||||||
value="<%= translate("手动执行签到") %>">
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<label class="cbi-value-title"><%= translate("更新脚本") %></label>
|
<label class="cbi-value-title"><%= translate("更新脚本") %></label>
|
||||||
<div class="cbi-value-field">
|
<div class="cbi-value-field">
|
||||||
<input class="cbi-button cbi-button-reload" id="update_script" type="button" size="0" onclick="check_version()" data-version="<%= self.version %>"
|
<input class="cbi-button cbi-button-reload" id="update_script" type="button" size="0" onclick="check_version()" data-version="<%= self.version %>" value="<%= translate('手动检查脚本更新,当前版本:v')..self.version %>" />
|
||||||
value="<%= translate("手动检查脚本更新,当前版本:v")..self.version %>">
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
@ -19,7 +19,7 @@ del_cron() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
start_service(){
|
start_service(){
|
||||||
/usr/share/jd-dailybonus/newapp.sh -s
|
sh /usr/share/jd-dailybonus/newapp.sh -s
|
||||||
}
|
}
|
||||||
|
|
||||||
stop_service() {
|
stop_service() {
|
||||||
|
@ -51,8 +51,8 @@ cancel() {
|
|||||||
|
|
||||||
add_cron() {
|
add_cron() {
|
||||||
sed -i '/jd-dailybonus/d' $CRON_FILE
|
sed -i '/jd-dailybonus/d' $CRON_FILE
|
||||||
[ $(uci_get_by_type global auto_run 0) -eq 1 ] && echo $(uci_get_by_type global auto_run_time_m)' '$(uci_get_by_type global auto_run_time_h)' * * * /usr/share/jd-dailybonus/newapp.sh -w' >>$CRON_FILE
|
[ $(uci_get_by_type global auto_run 0) -eq 1 ] && echo $(uci_get_by_type global auto_run_time_m)' '$(uci_get_by_type global auto_run_time_h)' * * * sh /usr/share/jd-dailybonus/newapp.sh -w' >>$CRON_FILE
|
||||||
[ $(uci_get_by_type global auto_update 0) -eq 1 ] && echo '1 '$(uci_get_by_type global auto_update_time)' * * * /usr/share/jd-dailybonus/newapp.sh -u' >>$CRON_FILE
|
[ $(uci_get_by_type global auto_update 0) -eq 1 ] && echo '1 '$(uci_get_by_type global auto_update_time)' * * * sh /usr/share/jd-dailybonus/newapp.sh -u' >>$CRON_FILE
|
||||||
crontab $CRON_FILE
|
crontab $CRON_FILE
|
||||||
/etc/init.d/cron restart
|
/etc/init.d/cron restart
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user