adapt to new value name
This commit is contained in:
@@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
# 2023-09-20 08:41:50.636730
|
||||||
|
+/set_config proxy
|
||||||
|
|
||||||
|
# 2023-09-20 08:42:18.936143
|
||||||
|
+/open math_school 小学老师
|
||||||
|
|
||||||
|
# 2023-09-20 08:42:23.884698
|
||||||
|
+3+5=8
|
||||||
|
|
||||||
|
# 2023-09-20 08:43:13.219129
|
||||||
|
+/set_config proxy
|
||||||
|
|
||||||
|
# 2023-09-20 08:43:23.430306
|
||||||
|
+socks5@192.168.100.91:1080@zhangzhen@123456
|
||||||
|
|
||||||
|
# 2023-09-20 08:43:35.319913
|
||||||
|
+/open math_school 小学老师
|
||||||
|
|
||||||
|
# 2023-09-20 08:43:41.557234
|
||||||
|
+3+5=8
|
||||||
@@ -97,9 +97,7 @@ class UserConfig:
|
|||||||
raise Exception("user config key %s not exist",key)
|
raise Exception("user config key %s not exist",key)
|
||||||
|
|
||||||
if config_item.value is None:
|
if config_item.value is None:
|
||||||
default_config_item = config_item.clone()
|
return config_item.default_value
|
||||||
default_config_item.value = config_item.default_value
|
|
||||||
return default_config_item
|
|
||||||
|
|
||||||
return config_item.value
|
return config_item.value
|
||||||
|
|
||||||
|
|||||||
@@ -194,11 +194,9 @@ class AIOS_Shell:
|
|||||||
if len(args) == 1:
|
if len(args) == 1:
|
||||||
key = args[0]
|
key = args[0]
|
||||||
config_item = AIStorage.get_instance().get_user_config().get_config_item(key)
|
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:
|
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)
|
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)
|
AIStorage.get_instance().get_user_config().set_value(key,value)
|
||||||
await AIStorage.get_instance().get_user_config().save_to_user_config()
|
await AIStorage.get_instance().get_user_config().save_to_user_config()
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ sys.path.append(directory + '/../../')
|
|||||||
from aios_kernel import AIStorage
|
from aios_kernel import AIStorage
|
||||||
|
|
||||||
def apply_storage():
|
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:
|
if proxy_cfg is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user