Skip to content

Commit

Permalink
feat: prowlarr enable to disable
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-ding committed Nov 5, 2024
1 parent bce4d93 commit 0d4b453
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions ui/lib/settings/prowlarr.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,10 @@ class ProwlarrSettingState extends ConsumerState<ProwlarrSettingPage> {
initialValue: {
"api_key": v.apiKey,
"url": v.url,
"enabled": !v.disabled
"disabled": v.disabled
},
child: Column(
children: [
FormBuilderSwitch(
name: "enabled",
title: const Text("启用"),
decoration: InputDecoration(icon: Icon(Icons.check_circle)),
),
FormBuilderTextField(
name: "url",
decoration: const InputDecoration(
Expand All @@ -53,6 +48,11 @@ class ProwlarrSettingState extends ConsumerState<ProwlarrSettingPage> {
helperText: "Prowlarr 设置 -> 通用 -> API 密钥"),
validator: FormBuilderValidators.required(),
),
FormBuilderSwitch(
name: "disabled",
title: const Text("禁用 Prowlarr"),
decoration: InputDecoration(icon: Icon(Icons.do_not_disturb)),
),
Center(
child: Padding(
padding: const EdgeInsets.all(10),
Expand All @@ -65,7 +65,7 @@ class ProwlarrSettingState extends ConsumerState<ProwlarrSettingPage> {
.save(ProwlarrSetting(
apiKey: values["api_key"],
url: values["url"],
disabled: !values["enabled"]))
disabled: values["disabled"]))
.then((v) => showSnakeBar("更新成功"));
showLoadingWithFuture(f);
}
Expand Down

0 comments on commit 0d4b453

Please sign in to comment.