mirror of
https://github.com/whyour/qinglong.git
synced 2025-07-08 04:16:07 +08:00
修复git_pull重复添加任务
This commit is contained in:
parent
262e43ec10
commit
9f7cd91d39
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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")
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user