mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-08-29 14:57:05 +00:00
Introduce shared setting specifications for Advanced settings
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
import { ChunkAlgorithmNames } from "@vrtmrz/livesync-commonlib/compat/common/types";
|
||||
import type { SettingSpecGroup } from "./SettingSpec.ts";
|
||||
|
||||
export type AdvancedSettingSpecContext = {
|
||||
isCouchDB: () => boolean;
|
||||
};
|
||||
|
||||
/** Build the explicitly exposed standard controls for the existing Advanced page. */
|
||||
export function createAdvancedSettingSpecGroups({
|
||||
isCouchDB,
|
||||
}: AdvancedSettingSpecContext): readonly SettingSpecGroup[] {
|
||||
return [
|
||||
{
|
||||
heading: "Memory cache",
|
||||
items: [{ key: "hashCacheMaxCount", control: { type: "number", min: 10 } }],
|
||||
},
|
||||
{
|
||||
heading: "Local Database Tweak",
|
||||
items: [
|
||||
{
|
||||
key: "chunkSplitterVersion",
|
||||
control: { type: "dropdown", options: () => ChunkAlgorithmNames },
|
||||
},
|
||||
{ key: "customChunkSize", control: { type: "number", min: 0, allowZero: true } },
|
||||
],
|
||||
},
|
||||
{
|
||||
heading: "Transfer Tweak",
|
||||
items: [
|
||||
{ key: "readChunksOnline", control: { type: "toggle" }, visible: isCouchDB },
|
||||
{ key: "useOnlyLocalChunk", control: { type: "toggle" }, visible: isCouchDB },
|
||||
{
|
||||
key: "concurrencyOfReadChunksOnline",
|
||||
control: { type: "number", min: 10 },
|
||||
visible: isCouchDB,
|
||||
},
|
||||
{
|
||||
key: "minimumIntervalOfReadChunksOnline",
|
||||
control: { type: "number", min: 10 },
|
||||
visible: isCouchDB,
|
||||
},
|
||||
{ key: "autoAcceptCompatibleTweak", control: { type: "toggle", defaultValue: true } },
|
||||
],
|
||||
},
|
||||
{
|
||||
heading: "Remote Database Tweak",
|
||||
items: [{ key: "enableCompression", control: { type: "toggle" } }],
|
||||
},
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user