mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 23:06:06 +08:00
添加ql -l update
This commit is contained in:
parent
98bba7d7fa
commit
19423c2d30
|
@ -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
|
||||
|
|
|
@ -106,6 +106,24 @@ const CheckUpdate = ({ ws }: any) => {
|
|||
|
||||
useEffect(() => {
|
||||
ws.onmessage = (e) => {
|
||||
setValue(value + e.data);
|
||||
modalRef.current.update({
|
||||
content: (
|
||||
<div style={{ height: '60vh', overflowY: 'auto' }}>
|
||||
<pre
|
||||
style={{
|
||||
wordBreak: 'break-all',
|
||||
whiteSpace: 'pre-wrap',
|
||||
paddingTop: 15,
|
||||
fontSize: 12,
|
||||
fontWeight: 400,
|
||||
}}
|
||||
>
|
||||
{value + e.data}
|
||||
</pre>
|
||||
</div>
|
||||
),
|
||||
});
|
||||
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: (
|
||||
<div style={{ height: '60vh', overflowY: 'auto' }}>
|
||||
<pre
|
||||
style={{
|
||||
wordBreak: 'break-all',
|
||||
whiteSpace: 'pre-wrap',
|
||||
paddingTop: 15,
|
||||
fontSize: 12,
|
||||
fontWeight: 400,
|
||||
}}
|
||||
>
|
||||
{value + e.data}
|
||||
</pre>
|
||||
</div>
|
||||
),
|
||||
});
|
||||
setValue(e.data);
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
|
|
Loading…
Reference in New Issue
Block a user