Skip to content

Commit

Permalink
feat: 添加Bark警告通知级别
Browse files Browse the repository at this point in the history
v1.4.2(7)
Finb/Bark#152
  • Loading branch information
Johnserf-Seed committed Nov 18, 2024
1 parent b384fcf commit 1d12e4b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
13 changes: 11 additions & 2 deletions f2/apps/bark/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,18 @@ def validate_proxies(
@click.option(
"--level",
"-l",
type=click.Choice(["active", "timeSensitive", "passive"]),
type=click.Choice(["active", "timeSensitive", "passive", "critical"]),
# default="active",
help=_("推送中断级别。active:默认,timeSensitive:时效性通知,passive:被动通知"),
help=_(
"推送级别。active:默认,timeSensitive:时效性通知,passive:被动通知,critical:紧急通知"
),
)
@click.option(
"--volume",
"-v",
type=int,
# default=5,
help=_("推送音量,范围 0-10"),
)
@click.option(
"--badge",
Expand Down
3 changes: 2 additions & 1 deletion f2/apps/bark/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ def help() -> None:
"-l --level",
"[dark_cyan]Choice",
_(
"推送中断级别。active:默认,timeSensitive:时效性通知,passive:被动通知"
"推送级别。active:默认,timeSensitive:时效性通知,passive:被动通知,critical:紧急通知"
),
),
("-v --volume", "[dark_cyan]str", _("推送音量,范围 0-10")),
("-bd --badge", "[dark_cyan]str", _("推送的角标数量")),
(
"-ac --autoCopy",
Expand Down
3 changes: 2 additions & 1 deletion f2/apps/bark/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ class BarkModel(BaseModel):
icon: Optional[str]
group: Optional[str]
# ciphertext: Optional[str] = ""
level: Optional[Literal["active", "timeSensitive", "passive"]]
level: Optional[Literal["active", "timeSensitive", "passive", "critical"]]
volume: Optional[int]
url: Optional[str]
copy_text: Optional[str] = Field(
"", alias="copy"
Expand Down

0 comments on commit 1d12e4b

Please sign in to comment.