adapt to new value name

This commit is contained in:
zhangzhen
2023-09-20 16:17:06 +08:00
parent c5184154b5
commit 0de5534723
+3 -3
View File
@@ -193,15 +193,15 @@ class AIOS_Shell:
show_text = FormattedText([("class:title", f"set config failed!")]) show_text = FormattedText([("class:title", f"set config failed!")])
if len(args) == 1: if len(args) == 1:
key = args[0] key = args[0]
config_item = AIStorage.get_instance().get_user_config().get_user_config(key) config_item = AIStorage.get_instance().get_user_config().get_config_item(key)
old_value = None old_value = None
if config_item is not None: if config_item is not None:
old_value = config_item.value 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) 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_user_config(key,value) AIStorage.get_instance().get_user_config().set_value(key,value)
await AIStorage.get_instance().get_user_config().save_value_to_user_config() await AIStorage.get_instance().get_user_config().save_to_user_config()
show_text = FormattedText([("class:title", f"set {key} to {value} success!")]) show_text = FormattedText([("class:title", f"set {key} to {value} success!")])
return show_text return show_text