mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-17 01:14:50 +08:00
修复禁用任务后git_pull会重新添加
This commit is contained in:
@@ -123,11 +123,12 @@ const Crontab = () => {
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [isModalVisible, setIsModalVisible] = useState(false);
|
||||
const [editedCron, setEditedCron] = useState();
|
||||
const [searchText, setSearchText] = useState('');
|
||||
|
||||
const getCrons = (text: string = '') => {
|
||||
const getCrons = () => {
|
||||
setLoading(true);
|
||||
request
|
||||
.get(`${config.apiPrefix}crons?searchValue=${text}`)
|
||||
.get(`${config.apiPrefix}crons?searchValue=${searchText}`)
|
||||
.then((data: any) => {
|
||||
setValue(data.data.sort((a: any, b: any) => a.status - b.status));
|
||||
})
|
||||
@@ -311,9 +312,13 @@ const Crontab = () => {
|
||||
};
|
||||
|
||||
const onSearch = (value: string) => {
|
||||
getCrons(value);
|
||||
setSearchText(searchText);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
getCrons();
|
||||
}, [searchText]);
|
||||
|
||||
useEffect(() => {
|
||||
if (document.body.clientWidth < 768) {
|
||||
setWdith('auto');
|
||||
|
||||
Reference in New Issue
Block a user