mirror of
https://github.com/whyour/qinglong.git
synced 2026-08-12 19:30:48 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c0977f9e37 | ||
|
|
e9b85347f4 |
@@ -401,6 +401,17 @@ format_time() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
format_log_time() {
|
||||||
|
local format="$1"
|
||||||
|
local time="$2"
|
||||||
|
|
||||||
|
if [[ $is_macos -eq 1 ]]; then
|
||||||
|
echo $(date -j -f "$format" "$time" "+%Y-%m-%d-%H-%M-%S")
|
||||||
|
else
|
||||||
|
echo $(date -d "$time" "+%Y-%m-%d-%H-%M-%S")
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
format_timestamp() {
|
format_timestamp() {
|
||||||
local format="$1"
|
local format="$1"
|
||||||
local time="$2"
|
local time="$2"
|
||||||
|
|||||||
+18
-16
@@ -84,8 +84,8 @@ run_normal() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local time=$(date "+%Y-%m-%d-%H-%M-%S")
|
local time=$(date "+$time_format")
|
||||||
log_time="$time"
|
log_time=$(format_log_time "$time_format" "$time")
|
||||||
log_dir_tmp="${file_param##*/}"
|
log_dir_tmp="${file_param##*/}"
|
||||||
if [[ $file_param =~ "/" ]]; then
|
if [[ $file_param =~ "/" ]]; then
|
||||||
if [[ $file_param == /* ]]; then
|
if [[ $file_param == /* ]]; then
|
||||||
@@ -103,8 +103,9 @@ run_normal() {
|
|||||||
[[ "$show_log" == "true" ]] && cmd=""
|
[[ "$show_log" == "true" ]] && cmd=""
|
||||||
make_dir "$dir_log/$log_dir"
|
make_dir "$dir_log/$log_dir"
|
||||||
|
|
||||||
local begin_time=$(format_time "%Y-%m-%d-%H-%M-%S" "$time")
|
local begin_time=$(format_time "$time_format" "$time")
|
||||||
local begin_timestamp=$(format_timestamp "%Y-%m-%d-%H-%M-%S" "$time")
|
local begin_timestamp=$(format_timestamp "$time_format" "$time")
|
||||||
|
|
||||||
eval echo -e "\#\# 开始执行... $begin_time\\\n" $cmd
|
eval echo -e "\#\# 开始执行... $begin_time\\\n" $cmd
|
||||||
[[ -f $task_error_log_path ]] && eval cat $task_error_log_path $cmd
|
[[ -f $task_error_log_path ]] && eval cat $task_error_log_path $cmd
|
||||||
|
|
||||||
@@ -155,8 +156,8 @@ run_concurrent() {
|
|||||||
[[ ! -z $cookieStr ]] && export ${env_param}=${cookieStr}
|
[[ ! -z $cookieStr ]] && export ${env_param}=${cookieStr}
|
||||||
|
|
||||||
define_program "$file_param"
|
define_program "$file_param"
|
||||||
local time=$(date "+%Y-%m-%d-%H-%M-%S")
|
local time=$(date "+$time_format")
|
||||||
log_time="$time"
|
log_time=$(format_log_time "$time_format" "$time")
|
||||||
log_dir_tmp="${file_param##*/}"
|
log_dir_tmp="${file_param##*/}"
|
||||||
if [[ $file_param =~ "/" ]]; then
|
if [[ $file_param =~ "/" ]]; then
|
||||||
if [[ $file_param == /* ]]; then
|
if [[ $file_param == /* ]]; then
|
||||||
@@ -174,8 +175,8 @@ run_concurrent() {
|
|||||||
[[ "$show_log" == "true" ]] && cmd=""
|
[[ "$show_log" == "true" ]] && cmd=""
|
||||||
make_dir "$dir_log/$log_dir"
|
make_dir "$dir_log/$log_dir"
|
||||||
|
|
||||||
local begin_time=$(format_time "%Y-%m-%d-%H-%M-%S" "$time")
|
local begin_time=$(format_time "$time_format" "$time")
|
||||||
local begin_timestamp=$(format_timestamp "%Y-%m-%d-%H-%M-%S" "$time")
|
local begin_timestamp=$(format_timestamp "$time_format" "$time")
|
||||||
|
|
||||||
eval echo -e "\#\# 开始执行... $begin_time\\\n" $cmd
|
eval echo -e "\#\# 开始执行... $begin_time\\\n" $cmd
|
||||||
[[ -f $task_error_log_path ]] && eval cat $task_error_log_path $cmd
|
[[ -f $task_error_log_path ]] && eval cat $task_error_log_path $cmd
|
||||||
@@ -225,8 +226,8 @@ run_designated() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
define_program "$file_param"
|
define_program "$file_param"
|
||||||
local time=$(date "+%Y-%m-%d-%H-%M-%S")
|
local time=$(date "+$time_format")
|
||||||
log_time="$time"
|
log_time=$(format_log_time "$time_format" "$time")
|
||||||
log_dir_tmp="${file_param##*/}"
|
log_dir_tmp="${file_param##*/}"
|
||||||
if [[ $file_param =~ "/" ]]; then
|
if [[ $file_param =~ "/" ]]; then
|
||||||
if [[ $file_param == /* ]]; then
|
if [[ $file_param == /* ]]; then
|
||||||
@@ -244,8 +245,8 @@ run_designated() {
|
|||||||
[[ "$show_log" == "true" ]] && cmd=""
|
[[ "$show_log" == "true" ]] && cmd=""
|
||||||
make_dir "$dir_log/$log_dir"
|
make_dir "$dir_log/$log_dir"
|
||||||
|
|
||||||
local begin_time=$(format_time "%Y-%m-%d-%H-%M-%S" "$time")
|
local begin_time=$(format_time "$time_format" "$time")
|
||||||
local begin_timestamp=$(format_timestamp "%Y-%m-%d-%H-%M-%S" "$time")
|
local begin_timestamp=$(format_timestamp "$time_format" "$time")
|
||||||
|
|
||||||
local envs=$(eval echo "\$${env_param}")
|
local envs=$(eval echo "\$${env_param}")
|
||||||
local array=($(echo $envs | sed 's/&/ /g'))
|
local array=($(echo $envs | sed 's/&/ /g'))
|
||||||
@@ -289,8 +290,8 @@ run_designated() {
|
|||||||
run_else() {
|
run_else() {
|
||||||
local file_param="$1"
|
local file_param="$1"
|
||||||
define_program "$file_param"
|
define_program "$file_param"
|
||||||
local time=$(date "+%Y-%m-%d-%H-%M-%S")
|
local time=$(date "+$time_format")
|
||||||
log_time="$time"
|
log_time=$(format_log_time "$time_format" "$time")
|
||||||
log_dir_tmp="${file_param##*/}"
|
log_dir_tmp="${file_param##*/}"
|
||||||
if [[ $file_param =~ "/" ]]; then
|
if [[ $file_param =~ "/" ]]; then
|
||||||
if [[ $file_param == /* ]]; then
|
if [[ $file_param == /* ]]; then
|
||||||
@@ -308,8 +309,8 @@ run_else() {
|
|||||||
[[ "$show_log" == "true" ]] && cmd=""
|
[[ "$show_log" == "true" ]] && cmd=""
|
||||||
make_dir "$dir_log/$log_dir"
|
make_dir "$dir_log/$log_dir"
|
||||||
|
|
||||||
local begin_time=$(format_time "%Y-%m-%d-%H-%M-%S" "$time")
|
local begin_time=$(format_time "$time_format" "$time")
|
||||||
local begin_timestamp=$(format_timestamp "%Y-%m-%d-%H-%M-%S" "$time")
|
local begin_timestamp=$(format_timestamp "$time_format" "$time")
|
||||||
|
|
||||||
eval echo -e "\#\# 开始执行... $begin_time\\\n" $cmd
|
eval echo -e "\#\# 开始执行... $begin_time\\\n" $cmd
|
||||||
[[ -f $task_error_log_path ]] && eval cat $task_error_log_path $cmd
|
[[ -f $task_error_log_path ]] && eval cat $task_error_log_path $cmd
|
||||||
@@ -354,6 +355,7 @@ main() {
|
|||||||
timeoutCmd="timeout -k 10s $command_timeout_time "
|
timeoutCmd="timeout -k 10s $command_timeout_time "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
time_format="%Y-%m-%d %H:%M:%S"
|
||||||
if [[ $1 == *.js ]] || [[ $1 == *.py ]] || [[ $1 == *.sh ]] || [[ $1 == *.ts ]]; then
|
if [[ $1 == *.js ]] || [[ $1 == *.py ]] || [[ $1 == *.sh ]] || [[ $1 == *.ts ]]; then
|
||||||
case $# in
|
case $# in
|
||||||
1)
|
1)
|
||||||
|
|||||||
+4
-13
@@ -1,14 +1,5 @@
|
|||||||
export const version = '2.13.4';
|
export const version = '2.13.5';
|
||||||
export const changeLogLink = 'https://t.me/jiao_long/303';
|
export const changeLogLink = 'https://t.me/jiao_long/320';
|
||||||
export const changeLog = `2.13.4 版本说明
|
export const changeLog = `2.13.5 版本说明
|
||||||
1. 增加系统token,防止未登录时无法更新仓库和任务状态
|
1. 修复task命令获取时间异常
|
||||||
2. 脚本管理按照类型排序
|
|
||||||
3. 任务详情中编辑脚本支持全屏
|
|
||||||
4. 环境变量增加导出功能
|
|
||||||
5. 修复无法更新脚本内容为空
|
|
||||||
6. 修复停止node脚本报错
|
|
||||||
7. 修改手动停止任务耗时
|
|
||||||
8. 修复脚本管理、日志管理树
|
|
||||||
9. 修复获取环境变量详情
|
|
||||||
10. 区分原生termux和termux中安装的Linux发,感谢 erma0
|
|
||||||
`;
|
`;
|
||||||
|
|||||||
Reference in New Issue
Block a user