adapt to new value name
This commit is contained in:
@@ -97,9 +97,7 @@ class UserConfig:
|
||||
raise Exception("user config key %s not exist",key)
|
||||
|
||||
if config_item.value is None:
|
||||
default_config_item = config_item.clone()
|
||||
default_config_item.value = config_item.default_value
|
||||
return default_config_item
|
||||
return config_item.default_value
|
||||
|
||||
return config_item.value
|
||||
|
||||
|
||||
@@ -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':
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user