增加codemirror搜索功能

This commit is contained in:
hanhh 2021-07-20 00:10:18 +08:00
parent 0da91dbf6c
commit 70444af762
3 changed files with 30 additions and 22 deletions

View File

@ -39,5 +39,8 @@ export default defineConfig({
'https://cdn.jsdelivr.net/npm/codemirror@5.62.0/mode/shell/shell.js', 'https://cdn.jsdelivr.net/npm/codemirror@5.62.0/mode/shell/shell.js',
'https://cdn.jsdelivr.net/npm/codemirror@5.62.0/mode/python/python.js', 'https://cdn.jsdelivr.net/npm/codemirror@5.62.0/mode/python/python.js',
'https://cdn.jsdelivr.net/npm/codemirror@5.62.0/mode/javascript/javascript.js', 'https://cdn.jsdelivr.net/npm/codemirror@5.62.0/mode/javascript/javascript.js',
'https://cdn.jsdelivr.net/npm/codemirror@5.62.0/addon/dialog/dialog.js',
'https://cdn.jsdelivr.net/npm/codemirror@5.62.0/addon/search/search.js',
'https://cdn.jsdelivr.net/npm/codemirror@5.62.0/addon/search/searchcursor.js',
], ],
}); });

View File

@ -99,7 +99,7 @@ run_normal() {
echo -e "## task_before执行失败自行检查\n" | tee -p -a $log_path echo -e "## task_before执行失败自行检查\n" | tee -p -a $log_path
fi fi
timeout $command_timeout_time $which_program $p1 2>&1 | tee -p -a $log_path timeout -k 10s $command_timeout_time $which_program $p1 2>&1 | tee -p -a $log_path
if [[ ! $(. $file_task_after 1>/dev/null) ]]; then if [[ ! $(. $file_task_after 1>/dev/null) ]]; then
. $file_task_after . $file_task_after
@ -146,7 +146,7 @@ run_concurrent() {
for i in "${!array[@]}"; do for i in "${!array[@]}"; do
export ${p3}=${array[i]} export ${p3}=${array[i]}
single_log_path="$log_dir/${single_log_time}_$((i + 1)).log" single_log_path="$log_dir/${single_log_time}_$((i + 1)).log"
timeout $command_timeout_time $which_program $p1 &>$single_log_path & timeout -k 10s $command_timeout_time $which_program $p1 &>$single_log_path &
done done
if [[ ! $(. $file_task_after 1>/dev/null) ]]; then if [[ ! $(. $file_task_after 1>/dev/null) ]]; then
@ -178,7 +178,7 @@ run_else() {
echo -e "## task_before执行失败自行检查\n" | tee -p -a $log_path echo -e "## task_before执行失败自行检查\n" | tee -p -a $log_path
fi fi
timeout $command_timeout_time "$@" 2>&1 | tee -p -a $log_path timeout -k 10s $command_timeout_time bash -c "$@" 2>&1 | tee -p -a $log_path
if [[ ! $(. $file_task_after 1>/dev/null) ]]; then if [[ ! $(. $file_task_after 1>/dev/null) ]]; then
. $file_task_after . $file_task_after
@ -193,6 +193,7 @@ run_else() {
## 命令检测 ## 命令检测
main() { main() {
if [[ $1 == *.js ]] || [[ $1 == *.py ]] || [[ $1 == *.sh ]] || [[ $1 == *.ts ]]; then
case $# in case $# in
0) 0)
echo echo
@ -218,6 +219,9 @@ main() {
run_else "$@" run_else "$@"
;; ;;
esac esac
else
run_else "$@"
fi
} }
main "$@" main "$@"

View File

@ -14,6 +14,7 @@ body {
} }
@import '~codemirror/lib/codemirror.css'; @import '~codemirror/lib/codemirror.css';
@import '~codemirror/addon/dialog/dialog.css';
.ql-container-wrapper { .ql-container-wrapper {
.CodeMirror { .CodeMirror {