mirror of
https://github.com/lifegpc/eh-downloader.git
synced 2026-07-08 01:31:00 +08:00
Update settings page
This commit is contained in:
@@ -16,6 +16,7 @@ export type ConfigType = {
|
||||
export_zip_jpn_title: boolean;
|
||||
hostname: string;
|
||||
meili_host?: string;
|
||||
meili_search_api_key?: string;
|
||||
meili_update_api_key?: string;
|
||||
};
|
||||
|
||||
@@ -102,6 +103,9 @@ export class Config {
|
||||
get meili_host() {
|
||||
return this._return_string("meili_host");
|
||||
}
|
||||
get meili_search_api_key() {
|
||||
return this._return_string("meili_search_api_key");
|
||||
}
|
||||
get meili_update_api_key() {
|
||||
return this._return_string("meili_update_api_key");
|
||||
}
|
||||
@@ -121,6 +125,7 @@ export class Config {
|
||||
export_zip_jpn_title: this.export_zip_jpn_title,
|
||||
hostname: this.hostname,
|
||||
meili_host: this.meili_host,
|
||||
meili_search_api_key: this.meili_search_api_key,
|
||||
meili_update_api_key: this.meili_update_api_key,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -197,6 +197,24 @@ export default class Settings extends Component<SettingsProps> {
|
||||
description={t("settings.hostname")}
|
||||
type="text"
|
||||
/>
|
||||
<SettingsText
|
||||
name="meili_host"
|
||||
value={settings.meili_host || ""}
|
||||
description={t("settings.meili_host")}
|
||||
type="text"
|
||||
/>
|
||||
<SettingsText
|
||||
name="meili_update_api_key"
|
||||
value={settings.meili_update_api_key || ""}
|
||||
description={t("settings.meili_update_api_key")}
|
||||
type="text"
|
||||
/>
|
||||
<SettingsText
|
||||
name="meili_search_api_key"
|
||||
value={settings.meili_search_api_key || ""}
|
||||
description={t("settings.meili_search_api_key")}
|
||||
type="text"
|
||||
/>
|
||||
</SettingsContext>
|
||||
<Button onClick={loadData}>{t("common.reload")}</Button>
|
||||
<Button onClick={showDlg} disabled={disabled}>
|
||||
|
||||
@@ -7,6 +7,9 @@ const UNSAFE_TYPE: (keyof ConfigType)[] = [
|
||||
"db_path",
|
||||
"port",
|
||||
"hostname",
|
||||
"meili_host",
|
||||
"meili_search_api_key",
|
||||
"meili_update_api_key",
|
||||
];
|
||||
const UNSAFE_TYPE2 = UNSAFE_TYPE as string[];
|
||||
|
||||
|
||||
@@ -20,5 +20,8 @@
|
||||
"db_path_help": "If not set, the download location is used.",
|
||||
"port": "Listening port: ",
|
||||
"export_zip_jpn_title": "Use japanese title first when exporting zip.",
|
||||
"hostname": "Listening host: "
|
||||
"hostname": "Listening host: ",
|
||||
"meili_host": "Meilisearch server host: ",
|
||||
"meili_update_api_key": "Meilisearch API key for updating gallery metadata: ",
|
||||
"meili_search_api_key": "Meilisearch API key for searching: "
|
||||
}
|
||||
|
||||
@@ -20,5 +20,8 @@
|
||||
"db_path_help": "如果未设置,将使用下载位置。",
|
||||
"port": "监听端口:",
|
||||
"export_zip_jpn_title": "导出Zip时优先使用日语标题。",
|
||||
"hostname": "监听主机:"
|
||||
"hostname": "监听主机:",
|
||||
"meili_host": "Meilisearch服务器主机:",
|
||||
"meili_update_api_key": "用于更新画廊元数据的Meilisearch API密钥:",
|
||||
"meili_search_api_key": "用于搜索的Meilisearch API密钥:"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user