mirror of
https://github.com/Jerryplusy/AI-powered-switches.git
synced 2025-10-14 09:49:19 +00:00
修改bug
This commit is contained in:
parent
d6e8dfa13f
commit
54fbecbab0
4
.idea/AI-powered-switches.iml
generated
4
.idea/AI-powered-switches.iml
generated
@ -9,7 +9,7 @@
|
|||||||
<content url="file://$MODULE_DIR$">
|
<content url="file://$MODULE_DIR$">
|
||||||
<excludeFolder url="file://$MODULE_DIR$/.venv" />
|
<excludeFolder url="file://$MODULE_DIR$/.venv" />
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="jdk" jdkName="Python 3.11 (AI-powered-switches)" jdkType="Python SDK" />
|
<orderEntry type="jdk" jdkName="Python 3.10" jdkType="Python SDK" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@ -3,5 +3,5 @@
|
|||||||
<component name="Black">
|
<component name="Black">
|
||||||
<option name="sdkName" value="Python 3.13" />
|
<option name="sdkName" value="Python 3.13" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.11 (AI-powered-switches)" project-jdk-type="Python SDK" />
|
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10" project-jdk-type="Python SDK" />
|
||||||
</project>
|
</project>
|
@ -118,13 +118,15 @@ const ConfigPage = () => {
|
|||||||
Common.sleep(1000).then(() => ({ success: true }));
|
Common.sleep(1000).then(() => ({ success: true }));
|
||||||
} else {
|
} else {
|
||||||
let commands = JSON.parse(editableConfig)?.config?.commands;
|
let commands = JSON.parse(editableConfig)?.config?.commands;
|
||||||
|
console.log(`commands:${JSON.stringify(commands)}`);
|
||||||
const deviceConfig = JSON.parse(selectedDeviceConfig);
|
const deviceConfig = JSON.parse(selectedDeviceConfig);
|
||||||
|
console.log(`deviceConfig:${JSON.stringify(deviceConfig)}`);
|
||||||
if (!deviceConfig.username || !deviceConfig.password) {
|
if (!deviceConfig.username || !deviceConfig.password) {
|
||||||
Notification.warn({
|
Notification.warn({
|
||||||
title: '所选交换机暂未配置用户名和密码',
|
title: '所选交换机暂未配置用户名和密码',
|
||||||
description: '请前往交换机设备处配置username和password',
|
description: '请前往交换机设备处配置username和password',
|
||||||
});
|
});
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
commands.push({
|
commands.push({
|
||||||
username: deviceConfig.username,
|
username: deviceConfig.username,
|
||||||
@ -171,8 +173,10 @@ const ConfigPage = () => {
|
|||||||
collection={deviceCollection}
|
collection={deviceCollection}
|
||||||
value={selectedDevice ? [selectedDevice] : []}
|
value={selectedDevice ? [selectedDevice] : []}
|
||||||
onValueChange={({ value }) => {
|
onValueChange={({ value }) => {
|
||||||
setSelectedDevice(value[0] ?? '');
|
const selectedIp = value[0] ?? '';
|
||||||
setSelectedDeviceConfig(JSON.stringify(value));
|
setSelectedDevice(selectedIp);
|
||||||
|
const fullDeviceConfig = devices.find((device) => device.ip === selectedIp);
|
||||||
|
setSelectedDeviceConfig(JSON.stringify(fullDeviceConfig));
|
||||||
}}
|
}}
|
||||||
placeholder={'请选择交换机设备'}
|
placeholder={'请选择交换机设备'}
|
||||||
size={'sm'}
|
size={'sm'}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user