Add new server settings

This commit is contained in:
2024-06-08 13:52:08 +00:00
committed by GitHub
parent eacff10594
commit 418a27347f
5 changed files with 147 additions and 2 deletions

View File

@@ -295,6 +295,28 @@ class _ServerSettingsPage extends State<ServerSettingsPage>
}
},
label: Text(i18n.redirectToFlutter))),
_buildWithVecticalPadding(LabeledCheckbox(
value: _now.usePathBasedImgUrl ?? _config!.usePathBasedImgUrl,
onChanged: (b) {
if (b != null) {
setState(() {
_now.usePathBasedImgUrl = b;
_changed = true;
});
}
},
label: Text(i18n.usePathBasedImgUrl))),
_buildWithVecticalPadding(LabeledCheckbox(
value: _now.checkFileHash ?? _config!.checkFileHash,
onChanged: (b) {
if (b != null) {
setState(() {
_now.checkFileHash = b;
_changed = true;
});
}
},
label: Text(i18n.checkFileHash))),
]));
}
@@ -721,6 +743,38 @@ class _ServerSettingsPage extends State<ServerSettingsPage>
});
},
)),
_buildWithVecticalPadding(DropdownButtonFormField<ImportMethod>(
items: ImportMethod.values
.map((e) => DropdownMenuItem(
value: e, child: Text(e.localText(context))))
.toList(),
onChanged: (v) {
if (v != null) {
setState(() {
_now.importMethod = v;
_changed = true;
});
}
},
value: _now.importMethod ?? _config!.importMethod,
decoration: InputDecoration(
border: const OutlineInputBorder(),
labelText: i18n.importMethod,
))),
_buildWithVecticalPadding(NumberFormField(
min: 1,
initialValue: _now.maxImportImgCount ?? _config!.maxImportImgCount,
decoration: InputDecoration(
border: const OutlineInputBorder(),
labelText: i18n.maxImportImgCount,
),
onChanged: (s) {
setState(() {
_now.maxImportImgCount = s;
_changed = true;
});
},
)),
]));
}