38 lines
1.1 KiB
Python
38 lines
1.1 KiB
Python
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
from typing import Any
|
||
|
|
|
||
|
|
from .setup import (
|
||
|
|
prepare_setup_wizard,
|
||
|
|
run_setup_wizard,
|
||
|
|
validate_config,
|
||
|
|
)
|
||
|
|
|
||
|
|
SETUP_ENTRY = {
|
||
|
|
"channel_id": "irc",
|
||
|
|
"label": "IRC",
|
||
|
|
"description": "IRC (Internet Relay Chat) 渠道设置向导",
|
||
|
|
"steps": [
|
||
|
|
{"id": "server", "label": "服务器配置", "fields": ["server", "port", "use_tls"]},
|
||
|
|
{"id": "nickname", "label": "昵称设置", "fields": ["nick", "username", "realname"]},
|
||
|
|
{"id": "channels", "label": "频道配置", "fields": ["auto_join_channels"]},
|
||
|
|
{"id": "groupAccess", "label": "群组访问控制", "fields": ["group_policy", "groupAllowFrom"]},
|
||
|
|
{
|
||
|
|
"id": "authentication",
|
||
|
|
"label": "认证设置",
|
||
|
|
"fields": ["password", "use_sasl", "sasl_username", "sasl_password", "nickserv_password"],
|
||
|
|
},
|
||
|
|
],
|
||
|
|
"prepare": prepare_setup_wizard,
|
||
|
|
"run": run_setup_wizard,
|
||
|
|
"validate": validate_config,
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
def get_setup_entry() -> dict[str, Any]:
|
||
|
|
return SETUP_ENTRY
|
||
|
|
|
||
|
|
|
||
|
|
def register_bundled_channel_setup() -> dict[str, Any]:
|
||
|
|
return SETUP_ENTRY
|