Merge branch 'release/release/left-tree'

This commit is contained in:
周腾 2021-06-06 15:36:42 +08:00
commit a63b676b44
3 changed files with 12 additions and 16 deletions

View File

@ -125,16 +125,17 @@ add_cron() {
if [ -f $file ]; then
cron_line=$(
perl -ne "{
print if /.*([\d\*]*[\*-\/,\d]*[\d\*] ){4,5}[\d\*]*[\*-\/,\d]*[\d\*]( |,|\").*/
print if /.*([\d\*]*[\*-\/,\d]*[\d\*] ){4,5}[\d\*]*[\*-\/,\d]*[\d\*]( |,|\").*$file_name/
}" $file |
perl -pe "{
s|[^\d\*]*(([\d\*]*[\*-\/,\d]*[\d\*] ){4,5}[\d\*]*[\*-\/,\d]*[\d\*])( \|,\|\").*|\1|g;
s|[^\d\*]*(([\d\*]*[\*-\/,\d]*[\d\*] ){4,5}[\d\*]*[\*-\/,\d]*[\d\*])( \|,\|\").*/?$file_name.*|\1|g;
s|\*([\d\*])(.*)|\1\2|g;
s| | |g;
}" | sort -u | head -1
)
cron_name=$(grep "new Env" $file | awk -F "\(" '{print $2}' | awk -F "\)" '{print $1}' | sed 's:^.\(.*\).$:\1:' | head -1)
[[ -z $cron_name ]] && cron_name="$file_name"
[[ -z $cron_line ]] && cron_line=$(grep "cron:" $file | awk -F ":" '{print $2}' | xargs)
[[ -z $cron_line ]] && cron_line="0 6 * * *"
result=$(add_cron_api "$cron_line:$cmd_task $file:$cron_name")
echo -e "$result"
@ -194,10 +195,10 @@ update_raw() {
cp -f $raw_file_name $dir_scripts/${filename}
cron_line=$(
perl -ne "{
print if /.*([\d\*]*[\*-\/,\d]*[\d\*] ){4,5}[\d\*]*[\*-\/,\d]*[\d\*]( |,|\").*/
print if /.*([\d\*]*[\*-\/,\d]*[\d\*] ){4,5}[\d\*]*[\*-\/,\d]*[\d\*]( |,|\").*$raw_file_name/
}" $raw_file_name |
perl -pe "{
s|[^\d\*]*(([\d\*]*[\*-\/,\d]*[\d\*] ){4,5}[\d\*]*[\*-\/,\d]*[\d\*])( \|,\|\").*|\1|g;
s|[^\d\*]*(([\d\*]*[\*-\/,\d]*[\d\*] ){4,5}[\d\*]*[\*-\/,\d]*[\d\*])( \|,\|\").*/?$raw_file_name.*|\1|g;
s|\*([\d\*])(.*)|\1\2|g;
s| | |g;
}" | sort -u | head -1

View File

@ -4,7 +4,6 @@
&-container {
overflow: hidden;
position: relative;
// padding: 16px 0;
background-color: #fff;
height: calc(100vh - 128px);
height: calc(100vh - var(--vh-offset, 0px) - 128px);
@ -18,10 +17,6 @@
}
&-search {
margin-bottom: 16px;
// position: absolute;
// top: 0;
// left: 0;
// padding-bottom: 16px;
}
}

View File

@ -10,10 +10,10 @@ function getFilterData(keyword: string, data: any) {
const expandedKeys: string[] = [];
if (keyword) {
const tree: any = [];
data.forEach((item) => {
data.forEach((item: any) => {
if (item.title.includes(keyword)) {
tree.push(item);
expandedKeys.push(...item.children.map((x) => x.key));
expandedKeys.push(...item.children.map((x: any) => x.key));
} else {
const children: any[] = [];
(item.children || []).forEach((subItem: any) => {
@ -95,7 +95,7 @@ const Log = () => {
const onSearch = useCallback(
(e) => {
const keyword = e.target.value;
const { tree, expandedKeys } = getFilterData(keyword, data);
const { tree } = getFilterData(keyword, data);
setFilterData(tree);
},
[data, setFilterData],