mirror of
https://github.com/lifegpc/eh-downloader.git
synced 2026-06-06 05:38:44 +08:00
Add db_path to settings page
This commit is contained in:
@@ -97,8 +97,10 @@ export default class SettingsText<T extends keyof TextType>
|
||||
render() {
|
||||
this.ref = useRef<TextField>();
|
||||
const id = `s-${this.props.name}`;
|
||||
let cn = "text";
|
||||
if (this.props.helpertext) cn += " helper";
|
||||
return (
|
||||
<div class="text" id={id}>
|
||||
<div class={cn} id={id}>
|
||||
<label>{this.props.description}</label>
|
||||
<TextField
|
||||
fullwidth={this.props.fullwidth}
|
||||
|
||||
@@ -171,6 +171,13 @@ export default class Settings extends Component<SettingsProps> {
|
||||
type="number"
|
||||
min={1}
|
||||
/>
|
||||
<SettingsText
|
||||
name="db_path"
|
||||
value={settings.db_path || ""}
|
||||
type="text"
|
||||
description={t("settings.db_path")}
|
||||
helpertext={t("settings.db_path_help")}
|
||||
/>
|
||||
</SettingsContext>
|
||||
<Button onClick={loadData}>{t("common.reload")}</Button>
|
||||
<Button onClick={showDlg} disabled={disabled}>
|
||||
|
||||
@@ -14,14 +14,10 @@
|
||||
}
|
||||
|
||||
.main {
|
||||
position: fixed;
|
||||
position: relative;
|
||||
top: 64px;
|
||||
}
|
||||
|
||||
.settings {
|
||||
width: 100vw;
|
||||
}
|
||||
|
||||
.settings div.text {
|
||||
width: 100%;
|
||||
}
|
||||
@@ -39,3 +35,11 @@
|
||||
.settings #s-cookies .mdc-text-field {
|
||||
min-width: 50%;
|
||||
}
|
||||
|
||||
.settings div.text.helper {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.settings div.text.helper label {
|
||||
margin-top: 14px;
|
||||
}
|
||||
|
||||
@@ -15,5 +15,7 @@
|
||||
"max_task_count": "Maximum number of parallel tasks: ",
|
||||
"max_retry_count": "Maximum retry count: ",
|
||||
"max_download_img_count": "Maximum number of parallel downloads of images: ",
|
||||
"save_dlg": "Do you want to save settings?"
|
||||
"save_dlg": "Do you want to save settings?",
|
||||
"db_path": "The folder where the database is stored: ",
|
||||
"db_path_help": "If not set, the download location is used."
|
||||
}
|
||||
|
||||
@@ -15,5 +15,7 @@
|
||||
"max_task_count": "最大并行任务数:",
|
||||
"max_retry_count": "最大重试次数:",
|
||||
"max_download_img_count": "最大图片并行下载数:",
|
||||
"save_dlg": "是否保存设置?"
|
||||
"save_dlg": "是否保存设置?",
|
||||
"db_path": "存放数据库的文件夹位置:",
|
||||
"db_path_help": "如果未设置,将使用下载位置。"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user