diff --git a/src/frontend/src/pages/ConfigPage.jsx b/src/frontend/src/pages/ConfigPage.jsx index 7aaea86..ee62d01 100644 --- a/src/frontend/src/pages/ConfigPage.jsx +++ b/src/frontend/src/pages/ConfigPage.jsx @@ -61,13 +61,6 @@ const ConfigPage = () => { } try { - /** - const response = await api.parseCommand(inputText); - if (response) { - setParsedConfig(response); - setEditableConfig(response); - setHasParsed(true); - }**/ const performParse = async () => { if (testMode) { await Common.sleep(800 + Math.random() * 700); @@ -112,37 +105,6 @@ const ConfigPage = () => { } }; - const applyCommand = async (switch_ip, command, index) => { - try { - setApplyStatus((prevStatus) => { - const updated = [...prevStatus]; - updated[index] = 'in-progress'; - return updated; - }); - - const applyResult = testMode - ? await Common.sleep(1000) - : await api.applyConfig(switch_ip, [command]); - - if (applyResult?.data?.success) { - setApplyStatus((prevStatus) => { - const updated = [...prevStatus]; - updated[index] = 'success'; - return updated; - }); - } else { - Notification.error({ title: '命令应用失败', description: '请检查命令是否合法' }); - } - } catch (error) { - setApplyStatus((prevStatus) => { - const updated = [...prevStatus]; - updated[index] = 'failed'; - return updated; - }); - throw error; - } - }; - const handleApply = async () => { if (!editableConfig) { Notification.warn({ @@ -153,6 +115,7 @@ const ConfigPage = () => { } setApplying(true); + setIsApplying(true); try { const applyOperation = testMode ? Common.sleep(1000).then(() => ({ success: true })) @@ -230,8 +193,10 @@ const ConfigPage = () => {