diff --git a/shell/update.sh b/shell/update.sh index 22cc03fd..9916eed5 100755 --- a/shell/update.sh +++ b/shell/update.sh @@ -427,6 +427,18 @@ get_uniq_path() { } main() { + ## for ql update + show_log="false" + while getopts ":l" opt + do + case $opt in + l) + show_log="true" + ;; + esac + done + [[ "$show_log" == "true" ]] && shift $(($OPTIND - 1)) + local p1=$1 local p2=$2 local p3=$3 @@ -439,9 +451,11 @@ main() { case $p1 in update) - echo -e "## 开始执行... $begin_time\n" >>$log_path - [[ -f $task_error_log_path ]] && cat $task_error_log_path >>$log_path - update_qinglong "$2" >>$log_path + cmd=">> $log_path 2>&1" + [[ "$show_log" == "true" ]] && cmd="" + eval echo -e "## 开始执行... $begin_time\n" $cmd + [[ -f $task_error_log_path ]] && eval cat $task_error_log_path $cmd + eval update_qinglong "$2" $cmd ;; extra) echo -e "## 开始执行... $begin_time\n" >>$log_path diff --git a/src/pages/setting/checkUpdate.tsx b/src/pages/setting/checkUpdate.tsx index 91464073..eaec7562 100644 --- a/src/pages/setting/checkUpdate.tsx +++ b/src/pages/setting/checkUpdate.tsx @@ -106,6 +106,24 @@ const CheckUpdate = ({ ws }: any) => { useEffect(() => { ws.onmessage = (e) => { + setValue(value + e.data); + modalRef.current.update({ + content: ( +
+
+              {value + e.data}
+            
+
+ ), + }); if (e.data.includes('重启面板')) { message.warning({ content: ( @@ -124,25 +142,6 @@ const CheckUpdate = ({ ws }: any) => { setTimeout(() => { window.location.reload(); }, 10000); - } else { - modalRef.current.update({ - content: ( -
-
-                {value + e.data}
-              
-
- ), - }); - setValue(e.data); } }; }, []);