mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-09 03:27:39 +08:00
feat: prowlarr enable to disable
This commit is contained in:
@@ -28,15 +28,10 @@ class ProwlarrSettingState extends ConsumerState<ProwlarrSettingPage> {
|
|||||||
initialValue: {
|
initialValue: {
|
||||||
"api_key": v.apiKey,
|
"api_key": v.apiKey,
|
||||||
"url": v.url,
|
"url": v.url,
|
||||||
"enabled": !v.disabled
|
"disabled": v.disabled
|
||||||
},
|
},
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
FormBuilderSwitch(
|
|
||||||
name: "enabled",
|
|
||||||
title: const Text("启用"),
|
|
||||||
decoration: InputDecoration(icon: Icon(Icons.check_circle)),
|
|
||||||
),
|
|
||||||
FormBuilderTextField(
|
FormBuilderTextField(
|
||||||
name: "url",
|
name: "url",
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
@@ -53,6 +48,11 @@ class ProwlarrSettingState extends ConsumerState<ProwlarrSettingPage> {
|
|||||||
helperText: "Prowlarr 设置 -> 通用 -> API 密钥"),
|
helperText: "Prowlarr 设置 -> 通用 -> API 密钥"),
|
||||||
validator: FormBuilderValidators.required(),
|
validator: FormBuilderValidators.required(),
|
||||||
),
|
),
|
||||||
|
FormBuilderSwitch(
|
||||||
|
name: "disabled",
|
||||||
|
title: const Text("禁用 Prowlarr"),
|
||||||
|
decoration: InputDecoration(icon: Icon(Icons.do_not_disturb)),
|
||||||
|
),
|
||||||
Center(
|
Center(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(10),
|
padding: const EdgeInsets.all(10),
|
||||||
@@ -65,7 +65,7 @@ class ProwlarrSettingState extends ConsumerState<ProwlarrSettingPage> {
|
|||||||
.save(ProwlarrSetting(
|
.save(ProwlarrSetting(
|
||||||
apiKey: values["api_key"],
|
apiKey: values["api_key"],
|
||||||
url: values["url"],
|
url: values["url"],
|
||||||
disabled: !values["enabled"]))
|
disabled: values["disabled"]))
|
||||||
.then((v) => showSnakeBar("更新成功"));
|
.then((v) => showSnakeBar("更新成功"));
|
||||||
showLoadingWithFuture(f);
|
showLoadingWithFuture(f);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user