新增功能:合并多开器
This commit is contained in:
parent
942d93417b
commit
dc32d7e53e
11 changed files with 456 additions and 34 deletions
|
@ -1,3 +1,5 @@
|
|||
from typing import List
|
||||
|
||||
from pydantic import BaseModel, model_validator
|
||||
from pydantic_core import PydanticUndefined
|
||||
|
||||
|
@ -7,9 +9,10 @@ class ConfModel(BaseModel):
|
|||
@classmethod
|
||||
def nested_defaults(cls, data):
|
||||
for name, field in cls.model_fields.items():
|
||||
expected_type = field.annotation
|
||||
if name not in data:
|
||||
if field.default is PydanticUndefined:
|
||||
data[name] = field.annotation()
|
||||
data[name] = expected_type
|
||||
else:
|
||||
data[name] = field.default
|
||||
return data
|
||||
|
@ -33,8 +36,28 @@ class UpdatePart(ConfModel):
|
|||
mirror: str = "aliyun"
|
||||
|
||||
|
||||
class LaunchPart(ConfModel):
|
||||
"""启动程序"""
|
||||
|
||||
class Instance(ConfModel):
|
||||
"""实例"""
|
||||
|
||||
# 是否选中
|
||||
checked: bool = False
|
||||
# 实例名
|
||||
name: str = ""
|
||||
# 实例路径
|
||||
path: str = ""
|
||||
|
||||
# 实例列表
|
||||
instances: List[Instance] = []
|
||||
# 是否展示日志窗口
|
||||
is_show_log: bool = False
|
||||
|
||||
|
||||
class Conf(
|
||||
Total,
|
||||
UpdatePart,
|
||||
LaunchPart,
|
||||
):
|
||||
pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue