增加自动运行任务时任务状态展示

1.  添加bot远程地址
2. 增加文件后缀配置
3. 增加定时任务页数缓存
This commit is contained in:
hanhh
2021-06-13 18:18:01 +08:00
parent 424a1e6491
commit 1923ceb5c2
9 changed files with 96 additions and 10 deletions
+26
View File
@@ -147,3 +147,29 @@ get_user_info() {
exit 0
fi
}
update_cron_status() {
local ids=$1
local status=$2
local currentTimeStamp=$(date +%s)
local api=$(
curl -s "http://localhost:5700/api/crons/status?t=$currentTimeStamp" \
-X 'PUT' \
-H "Accept: application/json" \
-H "Authorization: Bearer $token" \
-H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36" \
-H "Content-Type: application/json;charset=UTF-8" \
-H "Origin: http://localhost:5700" \
-H "Referer: http://localhost:5700/crontab" \
-H "Accept-Language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7" \
--data-raw "{\"ids\":\"[$ids]\",\"status\":\"$status\"}" \
--compressed
)
code=$(echo $api | jq -r .code)
message=$(echo $api | jq -r .message)
if [[ $code == 200 ]]; then
echo -e "成功"
else
echo -e "失败(${message})"
fi
}