adapt to new value name

This commit is contained in:
streetycat
2023-09-20 08:45:53 +00:00
committed by zhangzhen
parent 0de5534723
commit ee3f9ebcea
4 changed files with 28 additions and 11 deletions
+5 -7
View File
@@ -194,15 +194,13 @@ class AIOS_Shell:
if len(args) == 1:
key = args[0]
config_item = AIStorage.get_instance().get_user_config().get_config_item(key)
old_value = AIStorage.get_instance().get_user_config().get_value(key)
old_value = None
if config_item is not None:
old_value = config_item.value
value = await session.prompt_async(f"{key} : {config_item.desc} \nCurrent : {old_value}\nPlease input new value:",style=shell_style)
AIStorage.get_instance().get_user_config().set_value(key,value)
await AIStorage.get_instance().get_user_config().save_to_user_config()
show_text = FormattedText([("class:title", f"set {key} to {value} success!")])
value = await session.prompt_async(f"{key} : {config_item.desc} \nCurrent : {old_value}\nPlease input new value:",style=shell_style)
AIStorage.get_instance().get_user_config().set_value(key,value)
await AIStorage.get_instance().get_user_config().save_to_user_config()
show_text = FormattedText([("class:title", f"set {key} to {value} success!")])
return show_text
case 'connect':
+1 -1
View File
@@ -11,7 +11,7 @@ sys.path.append(directory + '/../../')
from aios_kernel import AIStorage
def apply_storage():
proxy_cfg = AIStorage.get_instance().get_user_config().get_user_config("proxy")
proxy_cfg = AIStorage.get_instance().get_user_config().get_config_item("proxy")
if proxy_cfg is None:
return