mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-25 00:16:06 +08:00
添加ql -l update
This commit is contained in:
parent
98bba7d7fa
commit
19423c2d30
|
@ -427,6 +427,18 @@ get_uniq_path() {
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
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 p1=$1
|
||||||
local p2=$2
|
local p2=$2
|
||||||
local p3=$3
|
local p3=$3
|
||||||
|
@ -439,9 +451,11 @@ main() {
|
||||||
|
|
||||||
case $p1 in
|
case $p1 in
|
||||||
update)
|
update)
|
||||||
echo -e "## 开始执行... $begin_time\n" >>$log_path
|
cmd=">> $log_path 2>&1"
|
||||||
[[ -f $task_error_log_path ]] && cat $task_error_log_path >>$log_path
|
[[ "$show_log" == "true" ]] && cmd=""
|
||||||
update_qinglong "$2" >>$log_path
|
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)
|
extra)
|
||||||
echo -e "## 开始执行... $begin_time\n" >>$log_path
|
echo -e "## 开始执行... $begin_time\n" >>$log_path
|
||||||
|
|
|
@ -106,6 +106,24 @@ const CheckUpdate = ({ ws }: any) => {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
ws.onmessage = (e) => {
|
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('重启面板')) {
|
if (e.data.includes('重启面板')) {
|
||||||
message.warning({
|
message.warning({
|
||||||
content: (
|
content: (
|
||||||
|
@ -124,25 +142,6 @@ const CheckUpdate = ({ ws }: any) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}, 10000);
|
}, 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