feat: 添加脚本下拉框接口

This commit is contained in:
DLmaster361
2025-08-12 20:57:48 +08:00
parent df7006dc1e
commit ff78f8eb27
3 changed files with 41 additions and 0 deletions

View File

@@ -627,6 +627,7 @@ class GeneralConfig(ConfigBase):
CLASS_BOOK = {"MAA": MaaConfig, "MaaPlan": MaaPlanConfig, "General": GeneralConfig}
TYPE_BOOK = {"MaaConfig": "MAA", "GeneralConfig": "通用"}
class AppConfig(GlobalConfig):
@@ -1262,6 +1263,22 @@ class AppConfig(GlobalConfig):
return True, {"ALL": results}
async def get_script_combox(self):
"""获取脚本下拉框信息"""
logger.info("Getting script combo box information...")
data = []
for uid, script in self.ScriptConfig.items():
data.append(
{
"label": f"{TYPE_BOOK[script.__class__.__name__]} - {script.get('Info', 'Name')}",
"value": str(uid),
}
)
logger.success("Script combo box information retrieved successfully.")
return data
async def get_server_info(self, type: str) -> Dict[str, Any]:
"""获取公告信息"""