修复git_pull重复添加任务

This commit is contained in:
whyour 2021-04-04 16:11:35 +08:00
parent 262e43ec10
commit 9f7cd91d39
4 changed files with 4 additions and 6 deletions

View File

@ -18,7 +18,7 @@ export class Crontab {
this.created = options.created; this.created = options.created;
this.status = options.status || CrontabStatus.idle; this.status = options.status || CrontabStatus.idle;
this.timestamp = new Date().toString(); this.timestamp = new Date().toString();
this.isSystem = options.isSystem; this.isSystem = options.isSystem || 0;
} }
} }

View File

@ -1,7 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
get_token() { get_token() {
echo $AuthConf
local authInfo=$(cat $AuthConf) local authInfo=$(cat $AuthConf)
token=$(get_json_value "$authInfo" "token") token=$(get_json_value "$authInfo" "token")
} }

View File

@ -198,7 +198,7 @@ Git_Pull_Scripts_Next() {
Diff_Cron() { Diff_Cron() {
cat $ListCronRemote | grep -E "node.+j[drx]_\w+\.js" | perl -pe "s|.+(j[drx]_\w+)\.js.+|\1|" | sort -u >$ListRemoteTask cat $ListCronRemote | grep -E "node.+j[drx]_\w+\.js" | perl -pe "s|.+(j[drx]_\w+)\.js.+|\1|" | sort -u >$ListRemoteTask
cat $ListCronCurrent | grep -E "$ShellJs j[drx]_\w+" | perl -pe "s|.*ID=(.*)$ShellJs (j[drx]_\w+)\.*|\1:\2|" | sort -u >$ListCurrentTask cat $ListCronCurrent | grep -E "$ShellJs j[drx]_\w+" | perl -pe "s|.*ID=(.*) $ShellJs (j[drx]_\w+)\.*|\2|" | sort -u >$ListCurrentTask
if [ -s $ListCurrentTask ]; then if [ -s $ListCurrentTask ]; then
grep -vwf $ListCurrentTask $ListRemoteTask >$ListJsAdd grep -vwf $ListCurrentTask $ListRemoteTask >$ListJsAdd
else else
@ -218,8 +218,7 @@ Del_Cron() {
echo echo
JsDrop=$(cat $ListJsDrop) JsDrop=$(cat $ListJsDrop)
for Cron in $JsDrop; do for Cron in $JsDrop; do
local id=$(echo "$1" | awk -F ":" '{print $1}') local id=$(cat $ListCronCurrent | grep -E "js $Cron" | perl -pe "s|.*ID=(.*) js $Cron|\1|")
local name=$(echo "$1" | awk -F ":" '{print $2}')
del_cron_api "$id" del_cron_api "$id"
done done
crontab $ListCronCurrent crontab $ListCronCurrent

View File

@ -261,7 +261,7 @@ const Crontab = () => {
<Menu.Item key="edit" icon={<EditOutlined />}> <Menu.Item key="edit" icon={<EditOutlined />}>
</Menu.Item> </Menu.Item>
{record.isSystem === 0 && ( {record.isSystem !== 0 && (
<> <>
<Menu.Item <Menu.Item
key="enableordisable" key="enableordisable"